[Resolved] Timing problems on RPi4 (buffer overflows, icecast stalling) without optimization #261
Replies: 8 comments 5 replies
-
I'm running on an RPi 4 using the minimal Raspberry Pi 32-bit OS and not seeing a problem. I'm using 3 dongles (2.4 MHz bandwidth each) to process a total of 72 NFM frequencies and feed 7 mixers, each with an icecast stream. I compile with
The larger bandwidth of the RSP1As may be slowing you down, I'm curious if enabling multiple demodulation threads will help. |
Beta Was this translation helpful? Give feedback.
-
Thanks for your info and the two global flags! Your experience shows that it can work. I have now commented out the rr scheduler in the service file for a test and set the two flags in the rtl_airband.conf. I am curious about the result and let you know. The flag With RTL sticks I never have such problems. Everything always runs smoothly. The problems occur rather with SoapySDR or the higher bandwidths that come with it. But since the RPi 4 is quite performant and the CPU is far from busy, I wouldn't expect the problems yet. Something seems to cause "friction". |
Beta Was this translation helpful? Give feedback.
-
I sporadically monitored the Icecast stream today with the new settings. The number of "hickups" seems to be much smaller with these settings, even without special task scheduling. A step in the right direction. For example, I never noticed that the stream was completely stopped. This is an improvement. However, I sporadically have the effect that fractions of a second are missing or a fraction of a second is played twice - a kind of short stutter. This happens about 5 times per hour. I'm still trying to figure out what's causing minor timing problems. But it's getting better and better. :-) |
Beta Was this translation helpful? Give feedback.
-
I just can't get rid of the timing issues on the mixer. I have attached an example which contains two MP3 files. The effect is that whole syllables, even words, are missing. Instead of "Turn left heading..." only "..... ding" can be heard in the mixer. Over the Icecast stream it came exactly the same: 1: Direct MP3 recording of the channel Currently I have both options for multithreading set to true, the TaskScheduler set to rr (round robin) with high prio. RTLSDR airband is compiled for native platform this time. The problem is the same for other (more conservative) settings. Here are some statistics:
Hardware: RPi 4, 4GB I am wondering what this could be and what I can do to locate the problem. |
Beta Was this translation helpful? Give feedback.
-
It may just be too many bits to process in time. Try disabling one of your two devices and see if cutting down the load causes less drops |
Beta Was this translation helpful? Give feedback.
-
Another thing to try to see if it’s a load issue is over clock the pi |
Beta Was this translation helpful? Give feedback.
-
I have now turned off all outputs to the SD card (MP3, RAW) for test purposes. Only one of the mixers I output as Icecast and as MP3. With this I want to find out if the output to the SD card could be the problem. |
Beta Was this translation helpful? Give feedback.
-
At least in my case, it appears that the output to the SD card caused all the timing problems. After switching to an output to the ramdisk, no more problems occur. I therefore set the title to Resolved. Thanks for the support! |
Beta Was this translation helpful? Give feedback.
-
I am currently testing the unstable branch intensively on a Raspberry Pi 4B 4GB under Raspberry Pi OS.
I noticed in several places that the processing of the samples and the generation of e.g. the Icecast streams can lead to timing problems. This manifests itself in buffer overflows and stalling Icecast streams. Although the 4 cores are only used about 30% each.
I have read on the web that other users with real time audio applications on the RPi 4 have experienced similar problems.
I have significantly less problems when I build the Real Time RT kernel myself or when I use Ubuntu Server 64 bit. Especially the standard Raspberry Pi OS kernel seems to be affected. At least for me.
Since it's still most convenient to use Raspberry Pi OS, I tried to get a handle on the problem using task scheduler optimizations. And indeed everything runs much smoother with the following service file, where I choose the Round Robin scheduler with high priority, which is proven for Real Time.
Am I alone with my observations?
Beta Was this translation helpful? Give feedback.
All reactions