Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 17 Nov 2018, 22:12
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Firefox Sound Fix - Modify Default Preferences
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [3 Posts]  
Author Message

Joined: 05 Feb 2012
Posts: 1824
Location: London, England

PostPosted: Sun 06 May 2018, 17:20    Post subject:  Firefox Sound Fix - Modify Default Preferences
Subject description: No user.js file needed in the profile

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:-
// 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/");

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.

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:-
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

Oscar in England

Last edited by OscarTalks on Wed 23 May 2018, 07:04; edited 2 times in total
Back to top
View user's profile Send private message 

Joined: 11 Oct 2009
Posts: 11272
Location: Charleston S.C. USA

PostPosted: Sun 06 May 2018, 21:11    Post subject:  

Thanks for this!!!!
I have found, in trying to help people, that 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 Shocked
Back to top
View user's profile Send private message 

Joined: 16 Jul 2013
Posts: 930
Location: Mid-mitten

PostPosted: Sun 06 May 2018, 21:33    Post subject:  

Yes - thanks for this straightforward write-up, OscarTalks! Very useful (bookmarked). Cool 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.

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [3 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum

Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0507s ][ Queries: 12 (0.0161s) ][ GZIP on ]