Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFE] Add sound support #58

Closed
AsciiWolf opened this issue Feb 20, 2019 · 9 comments
Closed

[RFE] Add sound support #58

AsciiWolf opened this issue Feb 20, 2019 · 9 comments
Labels
1. Feature request A request for a new feature

Comments

@AsciiWolf
Copy link

Fedora Toolbox already supports GUI applications. It would be great if it could also have sound (PulseAudio or ALSA) support. :-)

@lsahn-gh
Copy link

This might work, --volume /dev/snd:/dev/snd.

Referred to this link, osrf/docker_images#21 (comment)

@lsahn-gh lsahn-gh mentioned this issue Feb 27, 2019
@lsahn-gh
Copy link

lsahn-gh commented Feb 27, 2019

With the mounting of /dev/snd, an application inside container doesn't work well if it the sound is used on the host at the same time.

Errors of mpv

ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
[ao/alsa] Playback open error: Device or resource busy
[ao/oss] Can't open audio device /dev/dsp: No such file or directory
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
[ao/jack] cannot open server
ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave
[ao/sdl] could not open audio: ALSA: Couldn't open audio device: Device or resource busy
[ao] Failed to initialize audio driver 'sdl'
Could not open/initialize audio device -> no sound.

@tosmi
Copy link
Contributor

tosmi commented Mar 6, 2019

could this be implemented via an option e.g.

$ toolbox --enable-sound enter

my plan is to run vlc, emacs (using emms) or even firefox within the toolbox container and this would require sound support.

jm2c
toni

@aimileus
Copy link
Contributor

aimileus commented Mar 6, 2019

I tried to use the PulseAudio socket from the host and that seems to be fine: PulseAudio works, even if the host uses audio at the same time.

1. Bind mount /dev/snd
2. Install pulseaudio-utils in the container with dnf.
3. Set $PULSE_SERVER to the value of /run/user/$(id -ru)/pulse/native, so that it uses the session of the host. I did not try to run a seperate PulseAudio session in the container.

Edit: Bind mounting /dev/snd is not necessary, of course, since the container does not access it directly.

@tosmi
Copy link
Contributor

tosmi commented Mar 8, 2019

i just discovered that sound simply works with vlc. /run/user/<uid>/native is available within the container. didn't have to install pulseaudio-utils, $PULSE_SERVER is not set. i'm using toolbox from master.

@lsahn-gh
Copy link

lsahn-gh commented Mar 9, 2019

Thank you all for the information, I will check it out both.

@lsahn-gh
Copy link

lsahn-gh commented Mar 13, 2019

/dev/snd might be sometimes necessary. For instance, liquidwar. it tries to access to /dev/snd directly.
However, in my case, exporting PULSE_SERVER is necessary in 0.0.6.

@jodkalemon
Copy link

I copied toolbox to my homedir, added a
--volume /dev/snd;/dev/snd
line to the create function and ran google-chrome in it and it just works.

@HarryMichal HarryMichal added this to Needs triage in Priority Board Jul 28, 2020
@HarryMichal
Copy link
Member

I believe this can be closed because Toolbox passes --volume /dev:/dev:rslave to podman create when a toolbox is created since v0.0.11.

Priority Board automation moved this from Needs triage to Closed Sep 10, 2020
@HarryMichal HarryMichal added the 1. Feature request A request for a new feature label Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Feature request A request for a new feature
Projects
No open projects
Priority Board
  
Closed
Development

No branches or pull requests

6 participants