-
Notifications
You must be signed in to change notification settings - Fork 548
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
Plotter and waterfall performance enhancements #1383
Conversation
Thanks for these improvements! I'll have a look over them soon.
As far as I know, the audio plotter has always been fixed at 25 fps, and I haven't really seen much reason to change it or make it adjustable. Perhaps others have opinions on it. |
I think the audio plotter rate is meant to be the minimum rate where it looks smooth to the eye. Nice analysis! Do you see any effects of the DPR related changes with HiDPI displays? |
@willcode i am developing on a high DPR display so I verified that still works. by reordering the maths to do the DPR multiplication last, i can ensure the alignment in device independent pixels in the drawPixmap operation. this means a straight copy should always be done instead of a scale (in those odd cases where rounding made them misaligned). |
OK. We spent a lot of time dealing with "line too thin" or "looks fuzzy" kind of things when reworking the plotter for real coordinates, so we want to look at the results carefully. |
@willcode here are some screenshots. note the version in the window's title |
Is it necessary to use 2x height and copy? It might be possible to get the same performance benefit by splitting the |
6d61cee
to
22d2adc
Compare
i have fixed the peak alignment and off by one fills. i have rebased off of the working master and the checks are all passing now. i actually thought about doing the waterfall the way you mentioned and thought that the device pixel ratio stuff was going to be a pain around around rounding (when the window slides but not to a full pixel). however, i went ahead and changed it to your way. i found that the device pixel ratio maths in drawPixmap is smart enough to do subpixel level things. e.g. 2.5 pixels (with a device pixel ratio of 2) does indeed resolve to 5 pixels. so this way will work and does work on my retina mac. i verified that the efficient memmove is being used. |
I'm glad to hear that it worked! In my testing so far, I have observed a decent performance improvement (tested on a Linux laptop and a Raspberry Pi, neither with high-DPI displays). I'll do a bit more testing and have a look over the code as well. |
If the "Split Plot/WF" slider (in the "FFT Settings" panel) is dragged all the way to the left (i.e. waterfall only), then the plot remains visible and quickly cycles through two or more sizes in an infinite loop. |
It looks like this bug happens because |
I have fixed both items. I actually was able to test in two device pixel ratios (1 and 2) with an external monitor. The DPR 1 was definitely broken as you reported. The DPR 2 I thought generally looked ok, but I was able to apply a fix to both of them. It had to do with some rounding and the fact that the the center of the circle is technically in the top left of the center pixel, so but nudging the pixmap over by one pixel we are back on alignment. Here are my screenshots (note i enabled a background rect just for debugging, that has been removed): |
Thanks. It looks good now. I'll get this merged soon, as long as no other bugs come up. |
It appears this may have caused a performance regression: #1386 Any idea why that might be @yuzawa-san ? |
i run this application on my laptop and find that the CPU is quite high, so i did some flame graph analysis to see if i could reduce CPU (to have longer battery life). i had already run volk_profile. i found that actually the rendering was taking up more CPU than the actual GNUradio and DSP operations. i did the following operations:
sliding window implementation:
i ran a test with these settings and docks open:
before:
after:
notable differences:
i was doing 10fps at 110%, but now that is around 60%.
i was topping out at around 20 fps with around 130% cpu, but now that is around 100% cpu.
now i'm topping out around 40fps with around 110% cpu, so these changes provide a significant improvement.
open question: should the dock audio CPlotter share the same fps as the main CPlotter? it seems to be preset to 25fps (1000/40ms).