osowiecki
Posts: 11
Joined: Tue Jan 19, 2016 6:45 pm

Firefox-ESR youtube sound problem

Wed Jun 15, 2016 5:19 pm

I've upgraded my Raspberry Pi 2 yesterday. Since they've upgraded Iceweasel to Firefox-ESR youtube videos works as fast as never before, BUT the sound is broken on some videos (especially live streams). They have high background white noise and sounds like the audio is slowed down (the video stream istelf is fine). Does anyone know how to fix this? Upgrading to latest stable firefox brings youtube back to the crawl. The PI is overclocked to 1000 MHz and has 128 MB of video RAM set up. Thanks.

Edit : downclocked to 1000 MHz because that caused embedded webm videos with sound to crash firefox when I tried to change the sound volume (strange). The Sound problem described above is still there, regardless of the CPU speed.

sedeki
Posts: 2
Joined: Tue May 26, 2015 11:53 am
Location: Czechia

Re: Firefox-ESR youtube sound problem

Fri Jun 17, 2016 8:56 am

I have to confirm this problem. I cant find solution for months (using FF 4x from packages.ubuntu.com before this Raspbian update). With any 3x version there is no problem. I cannot find a pattern which video on Youtube will work and which not (same size, bitrate and internal video/audio format). Playing with MSE and related in about:config has also no effect...

gkreidl
Posts: 5893
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Firefox-ESR youtube sound problem

Fri Jun 17, 2016 11:00 am

Forget Firefox for playing web video. It simply doesn't work. Use chromium-browser, kweb or even Midori. They all can play 360 youtube video in perfect quality on a RPi 3.
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

osowiecki
Posts: 11
Joined: Tue Jan 19, 2016 6:45 pm

Re: Firefox-ESR youtube sound problem

Fri Jun 24, 2016 2:34 am

gkreidl wrote:Forget Firefox for playing web video. It simply doesn't work. Use chromium-browser, kweb or even Midori. They all can play 360 youtube video in perfect quality on a RPi 3.
Tested Chromium and it turns out it uses a large part my SWAP. Firefox doesn't do that. Fortunately latest version of youtube-dl seems to stream live Youtube videos fine.

gkreidl
Posts: 5893
Joined: Thu Jan 26, 2012 1:07 pm
Location: Germany

Re: Firefox-ESR youtube sound problem

Fri Jun 24, 2016 7:29 am

osowiecki wrote: Tested Chromium and it turns out it uses a large part my SWAP. Firefox doesn't do that. Fortunately latest version of youtube-dl seems to stream live Youtube videos fine.
All modern browsers are memory hogs. If you think you can use such browsers on the RPi with just 1 GB (- GPU memory) in the same way as on a Desktop PC, opening a large number of web pages at the same time in different tabs or windows, you are simply wrong. This can never work with limited memory.

I've run a memory test, opening 5 websites at the same time in different browsers.
Firefox 330-350 MB
chromium-browser 440 MB
kweb/kweb3 370 MB using 4 Cores, 330 MB using 1 core
epiphany 330 MB (only 1 core possible)

chromium does need more memory than the other browsers, but it is the fastest one in many ways (except for Javascript benchmarks, which ran faster in Firefox).
In kweb(3) I have enabled all options to get a fair comparison.

The websites I used for the test: https://www.youtube.com http://www.fernsehserien.de/ https://www.amazon.de/ http://egoistenblog.blogspot.de http://www.zdf.de/ (mostly German).
Minimal Kiosk Browser (kweb)
Slim, fast webkit browser with support for audio+video+playlists+youtube+pdf+download
Optional fullscreen kiosk mode and command interface for embedded applications
Includes omxplayerGUI, an X front end for omxplayer

osowiecki
Posts: 11
Joined: Tue Jan 19, 2016 6:45 pm

Re: Firefox-ESR youtube sound problem

Fri Jun 24, 2016 5:00 pm

Sure, you are right. My point is, FF doesn't touch my SWAP when playing videos when there is still lots of free memory. Chromium starts using it quickly.

Image

Anyway, omxplayergui solved my problem for now.
Thanks.

Gadgetguy
Posts: 93
Joined: Fri Aug 15, 2014 2:55 am

Re: Firefox-ESR youtube sound problem

Sun Apr 23, 2017 8:15 am

