Rpi2 and jackd: xruns

Moderator: flatmax

Post Reply
cyberic
Posts: 5
Joined: Sun May 14, 2017 6:55 am

Rpi2 and jackd: xruns

Post by cyberic » Sun May 14, 2017 8:01 am

Hi,

I am testing the stereo soundcard to see if it could be used for live performance, with jack.

I use dtoverlay=i2s-map, on a Raspbian.
Kernel: Linux raspberrypi 4.9.24-v7+ #993 SMP, on a Raspberry pi 2

Below are the different configurations I tested.
I stress the pi with 'stress-ng --cpu 4 --fork 4 --timeout=10s'

I use the pi through VNC so the network card is used as well.


I didn't notice I had to add dtoverlay=i2s-map to my config.txt, and without it I was having some freezes of the Pi2.

With dtoverlay=i2s-map, it is better. I get some xruns, but at least the Pi doesn' t freeze and I can restart jacks.

I understand it is normal to get some xruns, but I though that after a few, the soundcard would be able to recover and keep operating nomally.
Am I wrong?

When I got xruns, it starts by ony one, then bursts of 300 to 500 xruns per second.
And even after reducing the load, jack cannot recover, xruns don't stop.


If I can help you in any way, or add some debug, please tell me.

With all the combinations given below, I got some 'unstoppable' xruns.
In logs, I got: bcm2835-i2s 3f203000.i2s: I2S SYNC error!

f/p = frames/period
p/b = periods/buffer

with sample rate: 48000
f/p p/b
256 2


sample rate: 96000
f/p p/b
128 3
128 4
256 2
256 3

Thank you
Eric

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Rpi2 and jackd: xruns

Post by flatmax » Fri May 19, 2017 8:14 am

Hi there,

Do I understand you correctly, when there is low CPU load there are no xruns and as you put more load onto the CPU you get more xruns ?
With the latest rpi kernel I don't thinkg you need to use the i2s-map dt overlay. But not 100% sure on that one.

These I2S sync errors :
bcm2835-i2s 3f203000.i2s: I2S SYNC error!
Are not significant and occur for some unknon reason with the bcm2835 driver.

Are you running jackd with realtime priority ? IS there a way for you to increase the scheduling priority of jack to force the kernel to tend to audio related processing before it tends to other processes ?

thanks
Matt
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

cyberic
Posts: 5
Joined: Sun May 14, 2017 6:55 am

Re: Rpi2 and jackd: xruns

Post by cyberic » Fri May 19, 2017 6:06 pm

Do I understand you correctly, when there is low CPU load there are no xruns and as you put more load onto the CPU you get more xruns ?
Yes
But I think this is expected to get underruns under a high load with I/O as well.
I though that the xruns would only last during the high load, and disappear as soon as the load is back to normal... but this is not the case.
Bursts of xruns keep happenning even when the load is back to normal.
With the latest rpi kernel I don't thinkg you need to use the i2s-map dt overlay. But not 100% sure on that one.
I ran the same tests without it, and is produced xruns then hard crashes, and I had to rboot the pi several times. With the option, jack doesn't crash.

Are you running jackd with realtime priority ? IS there a way for you to increase the scheduling priority of jack to force the kernel to tend to audio related processing before it tends to other processes ?
Yes. I think these test were done with a realtime priority of 90.
Aren't you able to reproduce them?

I can provide the exact command lines I use to launch jack, if you want.

flatmax
Posts: 609
Joined: Sat Jul 23, 2016 11:39 pm

Re: Rpi2 and jackd: xruns

Post by flatmax » Tue May 23, 2017 5:27 pm

Happy to do a test to help you debug, if I can. Please send the command lines ...
Check out our audiophile quality crossovers : https://bit.ly/2kb1nzZ
Please review the Zero sound card on Amazon USA : https://www.amazon.com/dp/B075V1VNDD
---
Check out our new forum on github : https://github.com/Audio-Injector

cyberic
Posts: 5
Joined: Sun May 14, 2017 6:55 am

Re: Rpi2 and jackd: xruns

Post by cyberic » Thu May 25, 2017 9:56 am

Hello
I have done some more tests, and this behavior was due to the application I was using.

In fact I achieved to run stable with this parameters:
jackd --realtime -P95 -d alsa -dhw:audioinjectorpi -p 64 -n 3 -r 88200 -s

Thank you and sorry for the noise ;-)

Waiting for the octo now !

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests