Skip to content
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

"Update Interval" Setting has no effect on Spectrum anymore #3380

Open
indivisualvj opened this issue Sep 13, 2024 · 4 comments
Open

"Update Interval" Setting has no effect on Spectrum anymore #3380

indivisualvj opened this issue Sep 13, 2024 · 4 comments

Comments

@indivisualvj
Copy link

EasyEffects Version

7.1.9

What package are you using?

Flatpak (Flathub)

Distribution

Linux Mint 21.2 Cinnamon

Describe the bug

Update Interval setting is described to apply to Level Meters and Spectrum, but Spectrum is (since the performance update) not rendering according to the interval i set (33ms). When i set it to 1000ms Level Meters do update once a second, but Spectrum remains in 60FPS.

Expected Behavior

Either spectrum to render according to set value or label of setting to not mention Spectrum anymore
image

Also i still don't understand why this value is to be defined in Milliseconds instead of FPS or Hz.

Debug Log

No response

Additional Information

No response

@wwmm
Copy link
Owner

wwmm commented Sep 13, 2024

Also i still don't understand why this value is to be defined in Milliseconds instead of FPS or Hz.

It is closer to what is actually being done. That control is adding a delay between updates and not enforcing a particular fps value. Depending on the situation this isn't even possible. For example we can not update the spectrum faster than the rate PipeWire sends audio buffers.

In any case the latest changes to the spectrum made this control useless to it. We will have to address this issue in the future.

@AlexFolland
Copy link
Contributor

AlexFolland commented Oct 11, 2024

For example we can not update the spectrum faster than the rate PipeWire sends audio buffers.

I also encountered the reported issue, and read this ticket. I noticed that this claim seems incorrect, since it's possible to process the buffered audio itself. For example, PipeWire could send 10 seconds of audio and the spectrum animation could still update at 240 Hz (or whatever the display's refresh rate is; mine is 240 Hz and I was wondering why it was updating so slowly) by processing segments of audio within that buffer, with each newly-processed segment starting 1/240 of a second further along the buffer. If the buffer is not as long as the desired segment, the segment the spectrum processes could be the last desired processing duration of the available buffer to always be able to display a processed video frame for each display refresh.

That being said, I'm not claiming that's what's happening right now or that that would be how to fix the issue. I just wanted to refute the claim that it's not possible, since it is.

@wwmm
Copy link
Owner

wwmm commented Oct 11, 2024

For example we can not update the spectrum faster than the rate PipeWire sends audio buffers.

I also encountered the reported issue, and read this ticket. I noticed that this claim seems incorrect, since it's possible to process the buffered audio itself. For example, PipeWire could send 10 seconds of audio and the spectrum animation could still update at 240 Hz (or whatever the display's refresh rate is; mine is 240 Hz and I was wondering why it was updating so slowly) by processing segments of audio within that buffer, with each newly-processed segment starting 1/240 of a second further along the buffer. If the buffer is not as long as the desired segment, the segment the spectrum processes could be the last desired processing duration of the available buffer to always be able to display a processed video frame for each display refresh.

That being said, I'm not claiming that's what's happening right now or that that would be how to fix the issue. I just wanted to refute the claim that it's not possible, since it is.

That is not how things work @AlexFolland. There is a rate at which pipewire sends audio buffers. If you try to go faster than that you do not have new data to work on. It does not matter if you are trying to work with small slices. Your idea would just draw the same set of data if you call the drawing functions between each buffer arrival.

The current code already process some of the past data together with the new buffer. The thing is the buffers are nowhere near as big as you are imagining them to be. Arbitrarily slicing things to match display refreshing rates isn't necessarily viable or efficient from a cpu usage point of view. And if not enough new data is sent and in the end the new drawing has just 1 or 2 milliseconds of new data to display will it be even possible to see the difference in the calculated Fourier transform with the naked eye? I have my doubts.

@wwmm
Copy link
Owner

wwmm commented Oct 11, 2024

In a case where pipewire is running at 48 khz and with a quantum of 1024 each buffer would have about 20 milliseconds of data. Maybe it sends several of these buffers between each drawing. Maybe it doesn't. I have no control over this. But depending on how arbitrarily fast someone wants the drawing to go we are talking about slicing buffers that would be on the order of 20 milliseconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants