No sound playback with Pale Moon on Gentoo

Users and developers helping users with generic and technical Pale Moon issues on all operating systems.

Moderator: trava90

Forum rules
This board is for technical/general usage questions and troubleshooting for the Pale Moon browser only.
Technical issues and questions not related to the Pale Moon browser should be posted in other boards!
Please keep off-topic and general discussion out of this board, thank you!
segmentation-fault

No sound playback with Pale Moon on Gentoo

Unread post by segmentation-fault » 2019-03-01, 19:41

I am writing this from a running, fully to my satisfaction working Palemoon 28.4.0 on Gentoo Linux. My message is: it works - and better than you would think! :)

Here is what I did - I practically added the palemoon repository to layman, updated the eix cache and merged with the ebuild):

Code: Select all

layman -a palemoon
eix-update
emerge -av www-client/palemoon
I had ONE problem though that took me a few days to sort out: no sound! After days of searching and reading, I came to the conclusion that, for Palemoon 28 and above, Pulseaudio is a must. I have not managed to get sound without Pulseaudio on Palemoon 28.4.0 (FWIW: the ebuild compiles the code for 'UXP', the Universal XUL Platform). On the contrary, as soon as I configured Pulseaudio, all was good! I have decided to configure PA as a "minimal unintrusive dumb pipe to ALSA", as described in:

https://wiki.archlinux.org/index.php/Pu ... pe_to_ALSA

The whole story, with complete configuration for ALSA on an ASUS ROG G752 laptop, can be read at the Gentoo Forum at How to configure ALSA on ASUS ROG G752.

Some remarks:
  • To convince the ebuild to use the gtk3 USE flag, in place of the default gtk2, I had to delete (or rename) the /var/lib/layman/palemoon/profiles/package.use.mask.orig that kept masking gtk3.
  • To use my beloved extensions, I had to copy their .xpi files from the extensions directory of my Windows profile (they work there fine with an already installed/updated Palemoon 28.4.0 since ages) to the extensions directory of my Linux profile - I had to read the FAQ to find out where this is, but at the end all went well. For whatever reason the Add-ons Manager offers me only a small portion of what would, or could, theoretically work...
Last edited by Moonchild on 2019-03-08, 06:47, edited 2 times in total.
Reason: Better topic title

segmentation-fault

Re: Palemoon on Gentoo

Unread post by segmentation-fault » 2019-03-01, 20:18

I got, however, this "QA Notice" too, at the end of the compilation - maybe the developers would want to have a look:

Code: Select all

 * QA Notice: Package triggers severe warnings which indicate that it
 *            may exhibit random runtime failures.
11:26.66 /zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/toolkit/xre/nsAppRunner.cpp:3708:37: warning: comparison with string literal results in unspecified behavior [-Waddress]
11:26.67 /zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/toolkit/xre/nsAppRunner.cpp:3709:42: warning: comparison with string literal results in unspecified behavior [-Waddress]
17:35.19 /zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/layout/style/nsCSSProps.h:481:46: warning: array subscript is above array bounds [-Warray-bounds]
Here are the relevant portions of the build.log file:

Code: Select all

...
  
