Bug 259662 - audio/pulseaudio: no microphone in firefox
Summary: audio/pulseaudio: no microphone in firefox
Status: Closed DUPLICATE of bug 257639
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-desktop (Team)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-05 14:44 UTC by Tomasz "CeDeROM" CEDRO
Modified: 2021-11-08 03:10 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (desktop)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz "CeDeROM" CEDRO 2021-11-05 14:44:49 UTC
Hello world :-)

Recenlty microphone stopped working in Firefox when using PulseAudio backend (about:config / media.cubeb.backend = pulse). Microphones are available on the list but no audio is available. Mixer settings are fine.

When changing media.cubeb.backend to oss microphones work.

Chromium that uses sndio backend has microphones working.

I am using PulseAudio 14.2 from pkg and firefox 94.

# uname -a
FreeBSD 0xCFMX4 13.0-STABLE FreeBSD 13.0-STABLE #0 stable/13-n247979-3e322ded35f: Thu Nov  4 12:28:58 CET 2021     root@0xCFMX4:/usr/obj/usr/src/amd64.amd64/sys/GENERIC  amd64


# pkg info pulseaudio
pulseaudio-14.2_3
Name           : pulseaudio
Version        : 14.2_3
Installed on   : Fri Nov  5 15:43:15 2021 CET
Origin         : audio/pulseaudio
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : audio
Licenses       : LGPL21
Maintainer     : desktop@FreeBSD.org
WWW            : http://pulseaudio.org/
Comment        : Sound server for UNIX
Options        :
        ALSA           : off
        AVAHI          : off
        GCONF          : off
        GDBM           : off
        GSETTINGS      : off
        JACK           : off
        SIMD           : on
        SIMPLE         : on
        SOXR           : off
        SPEEX          : off
        TDB            : off
        TEST           : on
        WEBRTC_AEC     : on
        X11            : on
Shared Libs required:
        libglib-2.0.so.0
        libwebrtc_audio_processing.so.1
        liborc-0.4.so.0
        libdbus-1.so.3
        libcrypto.so.46
        libsndfile.so.1
        libssl.so.48
        libXtst.so.6
        libX11-xcb.so.1
        libintl.so.8
        libSM.so.6
        libfftw3f.so.3
        libICE.so.6
        libxcb.so.1
        libltdl.so.7
        libX11.so.6
Shared Libs provided:
        librtp.so
        libpulse-simple.so.0
        libprotocol-native.so
        liboss-util.so
        libprotocol-simple.so
        libpulsecore-14.2.so
        libwebrtc-util.so
        libcli.so
        libprotocol-http.so
        libpulsecommon-14.2.so
        libraop.so
        libpulse-mainloop-glib.so.0
        libpulse.so.0
        libprotocol-cli.so
        libpulsedsp.so
Annotations    :
        FreeBSD_version: 1300139
        cpe            : cpe:2.3:a:pulseaudio:pulseaudio:14.2:::::freebsd13:x64:3
Flat size      : 6.83MiB
Description    :
PulseAudio, previously known as Polypaudio, is a sound server for POSIX and
Win32 systems. A sound server is basically a proxy for your sound applications.
It allows you to do advanced operations on your sound data as it passes between
your application and your hardware. Things like transferring the audio to a
different machine, changing the sample format or channel count and mixing
several sounds into one are easily achieved using a sound server.

WWW: http://pulseaudio.org/

# pkg info firefox
firefox-94.0_2,2
Name           : firefox
Version        : 94.0_2,2
Installed on   : Tue Nov  2 01:50:43 2021 CET
Origin         : www/firefox
Architecture   : FreeBSD:13:amd64
Prefix         : /usr/local
Categories     : www
Licenses       :
Maintainer     : gecko@FreeBSD.org
WWW            : http://www.mozilla.com/firefox
Comment        : Web browser based on the browser portion of Mozilla
Options        :
        ALSA           : off
        CANBERRA       : off
        DBUS           : on
        DEBUG          : off
        FFMPEG         : on
        JACK           : on
        LIBPROXY       : off
        LTO            : on
        OPTIMIZED_CFLAGS: on
        PROFILE        : on
        PULSEAUDIO     : on
        SNDIO          : on
        TEST           : off
