Microphone cannot be accessed within toolbox

When running Google Chrome from within a toolbox (currently not available as a flatpak) I can run most things just fine. However, when I try to use Google Meet or other video conferencing sites, these fail to access the microphone even after I have granted permissions to the browser. I don’t have similar issues with the video on my USB web camera. BlueJeans - as an example - reports a “Permission denied” error for the microphone when running within the Chrome browser.

Running SB 31 on a MacBook Pro (mid-2015 edition).

Let’s start by verifying your mic actually works inside the toolbox:
toolbox enter
sudo dnf install alsa-utils
arecord -d 3 /tmp/mic.wav && aplay /tmp/mic.wav

The latter will probably fail similarly to this:
ALSA lib pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave

This is related to Issue #58 on Github.
You may need to bind mount /dev/snd for this to work.
In the above test, merely installing pulseaudio-utils (inside the container) got aplay working.

sudo dnf install pulseaudio-utils

I’m using google chrome from within toolbox (just for specific cases where I need flash) and I have this in my container Buildahfile:

# Grab Chrome Browser for multimedia playback because media codecs
# aren't in the Firefox flatpak: http://discussion.fedoraproject.org/t/flatpaks-and-media-codecs/1086/36
# Install with --noscripts because there is a bunch of junk in the scriptlets
buildah run $ctr -- bash <<EOF
set -e
cd /usr/share/
wget https://dl.google.com/linux/direct/google-chrome-stable_current_x86_64.rpm
dnf deplist --nvr --resolve --requires /usr/share/google-chrome-stable_current_x86_64.rpm | \
    xargs dnf install -y
dnf install -y alsa-plugins-pulseaudio # since we want sound
rpm -ivh --noscripts /usr/share/google-chrome-stable_current_x86_64.rpm
EOF

So the alsa-plugins-pulseaudio rpm worked for me.

2 Likes

Installing alsa-plugins-pulseaudio did the trick. Just installing pulseaudio-utils was not sufficient.

Thanks @kon14 and @dustymabe!

2 Likes