libnetwerk_cache.a.desc
/zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/toolkit/xre/nsAppRunner.cpp: In member function 'nsresult XREMain::XRE_mainRun()':
Warning: -Waddress in /zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/toolkit/xre/nsAppRunner.cpp: comparison with string literal results in unspecified behavior
/zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/toolkit/xre/nsAppRunner.cpp:3708:37: warning: comparison with string literal results in unspecified behavior [-Waddress]
           aKey = (((MOZ_APP_NAME == "basilisk")
                                     ^~~~~~~~~~
Warning: -Waddress in /zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/toolkit/xre/nsAppRunner.cpp: comparison with string literal results in unspecified behavior
/zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/toolkit/xre/nsAppRunner.cpp:3709:42: warning: comparison with string literal results in unspecified behavior [-Waddress]
                      || (MOZ_APP_NAME == "palemoon"))
                                          ^~~~~~~~~~

...

libintl_chardet.a.desc
In file included from /zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/layout/inspector/inCSSValueSearch.h:15:0,
                 from /zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/layout/inspector/inCSSValueSearch.cpp:5,
                 from /zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/o/layout/inspector/Unified_cpp_layout_inspector0.cpp:2:
/zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/layout/style/nsCSSProps.h: In member function 'virtual nsresult inDOMUtils::GetCSSPropertyNames(uint32_t, uint32_t*, char16_t***)':
Warning: -Warray-bounds in /zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/layout/style/nsCSSProps.h: array subscript is above array bounds 
/zram/portage/www-client/palemoon-28.4.0/work/palemoon-28.4.0/layout/style/nsCSSProps.h:481:46: warning: array subscript is above array bounds [-Warray-bounds]
     return (nsCSSProps::kFlagsTable[aProperty] & aFlags) == aFlags;
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^

...

Walter Dnes
Astronaut
Astronaut
Posts: 650
Joined: 2015-07-30, 20:29
Location: Vaughan, ON, Canada

Re: Palemoon on Gentoo

Unread post by Walter Dnes » 2019-03-01, 21:47

segmentation-fault wrote:I had ONE problem though that took me a few days to sort out: no sound! After days of searching and reading, I came to the conclusion that, for Palemoon 28 and above, Pulseaudio is a must. I have not managed to get sound without Pulseaudio on Palemoon 28.4.0 (FWIW: the ebuild compiles the code for 'UXP', the Universal XUL Platform). On the contrary, as soon as I configured Pulseaudio, all was good!
That's strange. I don't have pulseaudio on my regular Gentoo desktop, and it works fine. Do you perchance have the "pulseaudio" flag enabled? What's the output of emerge -pv palemoon
There's a right way
There's a wrong way
And then there's my way

segmentation-fault

Re: Palemoon on Gentoo

Unread post by segmentation-fault » 2019-03-01, 21:55

And yet another remark (I forgot):

It seems that 9 GB are not enough for building Palemoon 28.4.0. The ebuild does a so-called pre-merge check to see if there are 9 GB free on PORTAGE_TMPDIR - I had 10 GB free and still there was a debug .so library that could not be copied during the install phase due to a 'no space left on device' error (the device in this case being a zram-compressed RAM disk that holds PORTAGE_TMPDIR). It was only one file and its absence did not seem to have any adverse effects. Still, it might be a good idea to tweak the pre-merge check to a more realistic value, one that can accommodate all files.

With 16 GB free all is good again - but this may be overkill. :eh:

segmentation-fault

Re: Palemoon on Gentoo

Unread post by segmentation-fault » 2019-03-01, 22:05

Walter Dnes wrote:Do you perchance have the "pulseaudio" flag enabled?
Of course I do! :D

The way I have always understood this flag by reading its description, namely

Code: Select all

pulseaudio         : Add support for PulseAudio sound server
is that by enabling it I will be able to use Pulseaudio if I choose to do so, at my discretion. That is, by enabling it, I add support for Pulseaudio - I do not enforce the use of it...
Walter Dnes wrote:What's the output of emerge -pv palemoon

Code: Select all

emerge -pv palemoon

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild   R   ~] www-client/palemoon-28.4.0::palemoon  USE="dbus devtools gtk3 jemalloc official-branding optimize pulseaudio threads -debug -gnome -gtk2 -necko-wifi -valgrind" CPU_FLAGS_X86="sse sse2" 0 KiB

segmentation-fault

Re: Palemoon on Gentoo

Unread post by segmentation-fault » 2019-03-01, 22:27

Another remark I forgot to post:

To protect from CVE-2017-5715 aka Spectre Variant 2, branch target injection vulnerability, I compile software that deals with the internet, like packages of the www-client category, or may hold passwords, like packages from the app-crypt category, with

Code: Select all

# Add 'retpoline' ("return trampoline") to indirect branches.
# This mitigates the Spectre v.2 vulnerability.

