-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Latency test fails with Linux kernel starting from 5.10.0x #79
Comments
something is weird with your execution. From the traces you enclosed you have: |
Yes I have double checked that the latest branch is used, I have simple done and runned build.sh |
Hello, i have done one more test with Raspbian 64bit, installed from new SD card. The result is the same "XRUN". Kernel: 5.15.32-v8+ #1538 SMP PREEMPT ./run_test.sh S16_LE 48000 2 1 Creating test file ... ./run_latency_test.sh S16_LE 48000 2 60 128 Compiling tools ... |
you can try to increase the latency, for example to 256 frames: |
tried up to 2048. still same result. So I'm wondering. Seen post that it's runnig on RPi4 with low latency without problems. |
I don't have this board so I cannot test directly. |
required info: cat /proc/cpuinfo processor : 0 processor : 1 processor : 2 processor : 3 Hardware : BCM2835 uname -a |
I don't see anything evident unfortunately. Everything seems ok. |
You have written that you runned the test on NanoPi NEO2. Can you share your kernel config and version which was used for test. |
I used a NanoPI NEO2. uname -a
In enclosed the kernel config I used. |
I also have this problem with regular desktop computers, I'm guessing something changed in newer kernels that affect latency. Thanks for the config, I will also try on intel and ryzen. I can't test below 128 frame. Any ideia why? If I specify e.g. 64, the test is still done for 128. Is it an Alsa thing? Thanks |
The driver works with a tick frame size set by the parameter: |
If you change "tic_frame_size_at_1fs" to 48 in test/daemon.conf you can run a test with 96 frames and this is the minimum latency I could successfully achieve on a NanoPI NEO2 board.
|
The reason I decided to set the "tic_frame_size_at_1fs" to 64 in the default configuration was to keep the driver ALSA interface usable via JACK (number of frames between JACK calls must be a power of 2) |
I've made a test on my Server with 2 x Xeon L5640 (24 Cores). The I have installed latest released kernel for this system 5.13.0-41-generic. So it seems that something major has changed in kernel. |
Thanks for sharing. This is interesting information. |
This is confirmed also on my N40 mini PC with Intel® Celeron® Processor N4020 , 2 Cores/2 Threads: |
I have made the same test on Raspberry PI4 with three different stock kernels. So now I need to find precisely from which Kernel version it's not running properly. |
it worked for me with last kernel of 5.9.x. |
I'm relative new to the Pi when it comes to compile or change the kernel. I'm a bit embarrassed, but I don't know how to change the kernel version. Regular apt install throws an error about creating links, same kernel gets loaded. Can someone point me to a tutorial? Do I really need to change the kernel by mounting the SD card in another computer? Thanks |
Btw: I've tryed |
in general it depends on the distro you are using if they offer some easy way to change kernel. |
Thanks, my problem is that is not working for the Raspberry Pi. No grub, for one. Nm, I'll get around it. |
I did some more tests and the XRUN issue starts from kernel 5.10.0 on. The issue happens for both X86 and ARM platforms. For this reason, for the time being, I suggest using a kernel version <= 5.9.x |
yes, usually on ARM boards in addition to the kernel and the headers you have to install the kernel dtb too. |
Another data point: If I build the upstream driver (master) with this patch only: https://bitbucket.org/MergingTechnologies/ravenna-alsa-lkm/pull-requests/5 Running it in combination with their daemon, I don't hear the glitching due to this latency issue on Kernel 5.18. There seems to be incompatibility in the API which prevents that build of the driver being tested with the daemon from this repo:
I do hear the issue running the driver/daemon built from this repo. I can see some additional driver code changes upstream that I suspect would be worth investigating the relevance of. |
The problem reproduces on multiple audio cards by using the original latency application in alsa-lib. |
perexg commented 11 minutes ago
|
I will run some more tests and add this setting to the documentation and scripts.
|
Hello,
I made some test on Raspberry4 and CM4. I have still XRUN when running latency_test.
I have tried various Raspberry modules, Raspbian, Ubuntu etc. Tryed stock kernels, also preempt kernels.
Can some share good working setup for Low latency usage on Raspberry?
Some info from latest test :
./run_test.sh S16_LE 48000 2 1
Compiling tools ...
make: Nothing to be done for 'all'.
Creating test file ...
test file created
Creating configuration files ..
net.ipv4.igmp_max_memberships = 66
Starting PTP master ...
Starting AES67 daemon ...
Waiting for PTP slave to sync ...
Starting to record 60 sec from sink ...
Recording raw data '/tmp/sink_test.raw' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
Starting to playback test on source ...
Recording to file "test/sink_test.raw" successfull
Test result:
ok
Terminating processes ...
daemon exiting with code: 0
./run_latency_test.sh S16_LE 48000 2 60 128
Compiling tools ...
make: Nothing to be done for 'all'.
Using buffer size of 128 frames
Creating configuration files ..
net.ipv4.igmp_max_memberships = 66
Starting PTP master ...
Starting AES67 daemon ...
Waiting for PTP slave to sync ...
Running 10 secs latency test
Scheduler set to Round Robin with priority 99...
Playback device is hw:RAVENNA
Capture device is hw:RAVENNA
Parameters are 48000Hz, S16_LE, 2 channels, non-blocking mode
Poll mode: no
Loop limit is 2880000 frames, minimum latency = 64, maximum latency = 64
Hardware PCM card 1 'Merging RAVENNA' 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 'Merging RAVENNA' 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 = 69888 ***
state : XRUN
trigger_time: 5053.170167
tstamp : 0.000000
delay : 0
avail : 64
avail_max : 64
Capture:
*** frames = 69760 ***
state : XRUN
trigger_time: 5053.170169
tstamp : 0.000000
delay : 0
avail : 128
avail_max : 128
Maximum read: 64 frames
Maximum read latency: 1333.333us, 1.333333ms (750.0000Hz)
End to end latency: 6.665 msecs
Terminating processes ...
daemon exiting with code: 0
The text was updated successfully, but these errors were encountered: