Audio can't be heard (or can't be heard in the beginning) on Linux
Categories
(Core :: Audio/Video: cubeb, defect, P2)
Tracking
()
People
(Reporter: alwu, Assigned: padenot)
References
Details
Attachments
(4 files)
Recently I encountered this issue several times, but I didn't have a complete reproduce steps for that, because it's not 100% reproducible.
But lucky I got this profiled result while debugging bug1686169.
So when I was encountering this issue on jsfiddle, I did see the sound indicator showing on the tab, but I didn't hear any sound at all. I also encountered this issue before on my test website where the sound couldn't be heard in the beginning, but after a couple of seconds audio would start being heard.
| Reporter | ||
Comment 1•5 years ago
|
||
I'm on Ubuntu 20.04, and encountered this issue on both Release 84 and latest Nightly.
| Assignee | ||
Comment 2•5 years ago
|
||
Sounds like audioipc take a while to init, and that would explain why it's a problem on windows as well, now.
| Assignee | ||
Comment 3•5 years ago
|
||
Actually no. But I think I can repro what you describe, but rarely.
| Reporter | ||
Comment 4•5 years ago
|
||
(In reply to Paul Adenot (:padenot) from comment #3)
Actually no. But I think I can repro what you describe, but rarely.
Yes that happens sometime, but not really frequently.
| Assignee | ||
Updated•5 years ago
|
I have the same issue. I found out about it trying to load and audio file using Audio('myfile.mp3') and then trying to playback using .play(). Nothing was is heard in firefox, but it can be heard in Chrome. The file is 0.03 seconds long (it's a brick-drop effect sound).
In the beginning I though that firefox would not play mp3 files, but then I found some stackoverflow examples where it worked, so it had to be something else.
| Assignee | ||
Comment 6•4 years ago
|
||
Can you give us a small test case so that we can try to reproduce the issue ?
I made a jsfiddle. Try it Firefox and Chrome
https://jsfiddle.net/91fjm3g6/
The short button will work in Chrome but not in Firefox. The long melody works as expected in both.
When playing the short hit sound Firefox shows in the tab that it is playing something, but nothing is heard. Also it doesn't display any sort of error.
| Reporter | ||
Comment 9•4 years ago
•
|
||
I can reproduce this on this modified example as well. I will take a look on this later.
| Reporter | ||
Updated•4 years ago
|
| Reporter | ||
Comment 10•4 years ago
|
||
So this part of log is the same on both Windows and Linux, but I can listen to the short sound on Windows.
[Child 2162617: MediaDecoderStateMachine #1]: D/AudioStream 7fa4f3fd73a0 started, state STARTED
[Child 2162617: AudioIPC0]: V/MediaDecoder AudioSink=7fa4f789d800 playing audio at time=48000 offset=0 length=2304
[Child 2162617: MediaDecoderStateMachine #1]: V/MediaDecoder AudioSink=7fa4f789d800 AudioStream has used an audio packet.
[Child 2162617: AudioIPC0]: V/MediaDecoder AudioSink=7fa4f789d800 playing audio at time=48000 offset=0 length=767
[Child 2162617: MediaDecoderStateMachine #1]: V/MediaDecoder AudioSink=7fa4f789d800 AudioStream has used an audio packet.
[Child 2162617: AudioIPC0]: D/AudioStream 7fa4f3fd73a0 StateCallback, mState=1 cubeb_state=2
[Child 2162617: AudioIPC0]: D/AudioStream 7fa4f3fd73a0 Drained
[Child 2162617: MediaDecoderStateMachine #1]: D/MediaDecoder MediaDecoderStateMachine[7fa4f3f74000] Decoder=7fa4f3f0f400 [OnMediaSinkAudioComplete]
[Child 2162617: MediaDecoderStateMachine #1]: D/MediaDecoder MediaDecoderStateMachine[7fa4f3f74000] Decoder=7fa4f3f0f400 StopPlayback()
We did send two audio samples to the audio backend, but didn't hear anything. I suspect that might be related with cubeb, paul, do you have time to check this issue?
Thank you.
| Assignee | ||
Comment 11•4 years ago
|
||
Indeed, this is fixed by https://github.com/mozilla/cubeb-pulse-rs/pull/69. Stealing the bug because I wrote a patch.
| Assignee | ||
Comment 12•4 years ago
|
||
| Assignee | ||
Comment 13•4 years ago
|
||
Depends on D119954
Comment 14•4 years ago
|
||
Comment 15•4 years ago
|
||
Comment 16•4 years ago
|
||
Backed out for causing failures on cubeb.drain, cubeb.tone.
Backout link
Push with failures
Failure Log for cubeb.drain
Failure Log for cubeb.tone
Comment 17•4 years ago
|
||
Comment 18•4 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/fa8fd2516b14
https://hg.mozilla.org/mozilla-central/rev/ee41f75ed409
| Assignee | ||
Updated•4 years ago
|
Updated•4 years ago
|
Comment 19•4 years ago
|
||
I was able to reproduce the issue on Ubuntu 20.4 using 87.0a1(20210131211743) and link https://jsfiddle.net/97c3g2js/ . Verified as fixed on Ubuntu 20.4, Win 10 and Mac 10.13 using 95.0 (20211129150630).
Updated•4 years ago
|
Description
•