Shared Libs required:
        libdbus-glib-1.so.2
        libicuuc.so.70
        libXext.so.6
        libpango-1.0.so.0
        libfreetype.so.6
        libpixman-1.so.0
        libcairo.so.2
        libgtk-3.so.0
        libxcb-shm.so.0
        libffi.so.7
        libicui18n.so.70
        libwebp.so.7
        libcairo-gobject.so.2
        libatk-1.0.so.0
        libevent-2.1.so.7
        libplc4.so
        libXcomposite.so.1
        libvpx.so.7
        libxcb.so.1
        libgdk_pixbuf-2.0.so.0
        libgio-2.0.so.0
        libssl3.so
        libXfixes.so.3
        libwebpdemux.so.2
        libnss3.so
        libnssutil3.so
        libnspr4.so
        libgobject-2.0.so.0
        libglib-2.0.so.0
        libharfbuzz.so.0
        libX11.so.6
        libdbus-1.so.3
        libdav1d.so.5
        libXdamage.so.1
        libgraphite2.so.3
        libpng16.so.16
        libXrandr.so.2
        libaom.so.3
        libfontconfig.so.1
        libsmime3.so
        libX11-xcb.so.1
        libgdk-3.so.0
Annotations    :
        FreeBSD_version: 1300139
        cpe            : cpe:2.3:a:mozilla:firefox:94.0:::::freebsd13:x64:2
        no_provide_shlib: yes
        repo_type      : binary
        repository     : FreeBSD
Flat size      : 235MiB
Description    :
Mozilla Firefox is a free and open source web browser descended from the
Mozilla Application Suite. It is small, fast and easy to use, and offers
many advanced features:

 o Popup Blocking
 o Tabbed Browsing
 o Live Bookmarks (ie. RSS)
 o Extensions
 o Themes
 o FastFind
 o Improved Security

WWW: http://www.mozilla.com/firefox
Comment 1 Hans Petter Selasky freebsd_committer freebsd_triage 2021-11-05 14:56:15 UTC
Was pulseaudio started?
Comment 2 Tomasz "CeDeROM" CEDRO 2021-11-05 14:58:29 UTC
Sure :-) No change in setup. I can hear audio outputs, change sinks on the fly, the microphones are on the list but no audio comes in after recent updates of firefox / pulseaudio.
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2021-11-05 15:28:35 UTC
Pulseaudio plays with the mixer settings. Can you check that the volume for your mike is OK?

--HPS
Comment 4 Tomasz "CeDeROM" CEDRO 2021-11-05 16:24:15 UTC
Yup the mixer is okay. The same microphone works with oss and sndio.

I have tried to rebuild PA with other settings, no change, removing /usr/local/etc/pulse and using default configs, no change, replaced pulse with pulse-rust in FF backend, no change.

Cannot check with older version of FF because it uses older libraries and wont run.

I will switch to OSS backend for now in FF.
Comment 5 Tomasz "CeDeROM" CEDRO 2021-11-05 16:28:13 UTC
What is strange Firefox can see other microphones on the list but none of them give any data.

Looking at PulseAudio Troubleshooting Microphone part:
https://wiki.archlinux.org/title/PulseAudio/Troubleshooting#Microphone_not_detected_by_PulseAudio

There is arecord utility that can help troubleshoot microphone issues. It should return card list when invoked with -l switch, but it gives "no soundcards found...".

% arecord -l
arecord: device_list:279: no soundcards found...
Comment 6 Tomasz "CeDeROM" CEDRO 2021-11-05 16:32:22 UTC
Wow, this is strange, PulseAudio on my system is auto started by Enligthenment WM. I can see switch and control cards over E Mixer.

But command line PA tools see no cards :-)

% pacmd list-cards
0 card(s) available.

PA daemon is running for sure with local user privileges.

# ps aux|grep pulse
cd         81045   0.0  0.1   109012   10416  -  I    17:29      0:00.18 /usr/local/bin/pulseaudio --start --log-target=syslog
Comment 7 Tomasz "CeDeROM" CEDRO 2021-11-05 17:15:59 UTC
% pacmd dump
### Configuration dump generated at Fri Nov  5 18:15:31 2021

