HTML5 Player sound on raspberry pi makes hard noise

UNCONFIRMED
Unassigned

Status

()

defect
P3
normal
UNCONFIRMED
3 years ago
2 years ago

People

(Reporter: animajosser, Unassigned)

Tracking

48 Branch
ARM
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(6 attachments)

Reporter

Description

3 years ago
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux armv7l; rv:48.0) Gecko/20100101 Firefox/48.0
Build ID: 20160728203730

Steps to reproduce:

I played some video's on Youtube (just music with a picture) like (https://www.youtube.com/watch?v=iuHQiRAXVe8) on my Raspberry Pi 2b in HTML5 player in Firefox on Xubuntu 16.04. But I heard about the problem for the Raspberry Pi 3b, on Ubuntu Mate and on Raspbian too. The weird thing is, it does work with some other video's like (https://www.youtube.com/watch?v=8zRLKvfTFYM) which uses MP3 sound.
Bug 893307 may be about the same problem.
I don't know if someone wants to fix this, but I'm filing this one anyway.


Actual results:

I heard a constant hard noise and at the same time the music, but very distorted.


Expected results:

I should have heard clear sound like on a normal desktop. Ubuntu browser is able to play the sound correctly on the raspberry pi.
Reporter

Updated

3 years ago
OS: Unspecified → Linux
Hardware: Unspecified → ARM
Component: Untriaged → Audio/Video: Playback
Product: Firefox → Core
Do you have pulseaudio installed?
Reporter

Comment 2

3 years ago
Yes, I have the newest version armhf port from the Ubuntu repository installed.
Like I said: all sound works, from everything, except for some youtube videos with Firefox.
JW - do you have any clues about this one?
Flags: needinfo?(jwwang)
Can you record a video to show what is the hard noise like?
Flags: needinfo?(jwwang) → needinfo?(animajosser)
Reporter

Comment 5

3 years ago
This is the sound you need to hear, I recorded it with audacity from the software output on the raspberry pi with VLC Mediaplayer streaming it from youtube.
Reporter

Comment 6

3 years ago
This is the sound I hear, recorded with audacity from the software output, streaming it with Firefox on the Raspberry Pi.
Flags: needinfo?(animajosser)
Reporter

Comment 7

3 years ago
I totally ain't home in the source code of Firefox and don't understand why this happens only at some video's and only on raspberry pi, but maybe it's a driver/codec issue. The hardware is bcm2835 analogue output.
Reporter

Comment 8

3 years ago
I wanted to give some more information; I tested it with raspbian: iceweasel, overclocking and without overclocking, ALSA audio onboard on and off (While I don't really understand what it does), with HDMI and analogue. It all gave the same results.
Can you launch firefox from the command line with:
MOZ_DUMP_AUDIO=1 ./firefox https://www.youtube.com/watch?v=iuHQiRAXVe8

It will dump decoded audio values to files like dumped-audio-x.wav.

Please upload the files to Bugzilla. Thanks!
Flags: needinfo?(animajosser)
Reporter

Comment 10

3 years ago
Posted audio dumped wavefile
This is a dumped wavefile from firefox on the raspberry pi 2b raspbian with the command 'MOZ_DUMP_AUDIO=1 firefox https://www.youtube.com/watch?v=iuHQiRAXVe8'
Reporter

Comment 11

3 years ago
Posted audio dumped wave file
Flags: needinfo?(animajosser)
(In reply to animajosser from comment #10)
> Created attachment 8796512 [details]
> dumped wavefile
> 
> This is a dumped wavefile from firefox on the raspberry pi 2b raspbian with
> the command 'MOZ_DUMP_AUDIO=1 firefox
> https://www.youtube.com/watch?v=iuHQiRAXVe8'

The dump file sounds like garbage. I think there is something wrong to the audio decoder (is it FFmpegAudioDecoder?) which produces the garbage output.

Hi Jya,
Can you take a look? Thanks!
Flags: needinfo?(jyavenard)
don't see what I can do without access to this machine.

YouTube serves opus codec for audio by default, and as such will not use ffmpeg.
They either serve opus, aac or vorbis. I've never seen youtube serving mp3. They may but I would find this surprising if they did.

When you right click on the video, and select "stats for nerds" what does it display?

Please install the about:media plugin, have the video play in one tab, and open a new tab (in the same window, type about:media) what does it output, put it here.

https://addons.mozilla.org/en-US/firefox/addon/about-media/?src=api
Flags: needinfo?(jyavenard)
can set dom.media.mp4.enabled to false which would force vorbis/vp9 here
Reporter

Comment 15

3 years ago
Yea, I think it will be pretty difficult to fix this bug without a raspberry pi and I ain't versed in the Mozilla Firefox code and am just trying to learn C, so I can't create a workaround. I just send some info.
Reporter

Comment 16

3 years ago
Posted image stats for nerds
Reporter

Comment 17

3 years ago
Posted image about media
So it is AAC/vp9

So my recommendation to try above is valid.. that will tell us if it's a AAC problem.

How are other MP4 with aac track playing? Do they also sound bad?

What version of ffmpeg do you have installed? And how was it compiled?
Reporter

Comment 19

3 years ago
It's all standard repository of debian, I tested other videos and they were fine. But I just tested your method (but I couldn't find the dom.media.mp4.enabled; probably they renamed it to media.mp4.enabled) and it worked. The only weird thing is, why does this only happen on the pi. Maybe just force this setting to false on the pi in the next build.
Reporter

Comment 20

3 years ago
Wow, that was a bit fast, With your method it worked, so the problem is solved. It happened with multiple videos, but there were also multiple videos that did work.
I'm going to mark this as P3 because arm Linux isn't tier-1.
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.