# The 'thunk-extern' (GCC) or 'external-thunk' (Clang) variants 
# should be used if you want to use a custom thunk - as is the case for the kernel.
# RETPOLINE_CFLAGS_GCC='-mindirect-branch=thunk-extern -mindirect-branch-register'
# RETPOLINE_CFLAGS_CLANG='-mretpoline-external-thunk'
# 
RETPOLINE_CFLAGS_GCC='-mindirect-branch=thunk -mindirect-branch-register'
RETPOLINE_CFLAGS_CLANG='-mretpoline'

# I use gcc, not clang, so...
RETPOLINE_CFLAGS="$RETPOLINE_CFLAGS_GCC"

CFLAGS="${CFLAGS} $RETPOLINE_CFLAGS"
CXXFLAGS="${CXXFLAGS} $RETPOLINE_CFLAGS"
in a file named /etc/portage/env/retpoline.conf, which is then used in another file, named /etc/portage/package.env/retpoline, as follows:

Code: Select all

www-client/firefox		retpoline.conf
www-client/httrack		retpoline.conf
www-client/lynx			retpoline.conf
www-client/palemoon		retpoline.conf
www-client/seamonkey	retpoline.conf
My problem is: either the ebuild itself, or the original build scripts, suppress the exact 'gcc ...' commands used to compile each file, with all their C flags, library flags, link flags, includes, etc. - so that, at the end, I am not at all sure whether those (retpoline) C flags are indeed used, or suppressed somewhere...

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35473
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Palemoon on Gentoo

Unread post by Moonchild » 2019-03-01, 23:46

Just so we're all clear on this: if you build Pale Moon from source yourself and run into issues with it, there is very little in terms of official support given by the dev team. It's simply impossible for us to support wildly varying environments and build configurations in LFS setups like Gentoo. At best, you can get some assistance from the people providing the packages for you.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

segmentation-fault

Re: Palemoon on Gentoo

Unread post by segmentation-fault » 2019-03-02, 02:33

Moonchild,

you have been totally clear, on many occasions. I did not write all this in expectation of anything - I just wanted to have it somewhere so that it might help somebody. It is clear that I have mixed quite a lot of things into one thread - but I did not want to blow it up, exactly because I did not expect any answers.

OTOH if I were you, I would be interested to see what kind of 'undefined behaviour' or 'array out of bounds' error is lurking at the precise positions I indicated.

You might also shed some authoritative light in my ALSA/Pulseaudio issue by simply answering with a "Yes/No" the question: is Pulseaudio required in order to have sound for Palemoon 28.4.0 (the code under 'UXP' in the git repository)? The only statement I found from you on this subject was dated back in 2017 and it was
Moonchild wrote:not using PulseAudio may not be an option any longer if we move Pale Moon to UXP
(from: viewtopic.php?t=15150)

and UXP is exactly what is fetched and compiled in the 28.4.0 package (ebuild) I use for Gentoo.

You are right in that the rest is mostly packaging issues like "what does the pulseaudio USE flag do exactly?", or "do I get my specific CFLAGS passed to the build scripts?", or "does the ebuild check for enough free space?" - things that we will sort out eventually without using developer time.

As I said at the start, Palemoon on Gentoo works to my full satisfaction, so all the above (possibly with the exception of the "QA Notices") are not to be considered as 'bugs'. So all is good. :-)

...oops - did I say Thank You? Thank You for a sane product!

tooshorttoolong
Fanatic
Fanatic
Posts: 137
Joined: 2017-09-11, 14:28

Re: Palemoon on Gentoo

Unread post by tooshorttoolong » 2019-03-02, 08:48

Congrats for installing Gentoo, and Pale Moon.

You might have missed Walter Dnes’ message. Pulseaudio is not required to have sound.

I’ve been using Gentoo and Pale Moon for a few years. At first I built it myself but then I had some issue (I forgot which) and switched to using the official build which solved it. Nowadays I don’t even have to bother installing from the tgz archive since PM auto-updates itself (I still download the archives to have a backup just in case the new version doesn’t work).

