vbox6: enable audio via OSS plugin

This commit is contained in:
Christian Helmuth 2021-09-09 10:50:26 +02:00 committed by Norman Feske
parent 2ba5e4a5b1
commit 77a5cf7fd4
6 changed files with 39 additions and 6 deletions

View File

@ -9,6 +9,7 @@ SRC_CC += Devices/Audio/DevHdaStream.cpp
SRC_CC += Devices/Audio/DevIchAc97.cpp
SRC_CC += Devices/Audio/DrvAudio.cpp
SRC_CC += Devices/Audio/DrvHostAudioNull.cpp
SRC_CC += Devices/Audio/DrvHostAudioOss.cpp
SRC_CC += Devices/Bus/DevPCI.cpp
SRC_CC += Devices/Bus/DevPciIch9.cpp
SRC_CC += Devices/Bus/MsiCommon.cpp

View File

@ -7,5 +7,6 @@ _/src/posix
_/src/stdcxx
_/src/vbox6
_/src/vfs
_/src/vfs_oss
_/src/vfs_pipe
_/src/zlib

View File

@ -16,6 +16,7 @@
<rtc/>
<rom label="usb_devices"/>
<usb/>
<audio_out/>
</requires>
<config verbose="yes">
@ -34,6 +35,8 @@
<service name="File_system"/>
<service name="Usb"/>
<service name="Nic"/>
<service name="Audio_out"/>
<service name="Audio_in"/>
</parent-provides>
<default-route> <any-service> <parent/> <any-child/> </any-service> </default-route>
@ -44,11 +47,12 @@
<binary name="virtualbox6" />
<resource name="RAM" quantum="8G"/>
<exit propagate="yes"/>
<config vbox_file="machine.vbox" xhci="yes" vm_name="linux" capslock="rom">
<config vbox_file="machine.vbox" xhci="yes" vm_name="linux" capslock="rom" ld_verbose="yes">
<vfs>
<dir name="dev">
<log/> <rtc/> <null/> <zero/>
<log/> <rtc/> <null/> <zero/> <oss name="dsp"/>
</dir>
<oss name="dsp"/>
<dir name="pipe"> <pipe/> </dir>
<dir name="shared"> <fs label="shared" writeable="yes"/> </dir>
<fs writeable="yes"/>
@ -58,6 +62,12 @@
</libc>
<arg value="virtualbox"/>
<env key="VBOX_USER_HOME" value="/"/>
<env key="VBOX_LOG_DEST" value="file=/dev/log"/>
<env key="VBOX_LOG" value="+drv_host_audio"/>
<env key="VBOX_LOG_FLAGS" value="thread"/>
<env key="VBOX_RELEASE_LOG_DEST" value="file=/dev/log"/>
<env key="VBOX_RELEASE_LOG" value=""/>
<env key="VBOX_RELEASE_LOG_FLAGS" value="thread"/>
</config>
<route>
<service name="Audio_out"> <parent/> </service>
@ -88,6 +98,7 @@
<rom label="qemu-usb.lib.so"/>
<rom label="stdcxx.lib.so"/>
<rom label="vfs.lib.so"/>
<rom label="vfs_oss.lib.so"/>
<rom label="vfs_pipe.lib.so"/>
</content>

View File

@ -21,6 +21,7 @@ lappend depot_archives [depot_user]/src/nitpicker
lappend depot_archives [depot_user]/src/report_rom
lappend depot_archives [depot_user]/src/vfs_import
lappend depot_archives [depot_user]/src/vfs_pipe
lappend depot_archives [depot_user]/src/vfs_oss
lappend_if [expr $use_net] depot_archives [depot_user]/src/ipxe_nic_drv
lappend_if [expr $use_net] depot_archives [depot_user]/src/nic_router
@ -34,6 +35,8 @@ lappend_if [expr $use_top] build_components app/top
lappend_if [expr $use_serial] build_components server/log_terminal
lappend_if [have_spec x86] build_components drivers/rtc
lappend build_components drivers/audio
build $build_components
set config {
@ -216,13 +219,13 @@ append config {
<start name="vbox1" priority="-2" caps="1800">
<binary name="virtualbox6"/>
<resource name="RAM" quantum="3000M"/>
<config vbox_file="virtualbox6.vbox" vm_name="TestVM">
<config vbox_file="virtualbox6.vbox" vm_name="TestVM" ld_verbose="yes">
<libc stdout="/dev/log" stderr="/dev/log" pipe="/pipe" rtc="/dev/rtc">
<pthread placement="single-cpu"/>
</libc>
<vfs>
<dir name="dev">
<log/> <rtc/> <null/> <zero/>
<log/> <rtc/> <null/> <zero/> <oss name="dsp"/>
</dir>
<dir name="pipe"> <pipe/> </dir>}
@ -257,6 +260,20 @@ append config {
<any-service> <parent/> <any-child/> </any-service>
</route>
</start>
<start name="audio_drv" priority="-1">
<binary name="pci_audio_drv"/>
<resource name="RAM" quantum="9M"/>
<provides>
<service name="Audio_out"/>
<service name="Audio_in"/>
</provides>
<config recording="yes">
<mixer field="outputs.master" value="255"/>
<mixer field="record.adc-0:1_source" value="sel2"/>
<mixer field="record.adc-0:1" value="255"/>
</config>
</start>
</config>
}
@ -268,7 +285,7 @@ copy_file [genode_dir]/repos/ports/run/virtualbox6.vbox bin/
# Instruct vesa_drv to use maximum resolution
#
set fd [open bin/fb_drv.config w]
puts $fd {<config buffered="yes"/>}
puts $fd {<config buffered="yes" width="1280" height="1024"/>}
close $fd
#
@ -293,6 +310,8 @@ append_if [expr $use_net] boot_modules { nic_router }
append_if [expr $use_serial] boot_modules { log_terminal }
append_if [expr $use_overlay] boot_modules { overlay.vdi }
lappend boot_modules pci_audio_drv
build_boot_image $boot_modules
append qemu_args " -m 3500 -cpu phenom "

View File

@ -68,7 +68,7 @@
<Port slot="0" enabled="false" IOBase="0x378" IRQ="7"/>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
</LPT>
<AudioAdapter controller="AC97" driver="Pulse" enabled="false"/>
<AudioAdapter controller="AC97" driver="OSS" enabled="true"/>
<RTC localOrUTC="UTC"/>
<SharedFolders/>
<Clipboard mode="Disabled"/>

View File

@ -40,6 +40,7 @@ extern "C" DECLEXPORT(int) VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_
REGISTER(g_DrvHostInterface);
REGISTER(g_DrvAUDIO);
REGISTER(g_DrvHostNullAudio);
REGISTER(g_DrvHostOSSAudio);
REGISTER(g_DrvACPI);
REGISTER(g_DrvAcpiCpu);
REGISTER(g_DrvVUSBRootHub);