Bug 248847 - www/firefox no audio playback after update to 80.0_2,1
Summary: www/firefox no audio playback after update to 80.0_2,1
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-23 11:01 UTC by jakub_lach
Modified: 2020-08-26 07:18 UTC (History)
2 users (show)

See Also:
jbeich: maintainer-feedback+


Attachments
firefox pkg-message (1.43 KB, patch)
2020-08-24 07:17 UTC, Goran Mekić
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description jakub_lach 2020-08-23 11:01:43 UTC
Alsa backend is check in make config dialog, and I didn't change my configuration.

$ pkg info | grep 'alsa'
alsa-lib-1.1.2_2               ALSA compatibility library
Comment 1 Goran Mekić 2020-08-23 11:08:09 UTC
Although it shouldn't change ALSA, OSS was added as an option. Can you check if you have media.cubeb.backend in your firefox about:config? If not, firefox is trying to use default driver (I'm not sure which one is that). If that config has value, only that driver will be used. You can set it to "oss" to use FreeBSD native driver.
Comment 2 jakub_lach 2020-08-23 11:10:48 UTC
I have just checked - I have only

media.cubeb.logging_level
media.cubeb.output_voice_routing
media.cubeb.sandbox
Comment 3 Goran Mekić 2020-08-23 11:14:17 UTC
Can you test if OSS works for you by creating media.cubeb.backend as string and giving it value oss? The OSS wasn't made default on FreeBSD to keep compatibility, but there might be some bug in the latest patch.
Comment 4 jakub_lach 2020-08-23 11:58:19 UTC
(In reply to Goran Mekić from comment #3)
Done - that fixes the problem. Thanks!
Comment 5 jakub_lach 2020-08-23 11:59:27 UTC
(In reply to jakub_lach from comment #4) 

FWIW, value 'alsa' does not.
Comment 6 Jan Beich freebsd_committer 2020-08-23 14:13:56 UTC
(In reply to jakub_lach from comment #5)
When alsa-lib is installed but alsa-plugin is *not* then cubeb detects libasound.so then chooses alsa instead of oss. This is correct on Linux where kernel has ALSA drivers but on FreeBSD only emulation via plugins like oss, jack, pulse, sndio is supported.

Check what pulled alsa-lib. If nothing, just remove the package.
Comment 7 jakub_lach 2020-08-23 14:22:18 UTC
(In reply to Jan Beich from comment #6)
Thanks,

$ pkg info -r '*alsa*'                                    
alsa-lib-1.1.2_2:
        ffmpeg-4.3.1_1,1
        openjdk8-8.265.01.1

At this point I have no preference between oss and alsa, I'm just happy I have working sound in Firefox again :)
Comment 8 VVD 2020-08-23 16:08:58 UTC
(In reply to Goran Mekić from comment #3)
> by creating media.cubeb.backend as string and giving it value oss
+ WebRTC work fine with this configuration.
I'm request to add this information to handbook: https://www.freebsd.org/doc/handbook/desktop-browsers.html or at least in www/firefox*/pkg-message.
Comment 9 Jan Beich freebsd_committer 2020-08-24 03:06:10 UTC
(In reply to jakub_lach from comment #7)
Rebuild www/firefox after disabling ALSA option, like current default.

(In reply to VVD from comment #8)
Already in pkg-message:
> Microphone selection only works in `oss`, `pulse`, `pulse-rust` backends.
Comment 10 VVD 2020-08-24 05:40:52 UTC
(In reply to Jan Beich from comment #9)
Where is "media.cubeb.backend" in this description?

I spend a lot of time last half of year to find how to turn on sound in WebRTC application like Discord or Zoom WITHOUT pulseaudio (with pulseaudio installed my system doesn't work properly and I don't need it for something else).
All information which I found in internet (forums, email lists, different documentation) said "doesn't work" or "use pulse - it work for me this way only". And nothing about set media.cubeb.backend=oss.
Comment 11 Goran Mekić 2020-08-24 07:17:27 UTC
Created attachment 217480 [details]
firefox pkg-message

This is my suggestion of pkg-message edit.
Comment 12 VVD 2020-08-24 10:56:03 UTC
(In reply to Goran Mekić from comment #11)
Can you add words about WebRTC, plz?
Comment 13 Jan Beich freebsd_committer 2020-08-24 11:42:53 UTC
(In reply to VVD from comment #10)
> Where is "media.cubeb.backend" in this description?

A few lines above. New users and binary package users don't need to touch media.cubeb.backend. I did confirm inside pristine jail on 11.3 i386 and 12.1 amd64.

Where it gets hairy is when a user has installed jackit or sndio or misconfigured pulseaudio by blindly following advices found on the internet (aimed for Linux). Each of those have their own maintainers while firefox provides a way to explicitly select a specific backend. However, pkg-message refers to about:support for troubleshooting.

> And nothing about set media.cubeb.backend=oss.

OSS was added in ports r370932 then removed in ports r485458 and re-added in ports r545611. Only the recent implementation supports device enumeration necessary for microphone selection in WebRTC.

(In reply to VVD from comment #12)
> Can you add words about WebRTC, plz?

See "Microphone selection...". WebRTC doesn't require microphone and camera, see data channels.
Comment 14 Goran Mekić 2020-08-24 12:36:17 UTC
(In reply to VVD from comment #12)
Gladly, but what about WebRTC? I'm not aware of any changes regarding WebRTC.
Comment 15 commit-hook freebsd_committer 2020-08-24 12:50:26 UTC
A commit references this bug:

Author: jbeich
Date: Mon Aug 24 12:50:00 UTC 2020
New revision: 546073
URL: https://svnweb.freebsd.org/changeset/ports/546073

Log:
  www/firefox: document probing order for the default audio backend

  PR:		248847

Changes:
  head/www/firefox/pkg-message
  head/www/firefox-esr/pkg-message
Comment 16 commit-hook freebsd_committer 2020-08-24 12:50:28 UTC
A commit references this bug:

Author: jbeich
Date: Mon Aug 24 12:50:10 UTC 2020
New revision: 546074
URL: https://svnweb.freebsd.org/changeset/ports/546074

Log:
  www/firefox: document native audio is no longer a missing feature

  Submitted by:	Goran Meki?
  PR:		248847

Changes:
  head/www/firefox/pkg-message
  head/www/firefox-esr/pkg-message
Comment 17 commit-hook freebsd_committer 2020-08-24 12:53:33 UTC
A commit references this bug:

Author: jbeich
Date: Mon Aug 24 12:52:41 UTC 2020
New revision: 546078
URL: https://svnweb.freebsd.org/changeset/ports/546078

Log:
  MFH: r546073

  www/firefox: document probing order for the default audio backend

  PR:		248847
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2020Q3/
  branches/2020Q3/www/firefox/pkg-message
  branches/2020Q3/www/firefox-esr/pkg-message
Comment 18 commit-hook freebsd_committer 2020-08-24 12:54:35 UTC
A commit references this bug:

Author: jbeich
Date: Mon Aug 24 12:53:33 UTC 2020
New revision: 546079
URL: https://svnweb.freebsd.org/changeset/ports/546079

Log:
  MFH: r546074

  www/firefox: document native audio is no longer a missing feature

  Submitted by:	Goran Meki?
  PR:		248847
  Approved by:	ports-secteam blanket

Changes:
_U  branches/2020Q3/
  branches/2020Q3/www/firefox/pkg-message
  branches/2020Q3/www/firefox-esr/pkg-message
Comment 19 Jan Beich freebsd_committer 2020-08-24 14:04:06 UTC
A hard to hit corner case. New users would have ALSA=off (current default), existing users with saved ALSA=on (previous default) would have alsa-plugins installed. Users who installed pulseaudio or sndio are not affected.

(In reply to VVD from comment #10)
> All information which I found in internet

pkg-message (ports r533208) was late because I don't have a microphone or a camera. 

My assumption was: ALSA's "default" (aka "/dev/dsp") is enough as microphone and speakers/headphones are plugged to the same panel. Do all webcams have a builtin microphone, exposed as a separate /dev/dspN?

> "doesn't work" or "use pulse - it work for me this way only"

https://wiki.freebsd.org/Sound#For_Firefox.2FChrome_video_conferencing:_sndio_integration_for_userspace_programs
Comment 20 VVD 2020-08-24 17:09:44 UTC
(In reply to Goran Mekić from comment #14)
> Gladly, but what about WebRTC? I'm not aware of any changes regarding WebRTC.
Sound in Discord voice channels (used WebRTC) work for me now.
With media.cubeb.backend=oss and doesn't work without media.cubeb.backend.
Zoom and other WebRTC application didn't tested yet.
Comment 21 VVD 2020-08-24 17:15:52 UTC
(In reply to Jan Beich from comment #19)
> https://wiki.freebsd.org/Sound#For_Firefox.2FChrome_video_conferencing:_sndio_integration_for_userspace_programs
How to find this link? My google show a lot of questions without answers. Why this information isn't in handbook or no link from handbook on this page?
Comment 22 VVD 2020-08-24 17:23:17 UTC
(In reply to Jan Beich from comment #13)
> WebRTC doesn't require microphone and camera
?
Some web application use WebRTC for audio (in/out) - without this option sound doesn't work.
But other web application doesn't use WebRTC for audio - youtube, twitch and etc work fine with and without this option.
Comment 23 jakub_lach 2020-08-24 17:30:58 UTC
(In reply to Jan Beich from comment #19)

>A hard to hit corner case. New users would have ALSA=off (current default), >existing users with saved ALSA=on (previous default) would have alsa-plugins >installed. Users who installed pulseaudio or sndio are not affected.

Somehow I did not have alsa-plugins installed, despite preserved previous defaults. I suspect Firefox could be historically original reason I had ALSA turned on in other ports, though not really needed here. Anyway, I would expect Firefox to pull in all dependencies still. All in all thanks for your prompt explanations and help.
Comment 24 Jan Beich freebsd_committer 2020-08-24 18:20:53 UTC
(In reply to VVD from comment #20)
> With media.cubeb.backend=oss and doesn't work without media.cubeb.backend.

Always check about:support. If it says "pulse-rust" then pulseaudio would be launched on demand by Firefox. "jack" needs to be started manually, "sndio" needs sndiod for proper A/V sync (bug 218188), "alsa" requires alsa-plugins to get oss (or pulse, or jack, etc).

Keep it simple and don't install any sound server.
Comment 25 VVD 2020-08-24 18:56:12 UTC
(In reply to Jan Beich from comment #24)
Firefox was build with ALSA - option from time before OSS support work again.
I have installed both:
audio/alsa-lib
audio/alsa-plugins

> Always check about:support.
Without media.cubeb.backend:
Звуковая подсистема	alsa
(Sound system?)
WebRTC doesn't work.

With media.cubeb.backend=oss:
Звуковая подсистема	oss
WebRTC work fine.

> Keep it simple and don't install any sound server.
Ofc! I don't need pulse/sndio/jack, but some software mandatory require.
OSS support is very good news for me!
Comment 26 VVD 2020-08-24 18:57:54 UTC
(In reply to VVD from comment #25)
Forgot: I'll rebuild FF without ALSA and will test default value for media.cubeb.backend (without it).
Comment 27 VVD 2020-08-26 06:09:11 UTC
(In reply to VVD from comment #26)
> Forgot: I'll rebuild FF without ALSA and will test default value for media.cubeb.backend (without it).
Tested - work as expected:
Without media.cubeb.backend:
Звуковая подсистема	oss
WebRTC work fine.

But anyway I request to add information about the WebRTC (possible with examples: Discord, Zoom and etc) and description of the media.cubeb.backend in the handbook: https://www.freebsd.org/doc/handbook/desktop-browsers.html

Thanks!
Comment 28 Jan Beich freebsd_committer 2020-08-26 07:16:36 UTC
(In reply to VVD from comment #27)
> I request to add information about the WebRTC

Patches welcome! Everyone here is a volunteer. See also bug 246449.