Closed yuannan closed 3 years ago
Panon is running python beneath QML. In your case, panon is expected to behave like this piece of code.
import time
import soundcard as sc # Make sure soundcard is installed
for mic in sc.all_microphones(exclude_monitors=False):
if 'Monitor of SONATA Audio Analog Stereo' in mic.name:
break
else:
raise
fps=60 # the FPS set in panon, maybe 144?
stream = mic.recorder(44100,2,blocksize=44100/fps)
# or just stream = mic.recorder(44100,2) , omitting blocksize
stream.__enter__()
while True:
time.sleep(1/fps)
data= stream.read(44100/fps, exception_on_overflow=False)
According to https://github.com/bastibe/SoundCard#latency, omitting blocksize (by removing this line)
will honor your system's default latency configuration, is a possible solution.
I did some tests on my system.
I did some tests on my system.
1. It is confirmed that changing panon's fps from 60 to 144 will reduce the latency (shown by pacmd) 2. Omitting blocksize does not make difference, not like soundcard's doc said. 3. But reducing latency does not cause popping on my system.
What cpu do you have at what bit rate and depth? I have a 1700 at 3.85Ghz and 384Khz and 32bit deep which I think causes more cycles on the CPU along with a very expensive resampling algorithm on top. This probably only affects me and other people on very high settings and older CPUs. This problem also fixes it self after a while so don't lose sleep after this. Not a big deal.
What cpu do you have at what bit rate and depth?
Intel Celeron G1820 (2) @ 2.700GHz and default settings.
This problem also fixes it self
You mean after my commit? Then it is because I did what soundcard's doc told me to do, and it fixed your problem.
You mean after my commit? Then it is because I did what soundcard's doc told me to do, and it fixed your problem.
No, no. I mean the issue goes away after around a minute or so. The latency goes back up to around 40ms and it's fine. This is not a permanent popping, more of a temporal "recalibration" period. The problem is that panon or some of it's dependencies causes this to occur.
This is why I said it's not a big deal and not high on the priority list as it's annoyance and not anything breaking.
Desktop (please complete the following information):
Describe the bug Running panon causes popping and static to happen with audio streams that are usually fine.
pulseaudio -k // refresh the daemon and kills panon
pacmd list-sinks | grep latency
outputs: pre panon reinit and just playing music in Tauon music boxreinit panon > back-end > input device > Monitor of SONATA Audio Analog Stereo
For some reason when panon is running it will reduce the latency all the way down to 6.94 (and it always seems to be 6.94 when most latencies will change over time)
This DOES change. It seems like for whatever reason panon triggers a lower constant latency for a certain time. After a while it'll go back to dynamic latency and level out to around 40ms
Interesting observation
This seems to be improper handling of the rendering pipeline; polling something at my screen's refresh rate (144Hz). Might be an upstream issue from some libraries used but it does level out eventually and the popping stops. After a bit more testing this is directly related to the FPS set in panon (60fps will give 16.67ms constant for a bit) and not from your display, drivers, or anything else.
My hardware is a SONATA HD PRO at 384KHz and s32le. Don't think there is anything else strange about my setup but here is the pulse config anyway. /etc/pulse/daemon.conf