Bug 216041 - www/firefox-esr: volume level changes on its own with SNDIO option enabled
Summary: www/firefox-esr: volume level changes on its own with SNDIO option enabled
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-13 20:48 UTC by Sergey
Modified: 2018-02-14 18:31 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 2017-01-13 20:48:32 UTC
Hello.

Following issue may relate to some way with Bug 215867.
On Firefox-esr 45.6.0 volume level changes from high to low and back again periodically. It happens on its own, when videoclip is paused for some time and resumed afterwards. When you hear to sound pretty comfortably after pause/resume the sound may become harldy noticed. After some time (there is no any correlations noticed yet) after several pauses/resumes, maybe several hours the volume level can become high again. That could be related to sndiod, but I don't know how to check that.

$ uname -r
11.0-STABLE

Regards,
Sergey P.
Comment 1 Sergey 2017-01-15 09:42:59 UTC
Sometimes (not very often) frequent click and snaps are heard but pausing/resuming the video or dragging the handle removes them. Restarting the sndiod service also removes them and sound becomes clear.
Comment 2 Tobias Kortkamp freebsd_committer freebsd_triage 2017-01-25 22:42:42 UTC
(In reply to Sergey from comment #0)

I don't think this related to the fix from bug #215867.  The patches
don't change anything related to volume.

You might be interested in this thread on openbsd-ports:
https://marc.info/?l=openbsd-ports&m=146747100730968&w=1

(In reply to Sergey from comment #1)

> Sometimes (not very often) frequent click and snaps are heard but
> pausing/resuming the video or dragging the handle removes
> them. Restarting the sndiod service also removes them and sound
> becomes clear.

This is really a separate issue to the one you opened this bug for,
but it doesn't matter :)

Does it happen with www/firefox or other sndio clients also?  Try
playing a video file with multimedia/mpv with SNDIO=on (`mpv -ao sndio video.mp4`)
and check if video and audio get out of sync.  mpv is the most
pedantic sndio client I know of.

If other apps are affected as well that might be a problem with sndio,
snd_emu10k1(4), or the interaction of both.  If sndio is not getting
an accurate playback position from the device then this can lead to
the problems you describe.

Please run sndiod in the foreground with `env SNDIO_DEBUG=1 sndiod -dd
-m play -f rsnd/0` as your regular user.  You should a message when
Firefox or mpv connects to it.  If you don't see any error message
when the snaps start, try increasing the debug level to 3 or 4.
Upload the log to some pastebin service and post the URL here.  To get
a log file it's probably easiest to do it in a script(1) session.
Comment 3 Sergey 2017-01-29 17:08:46 UTC
(In reply to Tobias Kortkamp from comment #2)

well, I've tested sndio at least with mplayer and there were no any clicks yet.

Here is the log file when clicks have been heard: 
http://pastebin.com/WN5Z1yvG

Here is the log file when the were no clicks:
http://pastebin.com/reYH1CVw

As for sound volume, I've found out that when html5 player shows the volume as 100% (at bottom right corner) the sound may still be low, but when you pull thevolume graph/bar left and right the volume does increase. So the graph of the html5 player lies. Didn't noticed that with alsa drivers.
Why not to implement OSS output for the firefox in this case?

Best regards,
Sergey.
Comment 4 Sergey 2017-03-08 06:17:29 UTC
I've switched from Firefox-ESR to Firefox recently compiled with SNDIO option enabled. If I stop sndiod server firefox works perfectly without it (why not to add 'none' as an option?). If I start sndiod then some clicks do appear sometimes when I move the html5 scroller or even freezes untill I move it further. Also when I increase or decrease volume sound change not so smoothly as with when sndios is stopped.
Comment 5 Jan Beich freebsd_committer freebsd_triage 2017-03-08 22:55:11 UTC
(In reply to Sergey from comment #4)
> why not to add 'none' as an option?

To the port options? WebRTC is broken when no audio_device backends are enabled and OSS patch lacks one.
Comment 6 Sergey 2017-03-09 09:05:24 UTC
Yes to port options. Those who don't use WebRTC would use 'none' as sound driver backend + it should also switch off WebRTC support from Firefox, it will not bring in any dependencies, as it is now.
Comment 7 Sergey 2017-03-09 09:06:46 UTC
I'd rename 'none' -> 'OSS'