|
| 1 | +# |
| 2 | +# Build |
| 3 | +# |
| 4 | + |
| 5 | +set build_components { |
| 6 | + core init |
| 7 | + drivers/timer |
| 8 | + drivers/audio |
| 9 | + server/report_rom |
| 10 | + server/dynamic_rom |
| 11 | + app/audio_player |
| 12 | +} |
| 13 | + |
| 14 | +source ${genode_dir}/repos/base/run/platform_drv.inc |
| 15 | +append_platform_drv_build_components |
| 16 | + |
| 17 | +build $build_components |
| 18 | + |
| 19 | +create_boot_directory |
| 20 | + |
| 21 | +# |
| 22 | +# Config |
| 23 | +# |
| 24 | + |
| 25 | +append config { |
| 26 | +<config> |
| 27 | + <parent-provides> |
| 28 | + <service name="ROM"/> |
| 29 | + <service name="RAM"/> |
| 30 | + <service name="IRQ"/> |
| 31 | + <service name="IO_MEM"/> |
| 32 | + <service name="IO_PORT"/> |
| 33 | + <service name="CAP"/> |
| 34 | + <service name="PD"/> |
| 35 | + <service name="RM"/> |
| 36 | + <service name="CPU"/> |
| 37 | + <service name="LOG"/> |
| 38 | + <service name="SIGNAL" /> |
| 39 | + </parent-provides> |
| 40 | + <default-route> |
| 41 | + <any-service> <parent/> <any-child/> </any-service> |
| 42 | + </default-route> |
| 43 | + <start name="timer"> |
| 44 | + <resource name="RAM" quantum="1M"/> |
| 45 | + <provides><service name="Timer"/></provides> |
| 46 | + </start>} |
| 47 | + |
| 48 | +append_platform_drv_config |
| 49 | + |
| 50 | +append config { |
| 51 | + <start name="report_rom"> |
| 52 | + <resource name="RAM" quantum="4M"/> |
| 53 | + <provides> <service name="Report"/> <service name="ROM"/> </provides> |
| 54 | + <config verbose="yes"> |
| 55 | + <rom> |
| 56 | + <policy label="" report="audio_player -> current_track"/> |
| 57 | + </rom> |
| 58 | + </config> |
| 59 | + </start> |
| 60 | + |
| 61 | + <start name="dynamic_rom"> |
| 62 | + <resource name="RAM" quantum="4M"/> |
| 63 | + <provides><service name="ROM"/></provides> |
| 64 | + <config verbose="yes"> |
| 65 | + <rom name="playlist"> |
| 66 | + <inline description="initial playlist"> |
| 67 | +<playlist> |
| 68 | + <track path="foo.mp3"/> |
| 69 | + <track path="foo.ogg"/> |
| 70 | + <track path="foo.flac"/> |
| 71 | +</playlist> |
| 72 | + </inline> |
| 73 | + <sleep milliseconds="30000"/> |
| 74 | + <inline description="initial playlist"> |
| 75 | +<playlist> |
| 76 | + <track path="foo.ogg"/> |
| 77 | +</playlist> |
| 78 | + </inline> |
| 79 | + <sleep milliseconds="30000"/> |
| 80 | + </rom> |
| 81 | + <rom name="audio_player.config"> |
| 82 | + <inline description="initial config"> |
| 83 | +<config ld_verbose="yes" state="playing" playlist_mode="repeat"> |
| 84 | + <report progress="yes" interval="1" playlist="yes"/> |
| 85 | + <libc> |
| 86 | + <vfs> |
| 87 | + <rom name="foo.mp3"/> |
| 88 | + <rom name="foo.flac"/> |
| 89 | + <rom name="foo.ogg"/> |
| 90 | + </vfs> |
| 91 | + </libc> |
| 92 | +</config> |
| 93 | + </inline> |
| 94 | + <sleep milliseconds="10000"/> |
| 95 | + <inline description="select third track"> |
| 96 | +<config state="playing" playlist_mode="repeat" selected_track="3"/> |
| 97 | + </inline> |
| 98 | + <sleep milliseconds="5000"/> |
| 99 | + <inline description="select first track"> |
| 100 | +<config state="playing" playlist_mode="repeat" selected_track="1"/> |
| 101 | + </inline> |
| 102 | + <sleep milliseconds="5000"/> |
| 103 | + <inline description="select second track"> |
| 104 | +<config state="playing" playlist_mode="repeat" selected_track="2"/> |
| 105 | + </inline> |
| 106 | + <sleep milliseconds="5000"/> |
| 107 | + </rom> |
| 108 | + </config> |
| 109 | + </start> |
| 110 | + |
| 111 | + <start name="audio_drv"> |
| 112 | + <resource name="RAM" quantum="8M"/> |
| 113 | + <provides> <service name="Audio_out"/> </provides> |
| 114 | + <config/> |
| 115 | + </start> |
| 116 | + |
| 117 | + <start name="audio_player"> |
| 118 | + <resource name="RAM" quantum="16M"/> |
| 119 | + <configfile name="audio_player.config"/> |
| 120 | + <route> |
| 121 | + <service name="ROM" label="audio_player.config"> <child name="dynamic_rom"/> </service> |
| 122 | + <service name="ROM" label="playlist"> <child name="dynamic_rom"/> </service> |
| 123 | + <service name="Report" label="current_track"> <child name="report_rom"/> </service> |
| 124 | + <any-service> <parent/> <any-child/> </any-service> |
| 125 | + </route> |
| 126 | + </start> |
| 127 | +</config>} |
| 128 | + |
| 129 | +install_config $config |
| 130 | + |
| 131 | +# |
| 132 | +# Check audio files |
| 133 | +# |
| 134 | + |
| 135 | +if {[expr ![file exists bin/foo.flac] || ![file exists bin/foo.mp3] || ![file exists bin/foo.ogg]]} { |
| 136 | + puts "" |
| 137 | + puts "One or all audio files are missing. Please put 'foo.flac', 'foo.mp3' and" |
| 138 | + puts "'foo.ogg' into './bin' and execute this run script again. Note, that the" |
| 139 | + puts "duration of each of those files has to be below 10 seconds for this run" |
| 140 | + puts "script to work properly." |
| 141 | + puts "" |
| 142 | + exit 1 |
| 143 | +} |
| 144 | + |
| 145 | +# |
| 146 | +# Boot modules |
| 147 | +# |
| 148 | + |
| 149 | +set boot_modules { |
| 150 | + core init timer dynamic_rom report_rom audio_drv |
| 151 | + ld.lib.so libc.lib.so libm.lib.so zlib.lib.so |
| 152 | + avcodec.lib.so avformat.lib.so avutil.lib.so |
| 153 | + avresample.lib.so pthread.lib.so |
| 154 | + audio_player |
| 155 | + foo.mp3 foo.flac foo.ogg |
| 156 | +} |
| 157 | + |
| 158 | +append_platform_drv_boot_modules |
| 159 | + |
| 160 | +build_boot_image $boot_modules |
| 161 | + |
| 162 | +run_genode_until forever |
0 commit comments