2015-04-29 15:00:04 +00:00
|
|
|
assert_spec x86
|
|
|
|
|
|
|
|
#
|
|
|
|
# Check used commands
|
|
|
|
#
|
|
|
|
|
2018-06-19 17:55:04 +00:00
|
|
|
set wget [installed_command wget]
|
2015-04-29 15:00:04 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Configure
|
|
|
|
#
|
|
|
|
|
|
|
|
set use_mixer 0
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build
|
|
|
|
#
|
|
|
|
|
|
|
|
set build_components {
|
2019-01-03 17:01:49 +00:00
|
|
|
core init timer
|
2015-08-12 12:21:24 +00:00
|
|
|
drivers/audio
|
2015-04-29 15:00:04 +00:00
|
|
|
test/audio_out
|
|
|
|
}
|
|
|
|
|
|
|
|
lappend_if $use_mixer build_components server/mixer
|
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
source ${genode_dir}/repos/base/run/platform_drv.inc
|
|
|
|
append_platform_drv_build_components
|
|
|
|
|
2015-04-29 15:00:04 +00:00
|
|
|
build $build_components
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
#
|
|
|
|
# Config
|
|
|
|
#
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<config>
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<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>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2015-04-29 15:00:04 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>}
|
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
append_platform_drv_config
|
2015-04-29 15:00:04 +00:00
|
|
|
|
|
|
|
append_if $use_mixer config {
|
|
|
|
<start name="mixer">
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides><service name="Audio_out"/></provides>
|
|
|
|
<route>
|
2015-08-12 12:21:24 +00:00
|
|
|
<service name="Audio_out"> <child name="audio_drv"/> </service>
|
2015-04-29 15:00:04 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
</start>}
|
|
|
|
|
2019-10-16 09:57:44 +00:00
|
|
|
append_if [have_spec linux] config {
|
|
|
|
<start name="audio_drv" ld="no">}
|
|
|
|
append_if [expr ![have_spec linux]] config {
|
|
|
|
<start name="audio_drv">}
|
2015-04-29 15:00:04 +00:00
|
|
|
append config {
|
2017-03-09 16:08:26 +00:00
|
|
|
<binary name="} [audio_drv_binary] {"/>
|
2015-04-29 15:00:04 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
2016-04-24 08:56:31 +00:00
|
|
|
<provides> <service name="Audio_out"/> </provides>
|
2019-10-16 09:57:44 +00:00
|
|
|
<!--
|
|
|
|
The proper ALSA device might need to be configured, e.g.
|
|
|
|
<config alsa_device="hw:CARD=Schiit,DEV=0"/>
|
|
|
|
when using Linux.
|
|
|
|
-->
|
|
|
|
<config/>
|
2015-04-29 15:00:04 +00:00
|
|
|
</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
|
|
|
|
#
|
|
|
|
|
2017-03-09 16:08:26 +00:00
|
|
|
append boot_modules {
|
|
|
|
core ld.lib.so init timer } [audio_drv_binary] {
|
|
|
|
test-audio_out sample.raw
|
|
|
|
}
|
2015-04-29 15:00:04 +00:00
|
|
|
|
|
|
|
lappend_if $use_mixer boot_modules mixer
|
|
|
|
|
2015-06-08 07:05:32 +00:00
|
|
|
append_platform_drv_boot_modules
|
2015-04-29 15:00:04 +00:00
|
|
|
|
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
2017-05-23 13:05:55 +00:00
|
|
|
append qemu_args " -nographic -soundhw es1370 "
|
2015-04-29 15:00:04 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# For obvious reasons the timeout depends on the total
|
|
|
|
# length of the used sample file.
|
|
|
|
#
|
|
|
|
run_genode_until {.*played.*1 time\(s\)} 60
|