[lxc-users] lxc guest cannot play sound using pulseaudio. tcp module is loaded with permission.

Fajar A. Nugraha list at fajar.net
Tue May 26 06:13:51 UTC 2015


On Tue, May 26, 2015 at 1:59 AM, Oz Dror <odror7 at gmail.com> wrote:
>
> On Mon, May 25, 2015 at 11:06 AM, Fajar A. Nugraha <list at fajar.net> wrote:
>>
>> On Tue, May 26, 2015 at 12:35 AM, Oz Dror <odror7 at gmail.com> wrote:
>> >> # pactl list sinks
>> >
>> >
>> > A soon as I connect the lxc guest all the sinks are lost and I have a
>> > suspended sink
>>
>> Your host and guest might be fighting for the same physical sound
>> devices. My guess is you use a custom setup which allows the guest to
>> takeover host's device (since it can run on vt8, and have devices
>> shown on "aplay -l"). My test was on defaut ubuntu container,
>> restricted by apparmor.
>>
>> You might be able to reconfigure alsa dan pulseaudio on the container
>> so alsa ONLY uses pulseaudio driver, and pulseaudio ONLY uses the tcp
>> module.
>
>
> Do you know how to do that.

Default ubuntu container on ubuntu host does that, since it can't
access any host physical devices.

>
> I commented allowing audio access in the config file
>  #lxc.cgroup.devices.allow = c 116:* rwm
> I also did not creare the devices in /dev/snd in the container.
> Now I can list the sinks and see all the audio cards in the container.
>
> I still cannot play anything because it is suspended. There is some
> improvement

Have you tried "pactl suspend-sink"? "man pactl" for details
Have you tried restarting both host and container? On some of my
tests, the listening port on the host ended up dead. Reloading the
module fixed the issue for me (restarting should do the same, as well
as clearing any intermittent problems)

If that still doesn't work, you should probably ask in pulseaudio list/forum.

-- 
Fajar


More information about the lxc-users mailing list