-
Notifications
You must be signed in to change notification settings - Fork 479
Feedback: Audio underrun on Start up to 25 Seconds Debian Buster #139
Comments
Hanging Area: |
After test Raspian Buster with Stretch Firmware on Kernel 4.14-98 no changes! |
Same problem here with RPI3 and Raspbian Buster. |
I think a problem is in csdr bandpass_fir_fft_cc function thtat perform benchmark instead of estimate. the benchmark is really slow and on start seems to crash something (I suppose nmux) and this trigger a restart of the whole chain. --- ../csdr.old/csdr.c 2017-09-25 21:45:33.018152254 +0000
|
Hi thanks will try that, i had same issues on: |
Had same issues on Orange Pi H3 512MB
|
I cannot get the patch to compile, in the line |
unfortunately I wasn't able to past correctly the patch, I don't know ML very well and the patch got all splitted up in the output above. try this patch. --- ../csdr.old/csdr.c 2017-09-25 21:45:33.018152254 +0000
- FFT_PLAN_T* plan_inverse_1 = make_fft_c2c(fft_size, output_fourier, output_1, 0, 1); //inverse, do benchmark |
I just tested downgrading libfftw3* from 3.3.8 (which is the version included in buster) to 3.3.5 (which is the version in stretch), which seems to restore the original, quick startup. Anybody know what's going on between these two versions? I do understand that switching to FFTW_ESTIMATE also does the trick, but is there any insight why? The code has been doeing FFTW_MEASURE for ages, has the behaviour been changed? There's no other versions on the raspbian repository to try. Here's where I got the packages for the downgrade: http://raspbian.raspberrypi.org/raspbian/pool/main/f/fftw3/ |
I found this part of the documentation: http://www.fftw.org/fftw3_doc/Cycle-Counters.html and i found this in the changelog for version 3.3.6p2-1 of the debian package:
if i puzzle this together correcly, the .deb for 3.3.5 came without any cycle counter, and as such fell back to FFTW_ESTIMATE. from version 3.3.6p2-1 forward, a "slow" cycle timer, that is implemented in software, has been enabled, which probably allows the FFTW_MEASURE to work for the first time, albeit "slow". Summing up: that means the patch suggested by @nackstein should restore the known behaviour for arm processors. For a useful patch, the fix should probably be wrapped in precompiler statements as to only be applied on arm processors. I am currently recompiling fftw3 3.3.8 without the flag to verify. I have also seen that there is hardware cycle support for armv7a processors. not sure if raspi processors fall into that, but it might be worth a try. |
confirmed: removing |
i have opened up a pull request that should resolve this for raspberry users: ha7ilm/csdr#51 it may be a little over the top since it applies to all arm processors, i am definitely open for ideas on how to detect the actual scenario. please leave replies about that on the PR. |
@jketterl jketterl |
yes, i believe the cpu detection / compiler optimisation in the makefile is broken in more than one way (i.e. it detects raspberry pi by looking for "BCM2708" in /proc/cpuinfo - i have tested a bunch of my raspberries for this, and it only applies to a single 1B+). I am however not knowlegdeable enough in the field of CPU hardware to fix that. If you did have a way to compile this before my changes, it should still work that way now. Just make sure that you keep the newly added -DCSDR_DISABLE_FFTW_MEASURE somewhere in there. |
i wrote to the Debian Maintainer of fftw3 to check this behavior cause newbies cant fix this and it makes openwebrx unuseable on ALL ARM OS 2019 setups , BUT WE NEED THIS ! cause its the one and only opensource websdr-Server Software of Andras |
well, i didn't inquire, but i'm assuming there is a story behind why they enabled it in the first place. Unfortunately, recompiling the packages is quite the process. |
Hello. I am the one responsible for the 3.3.6 upload to Debian, which was mostly motivated to help fftw on ARM, really. Thank you for all your trouble to identify the culprit. Please allow me some extra time to find some external input on this issue. If there is no technical agreement/solution then we should possibly have two packages, both compiled with different parameters. |
I don't have the external input, yet, but memory kind of kicks back in. Our work on the fftw update was motivated to get best-possible fftw performance in a high-performance setup with RPis (for Einstein@Home this was). No idea if this holds for the RPi4, but with previous models the RPi had problems to give exact timings, so you could not tell what route in fftw was the best. Hence the "slow timer" setting. Once a so called "wisdom" file was created, which takes a few hours to create, the planning is known for subsequent program invocations. Even in case that the RPi4 no longer needs that slow timer, there is yet only one package for all RPi versions and to have the slow timer parameter set for that one package kind of seems right to me. The FFTW_ESTIMATE basically says that you don't care too much about using the best-possible way to compute with FFTW. So, the planner within the FFTW has less to think about. If that is technically sufficient for your application, then I think I would just go and set that environment variable at startup. Did anybody of yours look into wisdom files? This should dramatically improve the performance of the FFTW. No idea if this also reduces noise levels for you - would actually be interesting to learn about. You need one wisdom file per platform. This should then grant immediate startup times, too. However, from what I understood, it is a timeout/crash somewhere else that is the main cause for the delay. Maybe you want to have a look into that, too. A SDR is on my Xmas shopping list. Anyway, let's wait for what the ARM+FFTW experts say. |
We had a similar discussion some while ago: There is no cycle counter available in user space on arm/arm64, therefore we have to rely on with-slow-timer to get proper plan generation on arm. Without the with-slow-timer flag, fftw has no way of benchmarking and therefore always felt back to FFTW_ESTIMATE, no matter what you specified. From the FFTW-Manual http://www.fftw.org/fftw3_doc/Cycle-Counters.html: The simplest fix for that would be to use FFTW_ESTIMATE on all arm devices. It doesn't matter if it's a PI4, PI3, Odroid N2 or what ever. It's the same on all arm devices. That should restore the behavior of your app before the fftw 3.3.6p2-1 update. A better solution would be to once generate a wisdom, export it and load it on next startup. |
@N30dG, thank you for helping out and for the link to the fftw3 repository on salsa (which is where the packaging work is orchestrated) and the associated discussion. @ALL, the generation of the wisdom file needs insights on how exactly the fftw3 library is invoked. What would be pretty cool is to have the exact command line for fftw-wisdom (or its variants) given in the documentation of openwebrx and also openwebrx shoudl possibly collect working wisdom files for different platforms from the community. As a bit of a sidenote I just saw that there is a Debian package for rtl-sdl but none for libcsdr. To compensate for your extra hassle with the ARM platform I could help with a Debian package for that library. Tell me. |
thank you @smoe and @N30dG for providing some insight on what exactly is going on, and why the slow timer was enabled. I really don't mind the slow timer per se, given that the old behaviour is still available by using FFTW_ESTIMATE. The only thing I'm having trouble with is detecting the slow timer, since I'd really like to keep FFTW_MEASURE in place for those scenarios where it works. As for wisdom: I have had a quick look at them, but I have not yet fully understood the code well enough to patch it in. I'm concerned with the dynamic nature of this application, I'm not sure if the actual fft parameters will be repeating. If they are not, wisdom files would probably not help much. Also, I wanted to clarify that openwebrx is only indirectly affected since it calls the csdr command-line tools; this issue would probably be better placed in the csdr project. I have also done some work on a debian package over on my fork: https://github.com/jketterl/csdr/tree/debian - I'm currently trying to package all of the openwebrx related tools to facility simpler installation, even though I do not intend to publish them into the debian repositories, not for now. Many parts need polishing. |
Nice to hear you already started with the packaging. I happily sponsor an upload for you. For all ARM platforms you can just use FFTW_ESTIMATE since prior to 3.3.6 this is all you had, anyway. And you seemed (seem for those falling back to <=3.3.5) happy with it. As I said, I would really like to learn if noise levels are different - if not then it sounds much like a non-issue except for some CPU time wasted. To learn about the platform you are running on it seems completely fine to just invoke "arch" or "uname -m", which should be on all Linux platforms. You are right wrt to an unclear size argument of the FFTW invocation. This likely depends on the bandwith of the individual SDR, right? Just guessing. @N30dG kindly pointed me in a PM to https://github.com/simonyiszk/csdr/blob/master/fft_fftw.c where you may want to patch in the dump of all new sizes requested to stderr. Then the users know for what sizes to prepare the wisdom and with a bit of luck there is not too much variation between the devices. |
There is no need to know the size of a transformation for wisdom generation. You only have to know the size when you use the fftw-wisdom tool. For most applications you shouldn't use this tool anyway. For example, the first function of https://github.com/simonyiszk/csdr/blob/master/fft_fftw.c should look something like this: FFTW wisdom's can contain multiple transformation sizes in one file. If the actual size isn't contained in the wisdom you have imported, fftw adds the informations for the new size to the wisdom. This way your wisdom gets "better" over time. |
today i rolled back my new pi3 b+ 2019 (same on pi4 4GB 2019) on Debian Stretch.
Cause I got permanent audio buffer lookup to 25 seconds on start openwebrx.py
openwebrx OK on:
libusb-1.0-0
gcc 6.3.0.18
cmake 3.7.2
kernel 4.14.98-v7+
python 2.7.13
used rtl-sdr Dongle silver Version3
On Buster always Audio Buffer underruns
python 2.7.16 are here Major Changes? or a libusb problem?
libusb 1.0.3
kernel 4.19
... who knows why?
csdr seems hanging on calc high and low cut 4000! waits here on 20~25seconds then run clean
on pi3 + pi4 (4GB)
System load was always ~25%
no Kernel Messages or Logs
The text was updated successfully, but these errors were encountered: