Timescale
Posts: 24
Joined: Wed Jun 26, 2019 5:09 pm

Webaudio on Firefox-esr broken

Thu Sep 05, 2019 2:07 pm

I know audio problems with Firefox on Rapbian are not a novel thing, but I tried all the suggestion on other threads and these do not seem to work. So here is what I am experiencing. With the current project, I'm stuck with Firefox because it turned out to be the most stable and best rendering browser for this particular instance.(Also I do not like Chrom(e)(ium))

I'm running the latest Raspbian on a pi4 4gb model. As stated, I want to use Firefox-esr for a variety of reasons.

Adding simple html5 audio to the project worked fine on the macbook with firefox quantum. Triggering the play() function started the sound immediately.

On Raspbian however, the sound is mostly not there or just intermittently and partially. You can click the play button on a audio control bar randomly and sometimes you hear a bit of the sample.I have tried OGG, MP3 and WAV and all behave the same way. Firefox just won't predictably start playing. The control bar starts playing immediately and the audio icon appears immediately as well, so Firefox thinks it is playing the sample, it just isn't audible most of the time and when it is, it is only the last part of the sample.

On that blasted Chromium that works fine as expected. So the audioStack of Raspbian is seeminly fine, Firefox IS able to output audio to the mixer, but it just lags or does something that mutes it most of the time. I've messed about in about:config, but nothing really changes this odd behaviour.

The same also happens on the W3C example page for web audio.

Any ideas? I can't find anything on the web that worked so far.

fruitoftheloom
Posts: 21108
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Webaudio on Firefox-esr broken

Thu Sep 05, 2019 2:24 pm

Timescale wrote:
Thu Sep 05, 2019 2:07 pm
I know audio problems with Firefox on Rapbian are not a novel thing, but I tried all the suggestion on other threads and these do not seem to work. So here is what I am experiencing. With the current project, I'm stuck with Firefox because it turned out to be the most stable and best rendering browser for this particular instance.(Also I do not like Chrom(e)(ium))

I'm running the latest Raspbian on a pi4 4gb model. As stated, I want to use Firefox-esr for a variety of reasons.

Adding simple html5 audio to the project worked fine on the macbook with firefox quantum. Triggering the play() function started the sound immediately.

On Raspbian however, the sound is mostly not there or just intermittently and partially. You can click the play button on a audio control bar randomly and sometimes you hear a bit of the sample.I have tried OGG, MP3 and WAV and all behave the same way. Firefox just won't predictably start playing. The control bar starts playing immediately and the audio icon appears immediately as well, so Firefox thinks it is playing the sample, it just isn't audible most of the time and when it is, it is only the last part of the sample.

On that blasted Chromium that works fine as expected. So the audioStack of Raspbian is seeminly fine, Firefox IS able to output audio to the mixer, but it just lags or does something that mutes it most of the time. I've messed about in about:config, but nothing really changes this odd behaviour.

The same also happens on the W3C example page for web audio.

Any ideas? I can't find anything on the web that worked so far.

chromium-browser included in Raspbian is tweaked by RPF / RPT to "function" on all models.

Firefox-ESR is just a one size fits all Debian ARMHF version.

Therefore "someone" would need to compile Firefox specifically for the Raspberry Pi hardware, a good learning excercise !

I believe that someone got Firefox non ESR Desktop to run OK, so it may be worth searching previous posts.
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

Timescale
Posts: 24
Joined: Wed Jun 26, 2019 5:09 pm

Re: Webaudio on Firefox-esr broken

Thu Sep 05, 2019 2:48 pm

fruitoftheloom wrote:
Thu Sep 05, 2019 2:24 pm
chromium-browser included in Raspbian is tweaked by RPF / RPT to "function" on all models.
I can confirm the same issue exists on the model 3, 3B+ with both Buster and Stretch. I believe this to be some kind of configuration issue somewhere between firefox and.. pulseaudio? perhaps?
fruitoftheloom wrote:
Thu Sep 05, 2019 2:24 pm
Therefore "someone" would need to compile Firefox specifically for the Raspberry Pi hardware, a good learning excercise !
I really doubt that a specific tweak to the firefox codebase is the answer, as abstracted as audio hard- and software interfaces are. I have set up Raspberries as airPlay stations often, which also are not "tweaked" for the hardware and these produce audio just as one would suspect. In fact, I have found the Raspberry Pi's audio stack to be one of the more reliable ones in Linux land, so this behavior by FF puzzles me.

