Closed
Bug 1229286
Opened 9 years ago
Closed 9 years ago
AAC and Vorbis audio playback fails with small ALSA buffer sizes
Categories
(Core :: Audio/Video: cubeb, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: astralstorm, Unassigned)
Details
It seems that Vorbis and AAC, but not Opus audio playback fails (looks stopped) on ALSA output when buffer size is too small. Pulseaudio is not affected, probably because it allocates the buffer you ask for.
Here's my ALSA config that fails. Changing buffer_size to 2048 in the frontend loopback devices makes the playback work.
Tested on Firefox 42, 43b7 and 45a1 nightly.
# /etc/asound.conf
defaults.pcm.rate_converter "speexrate_best"
# playback PCM device: using loopback subdevice 0,0
pcm.amix {
type dmix
ipc_key 219345
slave {
pcm "hw:Loopback,0,0"
period_size 256
buffer_size 1024
rate 48000
format S32_LE
channels 2
}
}
# capture PCM device: using loopback subdevice 0,1
pcm.asnoop {
type dsnoop
ipc_key 219346
slave {
pcm "hw:Loopback,0,1"
period_size 256
buffer_size 1024
rate 48000
format S32_LE
channels 2
}
}
# duplex device combining our PCM devices defined above
pcm.aduplex {
type asym
playback.pcm "amix"
capture.pcm "asnoop"
}
# ------------------------------------------------------
# for zita-a2j and zita-j2a: looped-back signal at other ends
pcm.ploop {
type dsnoop
ipc_key 219348
slave {
pcm "hw:Loopback,1,0"
period_size 256
buffer_size 1024
rate 48000
format S32_LE
channels 2
}
}
pcm.cloop {
type dmix
ipc_key 219347
slave {
pcm "hw:Loopback,1,1"
period_size 256
buffer_size 1024
rate 48000
format S32_LE
channels 2
}
}
# ------------------------------------------------------
# default device
pcm.!default {
type plug
slave.pcm "aduplex"
}
Comment 1•9 years ago
|
||
(In reply to Radosław Szkodziński from comment #0)
> It seems that Vorbis and AAC, but not Opus audio playback fails (looks
> stopped) on ALSA output when buffer size is too small. Pulseaudio is not
> affected, probably because it allocates the buffer you ask for.
Can you please post a link to the working and failing media? The sample format probably plays a role in the bug.
| Reporter | ||
Comment 2•9 years ago
|
||
This was tested with Youtube videos and Wikimedia commons.
https://www.youtube.com/watch?v=ZDrb82L_D7M - fails, WebM VP9 w/ AAC. If ffmpeg is disabled via about:config, picks WebM VP9 w/ Vorbis, also fails.
https://www.youtube.com/watch?v=sit6zUQKpJc - works, WebM VP9 w/ Opus.
https://upload.wikimedia.org/wikipedia/commons/f/f0/Amazing_Grace_%28USAFB_jazz_vocal%29.ogg - fails, Ogg Vorbis.
http://download.blender.org/peach/trailer/trailer_1080p.ogg - works, Ogg Theora w/ Vorbis. (Different encoder?)
| Reporter | ||
Comment 3•9 years ago
|
||
By "fails" above I mean that video plays, but audio does not.
In case of the <audio> file, the playback and seeking seem frozen as if buffering.
I've also tested it with downloaded audio streams from the above Youtube videos.
Comment 4•9 years ago
|
||
Looks like the bug lies within the ALSA stack:
11:25 < AstralStorm> so now I'm pretty sure it's a bug in lfloat plugin somewhere
11:36 < AstralStorm> you shouldn't use period_size + buffer_size
11:37 < AstralStorm> it's either period_size + buffer_*time* or periods + buffer_size
11:50 < AstralStorm> ALSA is broken wrt period_size/buffer_size somehow
11:50 < AstralStorm> 800 works, 1024 fails, 1280 works, 2048 works...
11:51 < AstralStorm> it seems there's some trouble in ALSA calculation of period_time :P
11:52 < AstralStorm> 5333 vs 5334 usec and it's messed up. feel free to close the bug, I'll toss it at ALSA fokls
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•