mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-25 08:21:08 +00:00
47990f37d7
In addition to updating the contrib sources the driver now uses the new Component API and will report the internal mixer state. Reporting of the mixer state is enabled by adding the 'report_mixer' attribute to the drivers configuration and setting its value to 'yes'. The following snippets illustrates the format of the report: !<mixer_state> ! <mixer field="inputs.beep" value="108"/> ! <mixer field="outputs.hp_sense" value="plugged"/> ! <mixer field="outputs.master" value="128,128"/> ! <mixer field="outputs.mic_sense" value="unplugged"/> ! <mixer field="outputs.spkr_muters" value="hp,mic"/> !</mixer_state> The mixer state may expose other mixer fields as well, depending on the used sound card. The naming scheme of the attributes intentionally matches the naming scheme of OpenBSD's mixerctl(1) program. Each 'mixer' node can be used to configure the audio driver by using it in its configuration, e.g.: !<config report_mixer="yes"> ! <mixer field="outputs.master" value="255,255"/> !</config> This configuration will set the output volume to the highest possible value. Although it is now also possible to update the configuration at run-time it should not be done while the driver is currently playing or recording because it may provoke the generation of artefacts. Fixes #1973.
131 lines
2.4 KiB
Plaintext
131 lines
2.4 KiB
Plaintext
assert_spec x86
|
|
|
|
#
|
|
# Check used commands
|
|
#
|
|
|
|
set wget [check_installed wget]
|
|
|
|
#
|
|
# Configure
|
|
#
|
|
|
|
set use_mixer 0
|
|
|
|
#
|
|
# Build
|
|
#
|
|
|
|
set build_components {
|
|
core init
|
|
drivers/timer
|
|
drivers/audio
|
|
test/audio_out
|
|
}
|
|
|
|
lappend_if $use_mixer build_components server/mixer
|
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
append_platform_drv_build_components
|
|
|
|
build $build_components
|
|
|
|
create_boot_directory
|
|
|
|
#
|
|
# Config
|
|
#
|
|
|
|
append config {
|
|
<config>
|
|
<parent-provides>
|
|
<service name="ROM"/>
|
|
<service name="RAM"/>
|
|
<service name="IRQ"/>
|
|
<service name="IO_MEM"/>
|
|
<service name="IO_PORT"/>
|
|
<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>
|
|
<start name="timer">
|
|
<resource name="RAM" quantum="1M"/>
|
|
<provides><service name="Timer"/></provides>
|
|
</start>}
|
|
|
|
append_platform_drv_config
|
|
|
|
append_if $use_mixer config {
|
|
<start name="mixer">
|
|
<resource name="RAM" quantum="2M"/>
|
|
<provides><service name="Audio_out"/></provides>
|
|
<route>
|
|
<service name="Audio_out"> <child name="audio_drv"/> </service>
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
</route>
|
|
</start>}
|
|
|
|
append config {
|
|
<start name="audio_drv">
|
|
<resource name="RAM" quantum="8M"/>
|
|
<provides> <service name="Audio_out"/> </provides>
|
|
</start>
|
|
<start name="test-audio_out">
|
|
<resource name="RAM" quantum="4M"/>
|
|
<config>
|
|
<filename>sample.raw</filename>
|
|
</config>
|
|
<route>}
|
|
append_if $use_mixer config {
|
|
<service name="Audio_out"><child name="mixer"/></service>}
|
|
append config {
|
|
<any-service><parent/><any-child/></any-service>
|
|
</route>
|
|
</start>
|
|
</config>}
|
|
|
|
install_config $config
|
|
|
|
|
|
#
|
|
# Get sample file
|
|
#
|
|
|
|
if {[info exists env(GENODE_SAMPLE_RAW)]} {
|
|
catch { exec $wget $::env(GENODE_SAMPLE_RAW) -O bin/sample.raw }
|
|
}
|
|
|
|
if {![file exists bin/sample.raw]} {
|
|
puts ""
|
|
puts "The sample file is missing. Please take a look at"
|
|
puts "repos/dde_bsd/README, create 'sample.raw' and put"
|
|
puts "the file into './bin'. afterwards"
|
|
puts ""
|
|
exit 1
|
|
}
|
|
|
|
#
|
|
# Boot modules
|
|
#
|
|
|
|
set boot_modules {
|
|
core init timer audio_drv test-audio_out sample.raw }
|
|
|
|
lappend_if $use_mixer boot_modules mixer
|
|
|
|
append_platform_drv_boot_modules
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
append qemu_args " -m 128 -nographic -soundhw es1370 "
|
|
|
|
#
|
|
# For obvious reasons the timeout depends on the total
|
|
# length of the used sample file.
|
|
#
|
|
run_genode_until {.*played.*1 time\(s\)} 60
|