Firefox Sound Fix - Modify Default Preferences

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
User avatar
OscarTalks
Posts: 2196
Joined: Mon 06 Feb 2012, 00:58
Location: London, England

Firefox Sound Fix - Modify Default Preferences

#1 Post by OscarTalks »

EDIT-PLEASE NOTE:-
If you are going to make any changes to preferences, manually or by changing the defaults, please make sure that these changes are going to achieve what you want and not stop anything from working. Changes to Firefox Quantum around version 60.0 have made sound work without needing any changes to preferences, BUT the apulse libraries must be installed and Firefox must be able to find and use them.

_____________________________________________________________________

Official Mozilla packages of Firefox now require pulse audio which is not normally in Puppy.
A fix for this is to use apulse libraries which emulate pulse and feed the audio to Puppy's alsa sound system.

However, there is then an additional problem, because the sandbox feature in Firefox blocks the action of apulse. EDIT - See note above.

The fix for this is to change the preferences settings in Firefox. One easy option is to disable the sandbox. If you prefer not to do this there is the slightly more complicated option of using whitelist settings to allow the sound processes to be ignored by the sandbox.

It is possible to change these settings by navigating Firefox to about:config and changing them manually, but obviously it is better if these settings can be as you want them as soon as Firefox is launched.

To do this, some people use a configuration file named user.js which has to be placed inside the profile (under /root). This is not ideal because the profile is normally only created (and modified) when Firefox runs. Settings defined here appear in about:config as "user set" showing that they have been changed from the default.

A better method is to place a configuration file with your custom settings inside the Firefox system files. This way, the required settings appear in about:config as the default settings from the start and everything is contained inside the main firefox directory.

To do this:-

Download the official Firefox tarball from Mozilla and extract it.
This gives you a directory named firefox which contains everything.
Normally this is installed into either /opt or /usr/lib
Navigate into this directory.

Navigate into the sub-directory named browser
In there, right-click and create a new directory named defaults
Navigate into default, in there, right-click and create a new directory named preferences
Navigate into preferences, in there, right click and create a new blank file named firefox.js

So now you have */firefox/browser/defaults/preferences/firefox.js
(I believe other paths and file names are also accepted if anyone wishes to experiment)

In this file you write your custom settings and they will be there as defaults from first run.
BUT the lines start with "pref" and NOT "user_pref" as was the case when using a user.js file.

Example firefox.js file:-

Code: Select all

// fix firefox sound using apulse
pref("security.sandbox.content.level", 2);
pref("security.sandbox.content.write_path_whitelist", "/dev/snd/");
pref("security.sandbox.content.syscall_whitelist", "54");
pref("security.sandbox.content.read_path_whitelist", "/dev/snd/");
NOTES:-
To disable sandbox, set level to 0 and the other lines are not needed.
The number 54 is for 32bit. Try replacing this with 16 for 64bit.

ADDITIONAL NOTE:-
Regarding the 3 apulse libraries, I recommend you extract these and install them into the main firefox directory. Here they can be found by Firefox but will not conflict with any other programs. If you want to make certain that these libraries have priority, use a small wrapper script (rather than a symlink) at /usr/bin/firefox something like:-

Code: Select all

#!/bin/sh
export LD_LIBRARY_PATH=/usr/lib/firefox:$LD_LIBRARY_PATH
/usr/lib/firefox/firefox "$@"
Change the path from /usr/lib to /opt in both lines if that is where your Firefox is installed
http://smokey01.com/OscarTalks
Last edited by OscarTalks on Wed 23 May 2018, 11:04, edited 2 times in total.
Oscar in England
Image

User avatar
bigpup
Posts: 13886
Joined: Sun 11 Oct 2009, 18:15
Location: S.C. USA

#2 Post by bigpup »

Thanks for this!!!!
The things they do not tell you, are usually the clue to solving the problem.
When I was a kid I wanted to be older.... This is not what I expected :shock:
YaPI(any iso installer)

User avatar
Moat
Posts: 955
Joined: Tue 16 Jul 2013, 06:04
Location: Mid-mitten

#3 Post by Moat »

