Bug 238096 - www/firefox: some videos don't have sound - include sndio in default audio options
Summary: www/firefox: some videos don't have sound - include sndio in default audio op...
Status: Closed Not Enough Information
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: 2019-05-24 08:12 UTC by Dave Cottlehuber
Modified: 2019-09-17 13:31 UTC (History)
1 user (show)

See Also:
jbeich: maintainer-feedback+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Cottlehuber freebsd_committer freebsd_triage 2019-05-24 08:12:16 UTC
e.g. https://www.invidio.us/watch?v=_oWcfUt9QUs (a silent gnn is a rare thing)

the same video can be played directly via multimedia/mpv and it seems that
firefox chooses incorrect codecs.

while this may be specific to my computer setup, I have found that switching the
backend to sndio resolves this issue, on 3 different systems (intel i915, USB audio devices, HDMI output).

Is it possible to add SNDIO to the default OPTIONS_MULTI_AUDIO? the overall difference in size to www/firefox is negligable - a few KiB only, and it saves having to rebuild a very very large port each update.

Alternatively, I can provide more debugging info if needed, I'm just not sure where to look for that.
Comment 1 Jan Beich freebsd_committer freebsd_triage 2019-06-01 18:58:01 UTC
There's no "best" backend, see bug 216383.

> Is it possible to add SNDIO to the default OPTIONS_MULTI_AUDIO?

sndio backend in cubeb doesn't support lazy bindings, so enabling it would always pull libsndio.so even if unused. As sndio comes after alsa in backend autoselection it will be unused by default. FreeBSD support is also not upstreamed.

https://searchfox.org/mozilla-central/rev/662de518b168/media/libcubeb/src/cubeb_pulse.c#626-629
https://searchfox.org/mozilla-central/rev/662de518b168/media/libcubeb/src/cubeb.c#174-176,195-197

> Alternatively, I can provide more debugging info if needed, I'm just not sure where to look for that.

Dump Media section from about:support to confirm used backend. www/firefox won't use PulseAudio if audio/pulseaudio isn't installed.

If the backend is alsa then the issue maybe in either audio/alsa-plugins port options, /usr/local/etc/asound.conf or ~/.asoundrc. Check if you've modified any of these.

If the backend is pulse-rust or pulse then it could be stale configuration. Check if paplay works. If not try removing ~/.config/pulse. Otherwise, show audio/pulseaudio port options and "pacmd dump" output. See bug 211684 for rationale how default sink is selected.
Comment 2 Jan Beich freebsd_committer freebsd_triage 2019-06-01 20:27:17 UTC
(In reply to Jan Beich from comment #1)
> FreeBSD support is also not upstreamed.

This is a major blocker. I'm not interested in SNDIO, so someone has to pick up/restart the effort. As is SNDIO option contributes to technical debt and so can be pruned if it becomes too much of a burden (similar to OSS).

https://bugzilla.mozilla.org/show_bug.cgi?id=1351378
Comment 3 Jan Beich freebsd_committer freebsd_triage 2019-09-07 20:52:25 UTC
Feedback timeout. Cosidering a pilot error.
Comment 4 commit-hook freebsd_committer freebsd_triage 2019-09-07 20:53:24 UTC
A commit references this bug:

Author: jbeich
Date: Sat Sep  7 20:53:08 UTC 2019
New revision: 511423
URL: https://svnweb.freebsd.org/changeset/ports/511423

Log:
  gecko: enable SNDIO by default

  To avoid runtime dependency switch to dlopen(3).

  PR:		238096
  Requested by:	many

Changes:
  head/Mk/bsd.gecko.mk
  head/mail/thunderbird/Makefile
  head/mail/thunderbird/files/patch-cubeb-dlopen
  head/www/firefox/Makefile
  head/www/firefox/Makefile.options
  head/www/firefox/files/patch-cubeb-dlopen
  head/www/firefox-esr/Makefile
  head/www/firefox-esr/files/patch-cubeb-dlopen
Comment 5 Dave Cottlehuber freebsd_committer freebsd_triage 2019-09-17 13:31:34 UTC
I see sndio was enabled recently - with sndiod started, "stuff just works" now - thanks!

Prior to this ffox was using alsa according to about:support. There was no pulseaudio installed.