load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
load-module module-augment-properties
load-module module-switch-on-port-available
load-module module-oss device=/dev/dsp0
load-module module-oss device=/dev/dsp1
load-module module-oss device=/dev/dsp2
load-module module-oss device=/dev/dsp3
load-module module-oss device=/dev/dsp4
load-module module-native-protocol-unix
load-module module-default-device-restore
load-module module-always-sink
load-module module-intended-roles
load-module module-suspend-on-idle
load-module module-console-kit
load-module module-position-event-sounds
load-module module-role-cork
load-module module-filter-heuristics
load-module module-filter-apply
load-module module-cli-protocol-unix

set-sink-volume oss_output.dsp0 0xc000
set-sink-mute oss_output.dsp0 no
suspend-sink oss_output.dsp0 yes
set-sink-volume oss_output.dsp1 0x4000
set-sink-mute oss_output.dsp1 no
suspend-sink oss_output.dsp1 yes
set-sink-volume oss_output.dsp2 0xc000
set-sink-mute oss_output.dsp2 no
suspend-sink oss_output.dsp2 yes
set-sink-volume oss_output.dsp3 0xd999
set-sink-mute oss_output.dsp3 no
suspend-sink oss_output.dsp3 yes
set-sink-volume oss_output.dsp4 0xc000
set-sink-mute oss_output.dsp4 no
suspend-sink oss_output.dsp4 yes

set-source-volume oss_output.dsp0.monitor 0x10000
set-source-mute oss_output.dsp0.monitor no
suspend-source oss_output.dsp0.monitor yes
set-source-volume oss_input.dsp1 0xc000
set-source-mute oss_input.dsp1 no
suspend-source oss_input.dsp1 yes
set-source-volume oss_output.dsp1.monitor 0x10000
set-source-mute oss_output.dsp1.monitor no
suspend-source oss_output.dsp1.monitor yes
set-source-volume oss_input.dsp2 0x8000
set-source-mute oss_input.dsp2 no
suspend-source oss_input.dsp2 yes
set-source-volume oss_output.dsp2.monitor 0x10000
set-source-mute oss_output.dsp2.monitor no
suspend-source oss_output.dsp2.monitor yes
set-source-volume oss_input.dsp3 0x000
set-source-mute oss_input.dsp3 no
suspend-source oss_input.dsp3 yes
set-source-volume oss_output.dsp3.monitor 0x10000
set-source-mute oss_output.dsp3.monitor no
suspend-source oss_output.dsp3.monitor yes
set-source-volume oss_input.dsp4 0x7333
set-source-mute oss_input.dsp4 no
suspend-source oss_input.dsp4 yes
set-source-volume oss_output.dsp4.monitor 0x10000
set-source-mute oss_output.dsp4.monitor no
suspend-source oss_output.dsp4.monitor yes

set-default-sink oss_output.dsp4
set-default-source oss_input.dsp4

### EOF
Comment 8 Tomasz "CeDeROM" CEDRO 2021-11-05 17:56:57 UTC
Okay so the best GUI control tool for PulseAudio is the pavucontrol.

It allows simple control over everything in PA. Even display jumping bars per microphone input, and they jump, so the microphones are working from PA standpoint.

Seems to be problem with Firefox? ;-)
Comment 9 Hans Petter Selasky freebsd_committer freebsd_triage 2021-11-05 18:05:59 UTC
Did you try to ktrace -d firefox?

Try to see what dsp devices it opens and what ioctls are used.

--HPS
Comment 10 Tomasz "CeDeROM" CEDRO 2021-11-05 18:56:27 UTC
Thank you HPS for your time and hints. I have no more time to play with it at the moment sorry. When switching to OSS mic works fine but audio output seems jittered and video playback hangs. That may be something wrong with my local setup. Lets see if anyone reports similar issue or how it behaves with following PA / FF updates. TANK U SIR! :-) :-)
Comment 11 Tomasz "CeDeROM" CEDRO 2021-11-05 20:20:47 UTC
Sound jittering and streaming ripping is caused by dramatic Facebook solutions (also tested on current macOS). On BSD + PA when stream cuts several times per second output sink is destroyed and created again. It also consumes all of my memory and CPU. Who even use this FB crap anyway ;-) Everything else works fine :-)
Comment 12 Tomasz "CeDeROM" CEDRO 2021-11-05 21:29:06 UTC
Problem report confirmation on the mailing lists showed up.
Comment 14 Tomasz "CeDeROM" CEDRO 2021-11-08 03:10:14 UTC
Yuuup :-)

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257639

Thank you HPS! :-)

*** This bug has been marked as a duplicate of bug 257639 ***