Bug 215879 - www/firefox: stuttering video and sound on higher speeds
Summary: www/firefox: stuttering video and sound on higher speeds
Status: Closed FIXED
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-08 18:00 UTC by Sergey
Modified: 2017-02-13 07:59 UTC (History)
1 user (show)

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


Attachments
bsd.gecko.mk.diff (548 bytes, patch)
2017-01-13 08:27 UTC, Tobias Kortkamp
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey 2017-01-08 18:00:36 UTC
Hello.

Wnen I build firefox from ports with ffmpeg I can't play videos (HTML5, youtube) on higher speeds (1,25 ... 2) video and sound starts jitter stutter lag. So I have to use Firefox-esr which doesn't have such problems.

$ uname -r
11.0-STABLE

Regards,
Sergey.
Comment 1 Tobias Kortkamp freebsd_committer 2017-01-13 08:27:12 UTC
Created attachment 178849 [details]
bsd.gecko.mk.diff

It's good that you've opened a bug for this.

The problem appears to be independent of the audio output used.  It
happens with ALSA and SNDIO.  With PULSEAUDIO its less pronounced but
you still hear clicking sounds where there should be none.

On OpenBSD this does not happen.  One difference between the FreeBSD
port and the OpenBSD port is that OpenBSD does not use the system
libsoundtouch, but uses the bundled one instead.  It seems to be a
slightly different version than audio/soundtouch.

Removing the --with-system-soundtouch flag from bsd.gecko.mk makes it
work correctly on FreeBSD.  I've only tested www/firefox with SNDIO=on
though.
Comment 2 Sergey 2017-01-13 09:13:24 UTC
(In reply to Tobias Kortkamp from comment #1)
Hi Tobias.

Is it possible to move the patch upstream so that we could use the fixed version of Firefox?
Thanx for your great support!

Sergey P.
Comment 3 Tobias Kortkamp freebsd_committer 2017-01-13 10:31:07 UTC
(In reply to Sergey from comment #2)
We can hope that a committer agrees with me and commits the patch or a similar fix to the ports tree.

Can you confirm that it fixes the problem?
Comment 4 Sergey 2017-01-13 11:48:19 UTC
(In reply to Tobias Kortkamp from comment #3)
Hi Tobias.

Everything works like a charm! :)
Don't we have to remove the following build dependency from a Makefile also:
 soundtouch>=1.9.0:audio/soundtouch \
?
As a bonus we've got ridden of additional useless (in this case) soundtouch dependency. I've switched over to Firefox 50.1.0 with SNDIO now and use it without any problems, Thanx!

Sergey P.
Comment 5 Sergey 2017-01-13 12:16:03 UTC
(In reply to Tobias Kortkamp from comment #3)
I was a bit hurry with my conclusions. I observe a strange effects now when the same video on youtube at first starts to blink and jitter (the sound meanwhile flows normally), and after reloading the page or stopping and starting it again it goes fine. My default video quility is - 'High definition MP4'. More to say, I've tried 5-8 times and only twice got a glitch. So the problem is unstable.

Best regards,
Sergey.
Comment 6 Jan Beich freebsd_committer 2017-01-13 12:17:54 UTC
Comment on attachment 178849 [details]
bsd.gecko.mk.diff

> -.if exists(${FILESDIR}/patch-z-bug517422)
> -soundtouch_LIB_DEPENDS=	libSoundTouch.so:audio/soundtouch
> -soundtouch_MOZ_OPTIONS=	--with-system-soundtouch
> -.endif

Add "-soundtouch" to USE_MOZILLA in www/firefox/Makefile or drop "soundtouch" in _ALL_DEPENDS in Mk/bsd.gecko.mk if the issue affects all Gecko versions. However, I'd prefer if this was bisected first. Depending on the results one can fix soundtouch usage in Gecko, add a workaround to audio/soundtouch port or drop system soundtouch support completely.
Comment 7 Sergey 2017-01-13 12:40:01 UTC
(In reply to Tobias Kortkamp from comment #3)
For example this clip:
https://www.youtube.com/watch?v=eXS_OC1UQG8
after 10 mins af watching started to blink again, repeating the same videofragment over and over again...

Just another quietion,
Tobias, do i have to tune following parameters in /etc/sysctl.conf file:
hw.snd.maxautovchans=16
dev.pcm.0.play.vchans=1
dev.pcm.0.rec.vchans=1

Maybe set them to 4 or 8? Because sndiod use this option -c 0:7.
Comment 8 commit-hook freebsd_committer 2017-01-17 12:45:22 UTC
A commit references this bug:

Author: jbeich
Date: Tue Jan 17 12:44:26 UTC 2017
New revision: 431735
URL: https://svnweb.freebsd.org/changeset/ports/431735

Log:
  www/firefox: disable system soundtouch due to broken resampling

  PR:		215879
  Reported by:	Sergey <kpect@protonmail.com>
  Submitted by:	Tobias Kortkamp <t@tobik.me> (based on)
  MFH:		2017Q1

Changes:
  head/www/firefox/Makefile
  head/www/seamonkey/Makefile
Comment 9 commit-hook freebsd_committer 2017-01-17 17:45:45 UTC
A commit references this bug:

Author: jbeich
Date: Tue Jan 17 17:44:49 UTC 2017
New revision: 431766
URL: https://svnweb.freebsd.org/changeset/ports/431766

Log:
  MFH: r431735

  www/firefox: disable system soundtouch due to broken resampling

  PR:		215879
  Reported by:	Sergey <kpect@protonmail.com>
  Submitted by:	Tobias Kortkamp <t@tobik.me> (based on)
  Approved by:	ports-secteam (feld)

Changes:
_U  branches/2017Q1/
  branches/2017Q1/www/firefox/Makefile
  branches/2017Q1/www/seamonkey/Makefile