starting from kernel 5.10.x latency test fails systematically on multiple platforms
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 12/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Stack tecnologico
- c, linux
- Ambito
- audio-video-rtc, operating-systems
Direzione di ricerca
The reproduction runs the latency tool from test/latency.c with -C hw:1 -P hw:1 -s 10 -m 128 -M 128, and the XRUN appears only on kernels 5.10 and later. Start by reading how test/latency.c sets the buffer and period sizes and when it starts the streams, then compare the kernel ALSA/HDA changes between 5.9 and 5.10. The issue has no maintainer decision and no linked fix, so a first step is to confirm the regression on a current kernel before proposing any change.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
If I try the latency test application (test/latency.c) using a Linux Kernel 5.9.x with alsa-lib v1.2.4 on the following audio card:
PCH [HDA Intel PCH], device 1: ALC269VC Analog [ALC269VC Analog] (for example)
I get the following result:
sudo ./latency -C hw:1 -P hw:1 -f S16_LE -r 48000 -c 2 -s 10 -m 128 -M 128
Scheduler set to Round Robin with priority 99...
Playback device is hw:1
Capture device is hw:1
Parameters are 48000Hz, S16_LE, 2 channels, non-blocking mode
Poll mode: no
Loop limit is 480000 frames, minimum latency = 128, maximum latency = 128
Hardware PCM card 1 'HDA Intel PCH' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 128
period_size : 64
period_time : 1333
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 64
period_event : 0
start_threshold : 2147483647
stop_threshold : 128
silence_threshold: 0
silence_size : 0
boundary : 4611686018427387904
appl_ptr : 0
hw_ptr : 0
Hardware PCM card 1 'HDA Intel PCH' device 0 subdevice 0
Its setup is:
stream : CAPTURE
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 128
period_size : 64
period_time : 1333
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 64
period_event : 0
start_threshold : 2147483647
stop_threshold : 128
silence_threshold: 0
silence_size : 0
boundary : 4611686018427387904
appl_ptr : 0
hw_ptr : 0
Trying latency 128 frames, 2666.667us, 2.666667ms (375.0000Hz)
Success
Playback:
*** frames = 480128 ***
state : RUNNING
trigger_time: 1907393.672215
tstamp : 0.000000
delay : 80
avail : 48
avail_max : 64
Capture:
*** frames = 480000 ***
state : RUNNING
trigger_time: 1907393.672215
tstamp : 0.000000
delay : 0
avail : 0
avail_max : 16
Maximum read: 16 frames
Maximum read latency: 333.333us, 0.333333ms (3000.0000Hz)
Hardware sync
Playback time = 1907393.672215, Record time = 1907393.672215, diff = 0
The tests succeeded and final state is RUNNING
If I try the same tests on the same audio device and distribution but with a Linux Kernel >= 5.10.x it fails systematically and I get:
sudo ./lantency -C hw:1 -P hw:1 -f S16_LE -r 48000 -c 2 -s 10 -m 128 -M 128
Scheduler set to Round Robin with priority 99...
Playback device is hw:0
Capture device is hw:0
Parameters are 48000Hz, S16_LE, 2 channels, non-blocking mode
Poll mode: no
Loop limit is 480000 frames, minimum latency = 128, maximum latency = 128
Hardware PCM card 0 'HDA Intel PCH' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 128
period_size : 64
period_time : 1333
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 64
period_event : 0
start_threshold : 2147483647
stop_threshold : 128
silence_threshold: 0
silence_size : 0
boundary : 4611686018427387904
appl_ptr : 0
hw_ptr : 0
Hardware PCM card 0 'HDA Intel PCH' device 0 subdevice 0
Its setup is:
stream : CAPTURE
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 128
period_size : 64
period_time : 1333
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 64
period_event : 0
start_threshold : 2147483647
stop_threshold : 128
silence_threshold: 0
silence_size : 0
boundary : 4611686018427387904
appl_ptr : 0
hw_ptr : 0
Trying latency 128 frames, 2666.667us, 2.666667ms (375.0000Hz)
Failure
Playback:
*** frames = 90720 ***
state : XRUN
trigger_time: 967.658489
tstamp : 0.000000
delay : 0
avail : 216
avail_max : 216
Capture:
*** frames = 90592 ***
state : XRUN
trigger_time: 967.658489
tstamp : 0.000000
delay : 0
avail : 88
avail_max : 88
Maximum read: 16 frames
Maximum read latency: 333.333us, 0.333333ms (3000.0000Hz)
Hardware sync
I get an XRUN during the test execution.
I can reproduce the same error on multiple boards for multiple audio cards and on different Linux distribution just changing the Linux kernel version.
The problem was originally reported at:
AES67 Linux daemon: Latency test fails with Linux kernel starting from 5.10.0x
I am interested in testing with low latency (-m 128 -M 128).
My guess is that something changed in the Linux audio core and the latency application has to be adapted.
Any idea ?
- Lingua principale
- C
- Stelle
- 501
- Fork
- 227
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di alsa-project/alsa-lib
-
USB-Audio: ASUS ROG Zenith II S/PDIF output mapped to wrong PCM deviceForse già presa @byrcolin l’ha presa 49 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
alsa-project/alsa-lib#532 ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
alsa-project/alsa-lib#530 · 9 reazioni ·
-
kernel driver
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
alsa-project/alsa-lib#529 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 55/100
alsa-project/alsa-lib#522 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
alsa-project/alsa-lib#519 ·
Tutte le issue di alsa-project/alsa-lib
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
fastfetch-cli/fastfetch#2780 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
elliotchance/vsql#2079 ·
I maintainer di solito rispondono entro 1 giorno
-
docs
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 61/100
I maintainer di solito rispondono entro 13 giorni
-
threadpool: a failed `pthread_cond_wait` makes Mlucas hang instead of stoppingForse già presa @leinardi l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
primesearch/Mlucas#398 ·