Coder Social home page Coder Social logo

[RFE] Add sound support about toolbox HOT 9 CLOSED

containers avatar containers commented on August 20, 2024
[RFE] Add sound support

from toolbox.

Comments (9)

HarryMichal avatar HarryMichal commented on August 20, 2024 1

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.

from toolbox.

lsahn-gh avatar lsahn-gh commented on August 20, 2024

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

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

from toolbox.

lsahn-gh avatar lsahn-gh commented on August 20, 2024

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.

from toolbox.

tosmi avatar tosmi commented on August 20, 2024

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

from toolbox.

aimileus avatar aimileus commented on August 20, 2024

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.

from toolbox.

tosmi avatar tosmi commented on August 20, 2024

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.

from toolbox.

lsahn-gh avatar lsahn-gh commented on August 20, 2024

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

from toolbox.

lsahn-gh avatar lsahn-gh commented on August 20, 2024

/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.

from toolbox.

jodkalemon avatar jodkalemon commented on August 20, 2024

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.

from toolbox.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.