genode/repos/dde_bsd/run/audio_out.run
Josef Söntgen b8292124b9 audio_out.run: adapt for newer systems
Increase the RAM quota of the 'acpi' driver, add priorities and
configure the 'record_play_mixer' as is necessary on some newer
systems.

Issue #5331.
2024-09-06 10:37:40 +02:00

189 lines
4.8 KiB
Plaintext

assert_spec x86
if {[have_include "power_on/qemu"]} {
puts "\nAudio_out test running on Qemu is not supported.\n"
exit 0
}
if {[have_spec linux]} {
puts"\nAudio_out test running on Linux is not supported.\n"
exit 0
}
# select use of 'Audio_in/Audio_out' or 'Record/Play' sessions
proc use_record_play_sessions { } { return 1 }
create_boot_directory
import_from_depot [depot_user]/src/[base_src] \
[depot_user]/src/acpi \
[depot_user]/src/bsd_audio \
[depot_user]/src/init \
[depot_user]/src/pci_decode \
[depot_user]/src/platform \
[depot_user]/src/report_rom
proc build_targets { } {
set targets { driver/audio/pci }
if {[use_record_play_sessions]} {
lappend targets server/record_play_mixer app/waveform_player \
test/audio_play lib/vfs
} else {
lappend targets test/audio_out
}
}
build [build_targets]
proc audio_driver_config_attr { } {
if {[use_record_play_sessions]} {
return {report_mixer="yes" record_play="yes"}
} else {
return {report_mixer="yes"}
}
}
proc record_play_start_nodes { } {
if {![use_record_play_sessions]} {
return "" }
return {
<start name="mixer" priority="-1">
<resource name="RAM" quantum="2M"/>
<resource name="CPU" quantum="20"/>
<binary name="record_play_mixer"/>
<provides> <service name="Record"/> <service name="Play"/> </provides>
<config jitter_ms="10">
<mix name="left"> <play label_suffix="left" /> </mix>
<mix name="right"> <play label_suffix="right"/> </mix>
<policy label_suffix="left" record="left" period_ms="12" jitter_ms="5" volume="1.0"/>
<policy label_suffix="right" record="right" period_ms="12" jitter_ms="5" volume="1.0"/>
</config>
</start>
<start name="test-audio_play" priority="-2">
<resource name="RAM" quantum="40M"/>
<config sample_path="sample.f32">
<vfs> <rom name="sample.f32"/> </vfs>
</config>
<route>
<any-service><parent/><any-child/></any-service>
</route>
</start>
}
}
proc audio_in_out_start_nodes { } {
if {[use_record_play_sessions]} {
return "" }
return {
<start name="test-audio_out">
<resource name="RAM" quantum="4M"/>
<config>
<filename>sample.f32</filename>
</config>
<route>
<any-service><parent/><any-child/></any-service>
</route>
</start>
}
}
install_config {
<config verbose="yes" prio_levels="4">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer" priority="0">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="report_rom">
<resource name="RAM" quantum="2M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="yes">
<policy label="pci_decode -> system" report="acpi -> acpi"/>
<policy label="platform -> devices" report="pci_decode -> devices"/>
</config>
</start>
<start name="acpi" caps="350" priority="-1">
<resource name="RAM" quantum="8M"/>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="pci_decode" caps="350" priority="-1">
<resource name="RAM" quantum="2M"/>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<service name="ROM" label="system"> <child name="report_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="platform" caps="100" managing_system="yes" priority="-1">
<resource name="RAM" quantum="1M"/>
<provides>
<service name="Platform"/>
</provides>
<route>
<service name="ROM" label="devices"> <child name="report_rom"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<any-service> <parent/> </any-service>
</route>
<config>
<policy label="audio -> "> <pci class="AUDIO"/> <pci class="HDAUDIO"/> </policy>
</config>
</start>
<start name="audio" caps="150" priority="-1">
<binary name="pci_audio"/>
<resource name="RAM" quantum="2M"/>
<provides> <service name="Audio_out"/> <service name="Audio_in"/> </provides>
<config } [audio_driver_config_attr] {/>
</start>
} [record_play_start_nodes] {
} [audio_in_out_start_nodes] {
</config>}
#
# Get sample file
#
if {![file exists bin/sample.f32]} {
puts ""
puts "The sample file is missing. Please take a look at"
puts "repos/dde_bsd/README, create 'sample.f32' and put"
puts "the file into './bin'. afterwards"
puts ""
exit 1
}
build_boot_image [list {*}[build_artifacts] sample.f32]
run_genode_until forever