Yes - thanks for this straightforward write-up, OscarTalks! Very useful (bookmarked). 8) FF Quantum is worth the trouble, IMO - noticeably more responsive/faster than Australis versions, they've re-introduced the must-have, toolbar-button-toggled bookmarks sidebar, and the new WE addon choices are growing along nicely.

Bob

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#4 Post by belham2 »

Hi Oscar and all,

In Radky's RC3, installed latest Firefox Quantum, downloaded your i686-apulse.pet from smokey, moved its contents into /usr/lib/firefox's folder, set the "about:config" settings as below, and cannot get sound.

Anyone have any hints and/or tips to get sound going?

Thanks.
Attachments
no-sound-Firefox-Quantum-64.jpg
(92.2 KiB) Downloaded 1336 times

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#5 Post by watchdog »

Tested working with sound firefox 63.0.3 in upupcc using the wrapper built-in apulse: no mods at sandbox configuration.
Attachments
pic.png
(130.27 KiB) Downloaded 1339 times

belham2
Posts: 1715
Joined: Mon 15 Aug 2016, 22:47

#6 Post by belham2 »

watchdog wrote:Tested working with sound firefox 63.0.3 in upupcc using the wrapper built-in apulse: no mods at sandbox configuration.

Thanks, Watchdog.

Going to do another fresh frugal install, and try with Quantum 64 again.

If it doesn't work, I'll drop back to what you have (63) so as to have sound in RC3.

I wonder if Mozilla changed something from 63 to 64??

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#7 Post by Mike Walsh »

@ belham2:-

Use Fred's 'Quantum-portable'! He's recently updated and modified it to include the apulse libs and everything else included all in the single directory.....which can be run from literally anywhere, just by clicking on the 'ff' script inside.

It's a no-brainer, it really is.....and auto-updates, too.

http://murga-linux.com/puppy/viewtopic.php?t=112376

Newest version (63.0.3) down the bottom of the post, which very quickly updates to the most recent release.....though I wouldn't put it past Mozilla to have faffed around with things yet again. We have to expect some of this kinda thing in Puppy, 'cos they (like everybody else) code stuff for the majority of 'mainstream' distros.....which have all been using PulseAudio for years.

Anyway, what's the all-fired hurry to use the very newest version? It's not gonna be any more secure than 63.....Mozilla have a history of dragging their heels when it comes to implementing that kinda thing. The devs spend more of their time 'back-biting' and 'in-fighting' than they do actually getting anything serious done..! All part of the reason why Quantum took so long to appear.....the first version of Firefox that can actually compete with Chrome on equal terms at long last.

(I'm a staunch Chrome user, and have been for years. This last 12 months, it's got so I no longer care which one I fire up; whichever one the mouse reaches first..!) :lol:

Just my two-penn'orth, FWIW.


Mike. :wink:

ccaaee
Posts: 48
Joined: Sat 27 Feb 2010, 17:10

thanks a million

#8 Post by ccaaee »

I've been trying to fix this for ages.
I'm using Precise Puppy simply because all newer versions of puppy are S L O W on everything on my ACER Aspire One netbook.
Now I have sound on Firefox.
Thanks a million

C

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#9 Post by seaside »

ccaaee,

I have a low powered Asus EEE box which I've used to stream Netflix for some time using Chromium which has now stopped working.

Since I'm with you on keeping precise 5.7.1 on this machine, I thought if Firefox could be made to work instead, I'd try that.

I've tried the Firefox Quantum version and others mentioned, which included all the missing libs, and found it worked except for the sound.

I've tried changing the "security.sandbox.content.level", 0" with no result either.

I was wondering if you could relate what steps you took installing Firefox and having the sound working?

Thanks and cheers,
S

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#10 Post by fredx181 »

seaside wrote:ccaaee,

I have a low powered Asus EEE box which I've used to stream Netflix for some time using Chromium which has now stopped working.

Since I'm with you on keeping precise 5.7.1 on this machine, I thought if Firefox could be made to work instead, I'd try that.

I've tried the Firefox Quantum version and others mentioned, which included all the missing libs, and found it worked except for the sound.

I've tried changing the "security.sandbox.content.level", 0" with no result either.

I was wondering if you could relate what steps you took installing Firefox and having the sound working?

