I found how to do it (I have other errors now but at least it looks like I can export).

I am with archlinux and I launch libivirtd with systemctl so the explanations are for this way to launch libvirtd

There is two options to uncomment in the file /etc/libvirt/qemu.conf
uncomment the following lines and be sure to put them equal to 1:*
*

   *vnc_allow_host_audio = 1 *

and further down *
*

   *nographics_allow_host_audio = 1*


This options will stop libvirt to set up QEMU_AUDIO_DRV=none but to export the environment variable you need to change another file

edit the file: */usr/lib/systemd/system/libvirtd.service*
and under the [Service] section add the linde
*    Environment=export QEMU_AUDIO_DRV=alsa

*If you check your log in /var/log/libvirt/qemu/yourdomain.log you should see that the environment variable is activate.

However, as said, I face others issues now:

   Home directory not accessible: Permission denied
   ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
   ALSA lib conf.c:4292:(_snd_config_evaluate) function
   snd_func_card_driver returned error: No such file or directory
   ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
   ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_concat
   returned error: No such file or directory
   ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
   ALSA lib conf.c:4292:(_snd_config_evaluate) function snd_func_refer
   returned error: No such file or directory
   ALSA lib conf.c:4771:(snd_config_expand) Evaluate error: No such
   file or directory
   ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM sysdefault
   alsa: Could not initialize ADC
   alsa: Failed to open `default':
   alsa: Reason: No such file or directory
   audio: Failed to create voice `ac97.pi'

So I don't know if it is linked to the way I export the variable or not. I haven't check that but I thought you may want to know how to do it.

Regards.

Feadurn





On 08/12/15 05:18, Okky Hendriansyah wrote:
On December 8, 2015 at 06:24:29, Feadurn ([email protected] <mailto:[email protected]>) wrote:
I am still a little bit lost on the way to activate the "export
QEMU_AUDIO_DRV=alsa" when using libvirtd. There is an option in
libvirt/qemu.conf : nographics_allow_host_audio=1. Do I just need to
uncomment that line?

Thank you very much

Hi Feadurn,

That was one of my reasons I haven’t migrate all my QEMU script to libvirt. I had issues enabling the host audio like I use in my plain QEMU script. If you’re using Alex’ wrapper script way [1], probably you can regex replace it with ALSA. I never tried myself though.

Reading the description,

# By default, if no graphical front end is configured, libvirt will disable
# QEMU audio output since directly talking to alsa/pulseaudio may not work
# with various security settings. If you know what you're doing, enable
# the setting below and libvirt will passthrough the QEMU_AUDIO_DRV
# environment variable when using nographics.

I think that option is worth to try. Thanks for pointing this.


[1] http://vfio.blogspot.com/2015/05/vfio-gpu-how-to-series-part-5-vga-mode.html

--
*Okky Hendriansyah*


_______________________________________________
vfio-users mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/vfio-users

Reply via email to