Bug 245251

Summary: www/chromium: Doesn't allow to choose a microphone
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Individual Port(s)Assignee: freebsd-chromium (Nobody) <chromium>
Status: Closed FIXED    
Severity: Affects Only Me CC: emaste, freebsd, gadskypapa, grahamperrin, lbartoletti, yuri
Priority: --- Flags: bugzilla: maintainer-feedback? (chromium)
Version: Latest   
Hardware: Any   
OS: Any   

Description Yuri Victorovich freebsd_committer freebsd_triage 2020-04-01 19:29:55 UTC
I have several microphones:

> $ /usr/local/bin/openal-info
> Available playback devices:
>     OSS Default
>     pcm0:play:dsp0
>     pcm1:play:dsp1
>     pcm2:play:dsp2
>     pcm3:play:dsp3
>     pcm4:play:dsp4
>     pcm5:play:dsp5
> Available capture devices:
>     OSS Default
>     pcm2:record:dsp2
>     pcm3:record:dsp3
>     pcm6:record:dsp6

But chrome://settings/content/microphone simply offers a choice of "Open Sound System", and doesn't allow to choose a microphone.

This is a severe usability issue.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2020-04-01 20:15:31 UTC
Firefox's behavior is much better. It offers the user to grant access to audio/video devices per-website when such access is required, with different audio/video devices being able to be chosen for individual websites.
Comment 2 Matthias Wolf 2020-04-02 08:59:42 UTC
Chromium uses ALSA by default, so you *should* see all audio devices configured in asound.conf.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2020-04-02 09:36:55 UTC
(In reply to Matthias Wolf from comment #2)

My etc/asound.conf.sample and etc/asound.conf are identical.

> Chromium uses ALSA by default <...>

Does it support any other ways to access audio?
Comment 4 Matthias Wolf 2020-04-02 10:00:32 UTC
The default asound.conf only uses the default OSS device as far as I know. The other options would be sndio and pulseaudio as options in the port (disabled by default).

Unfortunately, we don't have a native OSS backend (yet).
Comment 5 Andrey Khlebutin 2020-11-07 19:22:23 UTC
(In reply to Yuri Victorovich from comment #0)
Look here, maybe the way is OK for you
https://wiki.freebsd.org/Sound

Maybe the way should be documented in a more predictable/proper for chromium users place
Comment 7 Yuri Victorovich freebsd_committer freebsd_triage 2020-12-24 09:57:36 UTC
sndio option is now the default audio backend in chrome.

The new and upcoming version of sndio recognizes AUDIOPLAYDEVICE and AUDIORECDEVICE environment variables.

Calling chrome like this:
> AUDIOPLAYDEVICE=rsnd/2 AUDIORECDEVICE=rsnd/6 chrome

allows to choose both speaker and microphone OSS devices: /dev/audio2 and /dev/audio6.

Again, this is assuming that the SNDIO=ON (default) and audio/sndio is patched with the latest patches from https://github.com/ratchov/sndio

This solves the problem of selectability of audio devices, not in the runtime, but at least through environment variables.