Thanks and cheers,
S
Are you running firefox with apulse ?

Code: Select all

apulse /path/to/firefox
Or use the portable all-in:
http://murga-linux.com/puppy/viewtopic.php?t=112376
Btw, AFAIK the sandbox setting is not needed anymore with the latest firefox version.

Fred

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#11 Post by seaside »

Fred,

Thanks for your ideas.

I see that the "ff" script sets the pulse lib paths for Firefox in the "all-in-one" versions which I think "Apulse" does as well.

Having tried various combinations of things (including running Apulse) and failed, I must be missing some step particular to puppy precise 5.7.1,

As "ccaaee" appears to have it working, perhaps there is some other factor, I've missed.

Thanks for all your fantastic work on Puppy,
S

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#12 Post by fredx181 »

seaside wrote:Fred,

Thanks for your ideas.

I see that the "ff" script sets the pulse lib paths for Firefox in the "all-in-one" versions which I think "Apulse" does as well.

Having tried various combinations of things (including running Apulse) and failed, I must be missing some step particular to puppy precise 5.7.1,

As "ccaaee" appears to have it working, perhaps there is some other factor, I've missed.

Thanks for all your fantastic work on Puppy,
S
Ooops... :oops: didn't test with apulse on PrecisePup earlier, but now did, and I can confirm, no sound, no idea why, hopefully anyone can shine a light on this ?

Fred

watchdog
Posts: 2021
Joined: Fri 28 Sep 2012, 18:04
Location: Italy

#13 Post by watchdog »

I did a fast test using firefox 67.0 in my frugal precise 5.7.1 standard install: sound working using apulse wrapper, libatomic-so.1.pet and /lib/libdbus-1.so.3 from wheezy (if I well remember).

Install libatomic:

http://murga-linux.com/puppy/viewtopic. ... 547#949547

Rename the /lib/libdbus-1.so.3 as /lib/libdbus-1.so.3.orig and install the following libdbus-1.so.3 in /lib :

https://drive.google.com/file/d/1KU8W3- ... sp=sharing

I use selfmade apulse but the OscarTalks' one should work:

http://smokey01.com/OscarTalks/apulse-0 ... 686-wz.pet

seaside
Posts: 934
Joined: Thu 12 Apr 2007, 00:19

#14 Post by seaside »

Fred,

You have no idea how pleased I am that you checked - I thought my brain might have been severely damaged.......

Watchdog,

Thank you for sharing that solution (which I'm sure was not easy ..)

UPDATE: Found the following solution

# Remove all pulse libs in the "extralibs" dir (leave the others)
# install instead the attached lib file to the "extralibs" dir
# sound now works (Netflix, complains about old libavcodec which can be changed by - about:config (change media.libavcodec.allow-obsolete;false to true)

Thanks for all your help and cheers,
S
Attachments
apulse-0.1.8-i686-wz.tar
apulse libs for precise
(90 KiB) Downloaded 146 times

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#15 Post by Mike Walsh »

@ seaside/all:-

Well, I guess watchdog's info is on the money, 'cos he suggested the identical libdbus (from 'Wheezy') to me some time back as a solution for getting Thunderbird 60 running in Slacko 570. Turns out that same libdbus worked wonders for getting modern Mozilla stuff running in several Pups from that era.

No idea if I'm using libatomic, TBH - I'm in Tahr 606 ATM - but Fred's 'all-in' Quantum-portable has been working fine in Precise for some time now.....same as FF60esr, and TB 60. That libdbus is multipurpose, 'cos it also lets me run norgo's newest versions of SMPlayer, too!


Mike. :wink:

User avatar
fredx181
Posts: 4448
Joined: Wed 11 Dec 2013, 12:37
Location: holland

#16 Post by fredx181 »

Thanks seaside for the report and watchdog for the solution !!

The FF-portable contained (in extralibs folder) newer pulse libraries, changed now to the exact same from OscarTalks and Quantum works for me now with sound on Precise also, nice !
Replacing the dbus lib wasn't needed for me, btw.
FF-Portable update:
http://murga-linux.com/puppy/viewtopic. ... 64#1029564

Fred

Post Reply