PS: thanks a lot for the link to the Arch wiki, I might have a use for it! (Unfortunately some game developers who are clueless about the Linux ecosystem make pulseaudio a requirement.)
Last edited by tooshorttoolong on 2019-03-02, 11:28, edited 1 time in total.

User avatar
Moonchild
Pale Moon guru
Pale Moon guru
Posts: 35473
Joined: 2011-08-28, 17:27
Location: Motala, SE
Contact:

Re: Palemoon on Gentoo

Unread post by Moonchild » 2019-03-02, 11:10

My post was primarily directed towards others who may be reading this and using it as a guide.
"Sometimes, the best way to get what you want is to be a good person." -- Louis Rossmann
"Seek wisdom, not knowledge. Knowledge is of the past; wisdom is of the future." -- Native American proverb
"Linux makes everything difficult." -- Lyceus Anubite

segmentation-fault

Re: Palemoon on Gentoo

Unread post by segmentation-fault » 2019-03-02, 13:31

tooshorttoolong wrote:Congrats for installing Gentoo, and Pale Moon.

You might have missed Walter Dnes’ message. Pulseaudio is not required to have sound.
Thank you. :-)

No, I didn't miss Walter Dnes’ message - maybe you missed my answer to it, in the deluge of my messages. ;)
tooshorttoolong wrote: Pulseaudio is not required to have sound.
This is too broad a statement. I have read it at various places, but you have to take the context into account:

Yes, I believe that Palemoon 27 and older did not rely on Pulseaudio. But is this still true for Palemoon 28.4.0? Is it true for UXP? What happens if I enable the pulseaudio USE flag in the Gentoo package? Does it just enable support for Pulseaudio, or does it enforce the use of it?

All this is not at all clear to me - not yet.

yami_

Re: Palemoon on Gentoo

Unread post by yami_ » 2019-03-02, 14:11

segmentation-fault wrote:But is this still true for Palemoon 28.4.0? Is it true for UXP?
I have just tried it and ALSA support is still working in Pale Moon 28.4.0 (official build).

vannilla
Moon Magic practitioner
Moon Magic practitioner
Posts: 2183
Joined: 2018-05-05, 13:29

Re: Palemoon on Gentoo

Unread post by vannilla » 2019-03-02, 14:15

I'm using deu's ebuild too, and have pulseaudio support disabled (i.e. the USE flags contain "-pulseaudio".)
Without pulseaudio, Pale Moon is able to play sound just fine.
I had to install pulseaudio nonetheless for unrelated reasons, but the browser still has pulseaudio support disabled.
Sound is played through pulseaudio because that program is using a layer that intercepts pure ALSA calls and plays them through itself, so everything works even though Pale Moon itself doesn't use pulseaudio.

tooshorttoolong
Fanatic
Fanatic
Posts: 137
Joined: 2017-09-11, 14:28

Re: Palemoon on Gentoo

Unread post by tooshorttoolong » 2019-03-02, 14:24