fruitoftheloom
Posts: 21108
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Webaudio on Firefox-esr broken

Thu Sep 05, 2019 3:43 pm

Timescale wrote:
Thu Sep 05, 2019 2:48 pm
fruitoftheloom wrote:
Thu Sep 05, 2019 2:24 pm
chromium-browser included in Raspbian is tweaked by RPF / RPT to "function" on all models.
I can confirm the same issue exists on the model 3, 3B+ with both Buster and Stretch. I believe this to be some kind of configuration issue somewhere between firefox and.. pulseaudio? perhaps?
fruitoftheloom wrote:
Thu Sep 05, 2019 2:24 pm
Therefore "someone" would need to compile Firefox specifically for the Raspberry Pi hardware, a good learning excercise !
I really doubt that a specific tweak to the firefox codebase is the answer, as abstracted as audio hard- and software interfaces are. I have set up Raspberries as airPlay stations often, which also are not "tweaked" for the hardware and these produce audio just as one would suspect. In fact, I have found the Raspberry Pi's audio stack to be one of the more reliable ones in Linux land, so this behavior by FF puzzles me.

AFAIAA Arch Linux Arm includes Firefox Browser so that may be an alternative !
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

Timescale
Posts: 24
Joined: Wed Jun 26, 2019 5:09 pm

Re: Webaudio on Firefox-esr broken

Thu Sep 05, 2019 4:10 pm

fruitoftheloom wrote:
Thu Sep 05, 2019 3:43 pm

AFAIAA Arch Linux Arm includes Firefox Browser so that may be an alternative !
I'm planning on trying other distro's on Pi soon, but for a running project, I'd rather stick to the main supported OS. That, and I'm very much at home in Debian'esque environments.

Point is that alternative distro's will undoubtedly introduce a how new set of unforeseen problems which could be far more critical than this audio problem.

I just find it odd that in 2019, a common browser on a popular platform is seemingly unable to provide simply audio. This has been done properly for decades on various platforms? It is not like I'm asking ridiculous hardware accelerated performance for decoding H265 or WebGL. It is simple (uncompressed even) audio! I'll even grant the audio stack a third of a second to catch on if needs be, as long as it is predictable.

I mean, Triggering a VOC file on a 286 with an old soundblaster using some type of GW basic was instant in the early 90's. Surely FF can properly pre load a short wav file and output it directly to the mixer on a 2019 quad core system?

So I'm not really looking for alternatives, I'm looking for a workable solution in this specific situation. Why is FF-esr on Raspbian not properly outputting web-audio and what can be done about that?

fruitoftheloom
Posts: 21108
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: Webaudio on Firefox-esr broken

Sat Sep 07, 2019 7:03 am

Timescale wrote:
Fri Sep 06, 2019 11:27 pm
Well, unfortunately this forum seems completely pointless and useless for troubleshooting anything above potentially broken SD cards or under-powered wall-warts.

Thanks for all the suggestions to use other stuff.. Perhaps I'll use a mac-mini with safari instead of a RPi with FF.. good call... really! Great stuff.

Would trying the Firefox fora be a naive move and proof that I'm just a glutton for disappointment? Who knows..

See you never RPi forum.. Have a good Brexit I guess.

This forum hosting is paid for kindly by RPF / RPT.

The participation is entirely Voluntary from the Posters, Responders and Moderators.

Therefore no one gets paid and like everything posted on the World Wide Web it should not be accepted as being accurate or truthful, scepticism is a useful tool.

FREE advice is worthless as there is no one to claim redress if that advice is wrong, misleading or unhelpful.

YMMV
Retired disgracefully.....
This at present is my daily "computer" https://www.asus.com/us/Chrome-Devices/Chromebit-CS10/

Return to “Troubleshooting”