An easy fix for the sound problems( ie noise ) that occur when playing youtube
and other videos in firefox ( and within browser, rather than an external player ) is
to to enter about:config in the address bar and then type mp4 in the search field and navigate down to the preference " media.mp4.enabled " and then toggle it to the value false. After doing this mp4 video files eg h.264 aac audio will stll play fine within the browser but the audio will now play clearly as intended.
While most times I prefer to use an external video player to render video, such as omxplayergui or smplayer with harware accelerated mpv as its engine, at times I also like to have the ability to play videos within browser. Another way to play videos within browser on firefox is via the ViewTube user script:

http://isebaro.com/viewtube

. Among other useful features It enables you to chose the codec you wish to play the video with.

One thing that firefox does have going for it is configurabilty and extensibility with a bewildering number of extensions. One very neat extension that I very often use when I do use firefox is the " open with " ( currently version 6.8.1 ) extension by Geoff Lankow.
You can configure this extension so as to direct firefox through multiple right click context menus to play video links( and not just youtube) in a capable external video player of your choosing ie. the aforementioned hardware accelerated omxplayergui or smplayer.

Another neat firefox extension is Open Livestreamer by Armin. It can be configured to open video links via livestreamer and direct livestreamer to again use a capable video player. Having a hardware accelerated version of ffmpeg installed on my system that includes the player ffplay, I designate the hardware accelerated ffplay which loads very quickly with livestreamer and configure it as follows:

--player=ffplay -vcodec h264_mmal -threads 4

Another video workaround is directing the flashgot extension to use a specified video player(instead of a downloader). And you can also use one of the many user agent switcher extensions to avoid flash video by masking your browser as a mobile version and have the video site provide you with a html5 version of the video instead.

One thing that seems to have dramatically improved the web browsing experience on all of the web browsers that I use on my pi namely: Kweb, Chromium and Firefox is by using the zram " hack" described here:

https://www.youtube.com/edit?o=U&video_id=CJ4VAelq-wE

and here:

viewtopic.php?f=62&t=169608&p=1132543&h ... m#p1132543


And also by using the hosts file " trick " described here :

viewtopic.php?f=29&t=174034&p=1111559&h ... S#p1111559


While off topic but in the same vein of improving browser performance, I found Chromium's browsing experience dramatically improved for me when I disabled the Ublock Origin extension that Pixel enables by default. It can easily be re-enabled on sites where it might appear useful. It is especially easy to disable and re-enable by use of the Chromium extension- SimpleExtManager.

I hope I have not strayed too far off topic but I have found all these little " tricks" very useful, hopefully others users may as well. I certainly always find it immensely helpful when other users post their hints etc on the forum. I have found that with all these little " hacks " Firefox becomes quite a useful browser ( and I had previously almost written it off). For example unless my memory betrays me, a few days back I was surprised and gratified to look up and find I
was browsing with 5 or 6 tabs open in each of firefox and chromium. ( I know this isn't entirely wise because you risk an unresponsive freeze).If I recall correctly I think was also listening to web radio at the time and I think I may have even had synaptic open! I think I may even have paused the radio and played a video. I knows this almost strains credulity! Granted I recently uograded to a pi 3 from a pi 2 and that definitetly accounts for some of this improved performance. But without all the little tricks my Pi 2 would usually become very sluggish or even unresponsive after about 4 or 5 tabs depending on how complex the web pages.

Gadgetguy
Posts: 93
Joined: Fri Aug 15, 2014 2:55 am

Re: Firefox-ESR youtube sound problem

Sun Apr 23, 2017 6:47 pm

Just a PS to previous post concerning a fix to the sound-noise problem bedeviling Firefox: When you use about:config to set the preference media.mp4.enabled to false value both mp4 and also webm videos will still play. You will notice however that when you go to YouTube's about html page it will indicate that while mp4 will still play but the combination of mp4 + mse is now disabled.I can't see that this will cause a problem for most pi users. I can only speculate but perhaps by having this preference enabled it caused a conflict with some of the other media decoders enabled in about:config. When using the ViewTube user script with Firefox it plays mp4 format undistorted whereas when leaving the preference enabled it wouldn't. What firefox won't do at the moment is play high def video within the browser like kweb or chromium.It will struggle with 720p.

Return to “Raspbian”