Bug 1683 - Enable sound for qemux86
Summary: Enable sound for qemux86
Status: RESOLVED FIXED
Alias: None
Product: BSPs
Classification: Build System, Metadata & Runtime
Component: bsps-oe-core (show other bugs)
Version: unspecified
Hardware: x86 Multiple
: Low enhancement
Target Milestone: Future
Assignee: Robert Yang
QA Contact: Alexandru Georgescu
URL:
Whiteboard:
: 5602 (view as bug list)
Depends on: 4827
Blocks: 1018
  Show dependency tree
 
Reported: 2011-10-17 06:35 UTC by Paul Eggleton
Modified: 2016-09-15 04:17 UTC (History)
9 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: Don't know


Attachments
Patch 1 to enable sound (1.09 KB, patch)
2011-11-15 13:28 UTC, Richard Purdie
no flags Details | Diff
Patch 2 to enable sound (634 bytes, patch)
2011-11-15 13:28 UTC, Richard Purdie
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Eggleton 2011-10-17 06:35:59 UTC
It would be useful if sound was enabled by default by the runqemu script. To enable sound manually I found I needed to do three things:

1) export QEMU_AUDIO_DRV=alsa (otherwise it defaults to oss, which is not available by default on my Ubuntu system)

2) Add qemuparams="-soundhw all" to runqemu command line (you can select drivers more specifically, but given there are only three supported drivers I don't think it matters)

3) modprobe snd-ens1370 within the running system - apparently we already install the appropriate kernel module, we just need to auto-load it.
Comment 1 Richard Purdie 2011-11-15 13:28:04 UTC
Created attachment 280 [details]
Patch 1 to enable sound
Comment 2 Richard Purdie 2011-11-15 13:28:31 UTC
Created attachment 281 [details]
Patch 2 to enable sound
Comment 3 Richard Purdie 2011-11-15 13:30:19 UTC
I tried this (patches attached). I ran into the complexity of my system running pulseaudio. To make this work we'd need to enable pulseaudio in qemu-native/nativesdk by building pulseaudio as a dependency for qemu.

We could really use a way to turn these features on/off in the qemu script.
Comment 4 Paul Eggleton 2011-11-15 14:23:08 UTC
Surely you don't *need* pulseaudio support in an application just to play sound with it installed? I was under the impression it provided a standard ALSA interface.
Comment 5 Richard Purdie 2011-11-15 15:26:30 UTC
Running qemu complained my alsa device was locked, presumably by pulseaudio which was active on the system. Qemu also has a pulseaudio specific backend...
Comment 6 Cristian Iorga 2014-03-20 15:19:15 UTC
Using pulseaudio as the audio backend for qemu works, however, it is my understanding that not all Linux distros rely on pulseaudio server for audio services. This would basically mean, at a minimal level, to detect at runtime (runqemu) which audio server is used (pa, alsa, oss) and set qccordingly qemu.
Another issue that needs to get solved is that sound from guest machines is muted while using qemu's pulseaudio backend. This also needs to get fixed.
Finally, a little bit of cleanup needs to be performed in qemu scripts (runqemu).
Comment 7 Stephen K Jolley 2014-07-31 15:26:23 UTC
*** Bug 5602 has been marked as a duplicate of this bug. ***
Comment 8 Robert Yang 2016-09-15 04:17:43 UTC
Now the audio support is controlled by bsp, it can set QB_AUDIO_DRV, QB_AUDIO_DRV and QB_AUDIO_OPT, see meta/classes/qemuboot.bbclass for more info.

Merged into master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=b405712414de98cba3a645601419aceb32d52f02

And qemux86, qemux86-64's sound support had been done.