I wonder if four people answering his question will be enough or if he’ll still ignore all these answers… sigh :(

New Tobin Paradigm

Re: Palemoon on Gentoo

Unread post by New Tobin Paradigm » 2019-03-02, 15:45

Nah, we need more people to say the exact same thing for at least two more pages then the topic can get locked.

Then there may be a new thread about this one getting locked then that one is locked. Afterword, 2 months down the road the dups start resulting in links to this thread followed by a "use search" statement with degrees of annoyance attached.

It is just standard forum practice don't you know? The remaining variables that are unclear as of yet is if there is gonna be an argument for or against something and if there is going to be a ragequit or banning. These are always fun wildcards in any discussion.

I know how to internet forum! Do you?

segmentation-fault

Re: Palemoon on Gentoo

Unread post by segmentation-fault » 2019-03-02, 18:29

tooshorttoolong wrote:I wonder if four people answering his question will be enough or if he’ll still ignore all these answers… sigh :(
O.K., let's start from another point:

What does

Add support for PulseAudio sound server

mean to you? This is the description of the pulseaudio USE flag that I have enabled in the build. To me, the word support has always meant what it says: support Pulseaudio, not enforce Pulseaudio. Support means to me: if I decide to start pulseaudio, then PM can use it. But if I don't start it, PM will still work fine, using ALSA. It does not mean: now that you enabled the pulseaudio flag, you MUST use Pulseaudio!

The way everybody seems to be answering my question is:

PM 28.4.0 works with ALSA only, without Pulseaudio - but only if you "disable support for Pulseaudio".
Adding support for Pulseaudio to PM, automatically disables the "ALSA only" mode of operation and requires you to start pulseaudio.


This is not the same as

PM 28.4.0 works with ALSA only, without Pulseaudio.

that some of you are trying to make me believe.

tooshorttoolong, you must understand that the same software can behave this or the other way, depending on what was passed as flags/options etc. during compilation. I have enabled the pulseaudio USE flag in good faith - I trusted its description. It's not me who is at fault here.

I come to the conclusion that either
  • the ebuild is using the wrong USE flag (it should use a different flag, maybe one called enforce_pulseaudio), or
  • the description of the pulseaudio flag is misleading and should be changed from 'add support for...' to 'enforce use of...'. I doubt that this is the case, though, as this would mean we have to change the semantics of the word support everywhere, in all Gentoo USE flags - and I have never encountered such a usage elsewhere.

segmentation-fault

Re: Palemoon on Gentoo

Unread post by segmentation-fault » 2019-03-02, 18:39

New Tobin Paradigm,

I really fail to understand your post. What's the problem? My questions, problems and solutions are very precisely stated - either you have a precise answer, or please refrain from comments like this, they don't exactly flatter you.
New Tobin Paradigm wrote: I know how to internet forum! Do you?
I have operated a forum with millions of pageviews per month 15 years ago - where were you back then? In primary school, maybe? Don't come to me this way! :evil:

yami_

Re: Palemoon on Gentoo

Unread post by yami_ » 2019-03-02, 18:58

Unless PulseAudio is explicitly disabled using ac_add_options --disable-pulseaudio any UXP application will support both ALSA and PulseAudio. This is how the official binaries are created.

segmentation-fault

Re: Palemoon on Gentoo

Unread post by segmentation-fault » 2019-03-02, 19:40

yami_ wrote: Unless PulseAudio is explicitly disabled using ac_add_options --disable-pulseaudio any UXP application will support both ALSA and PulseAudio. This is how the official binaries are created.
Now, this is what I call a precise answer! Thank you yami!

But this also means (if it is correct - and I currently have no reason to believe otherwise) that I must have been doing something wrong in my ALSA configuration, because - no matter what I did - I did not manage to get sound in youtube videos (didn't try other source of sound output in browser) unless I started pulseaudio (with the 'unintrusive pipe' configuration shown above).

Looking at the ebuild, I see this:

Code: Select all

    if ! use pulseaudio; then
        mozconfig_disable pulseaudio
    fi
This means:

IF the pulseaudio USE flag is NOT set, then:

Code: Select all

mozconfig_disable pulseaudio
So, it seems, disable_pulseaudio is passed as an option only if the pulseaudio USE flag is not set - I have it set, and I have no reason to assume that disable_pulseaudio is passed due to some other, unknown reason, so it seems safe to assume that disable_pulseaudio is NOT passed to the build scripts, therefore...

...therefore, if yami is right, I must be doing something wrong with ALSA.

If anybody has an idea what this might be, please post it, I am very curious now. My ALSA configuration (asound.conf etc. files) are posted on the Gentoo Forums link in my first post in this thread.

yami_

Re: Palemoon on Gentoo

Unread post by yami_ » 2019-03-02, 20:04

You can check if Pale Moon is detecting ALSA using the Audio Backend line about:support. My knowledge of ALSA and cubeb is limited, so I probably will not be able to provide much help here.

Locked