[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enable audio virtualization in Xen





On Thu, Sep 1, 2022 at 11:58 AM SHARMA, JYOTIRMOY <JYOTIRMOY.SHARMA@xxxxxxx> wrote:

[AMD Official Use Only - General]


Hi all,


Hello Jyotirmoy.

[sorry for the possible format issues]

 

 

Forgot to mention that I am able to play audio from HVM guest with Pulse Audio as back end.

 

good.

 

Here is the corresponding HVM configuration:

 

vsnd = [[ 'card, backend=Domain-0, buffer-size=65536, short-name=VCard, long-name=Virtual sound card, sample-rates=44100, sample-formats=s16_le', 'pcm, name=dev1', 'stream, unique-id=pulse, type=P' ]]

 

I have used xen front end and snd_be (along with libxenbe) as back end as suggested by Christopher earlier in this thread.

 

Only when I change unique-id=alsa, audio is not working from HVM guest.

 

If anyone has tried ALSA back end (instead of PA), please let me know what I am missing.

 

We use snd_be over pulse and it works fine. I am not too familiar with all that sound's internals. But I would suggest looking at the following thread where Oleksandr Grytsov (the author of the snd_be) mentioned the need of HW parameters matching for alsa [1].

I made an experiment with alsa (however I am not 100% sure whether it is correct), nevertheless details are below.

I changed guest config to use alsa:
vsnd = [[ 'card, backend=DomD, buffer-size=65536, short-name=VCard, long-name=Virtual sound card, sample-rates=8000;11025;16000;22050;32000;44100;48000, sample-formats=s16_le',
     'pcm, name=dev1', 'stream, unique-id=alsa, type=P'
    ]]

And checked that snd_be started using alsa:
03.07.22 03:37:17.185 | SndFrontend  | DBG - Parse stream id: alsa
03.07.22 03:37:17.186 | SndFrontend  | DBG - Create pcm device, type: ALSA, device: , propName: , propValue:
...

With that command running in DomU I heard the audio in headphones:
root@salvator-x-h3-4x2g-xt-domu:~# cat /dev/urandom | aplay -f S16_LE -c 2 -D hw:0,0
Playing raw data 'stdin' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo

This is the output of "aplay -l" in both domains just in case:
root@salvator-x-h3-4x2g-xt-domd:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: rcarsound [rcar-sound], device 0: rsnd-dai.0-ak4613-hifi ak4613-hifi-0 []
 Subdevices: 0/1
 Subdevice #0: subdevice #0
root@salvator-x-h3-4x2g-xt-domu:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: vsnd [], device 0: dev1 [Virtual card PCM]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 

 

Regards,

Jyotirmoy

 



--
Regards,

Oleksandr Tyshchenko

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.