jack2 icon indicating copy to clipboard operation
jack2 copied to clipboard

Jack increase latency after some time

Open rkm432 opened this issue 5 years ago • 2 comments

I have very powerfull system: core i9 9900KS with Windows 10. I started Hyper-V machine with guest OS Windows 10. Between OS and guest OS work virtual network 10Gb/s. Two systems have unlimited CPU resources. I started in first OS: jackd portaudio + jack_load netmanager In second OS: jackd net + jack_load audioadapter Next, I connect ports of JACK for listening guest OS in OS - and all work, latency ~40ms, is good. But! After some times 5-15 min latency increases to 60-70ms! And sometimes, after 30-40 min left and right channels become asynchronous!

rkm432 avatar Jan 09 '20 17:01 rkm432

Same issue here, only the setup differs since we have different hardware instances: Intel NUC5 Ubuntu Bionic: no delay increase Intel NUC10 Ubuntu Bionic: no delay increase Intel NUC6 Ubuntu Bionic: the exact same delay increase when we speak through the microphone of the headset plugged in in the NUC6, also we hear the recorded audio double (left and right out of sync)

Test done by recording the microphone directly on the NUC6: jack_rec -f ./nuc_gaps.wav -d 500 audioadapter:capture_1 audioadapter:capture_2 In this recording I see now and then gaps of 0 values for about 20 up to 50 ms, does those random gaps (once every 10 minutes approximately) cause the audioadapter ringbuffer to increase? In this recording it is also clearly visible that the left and right channel of our mono microphone is out of sync (alsa doubles the mono microphone channel to stereo).

I have seen that sometimes after days the buffer increments up to 65536 frames!!! (=1.365 seconds delay!!!): log says

Output available = 256
JackLibSampleRateResampler::ReadResample error written_frames = 255
JackAudioAdapterInterface::PushAndPull ringbuffer failure... reset
Ringbuffer size = 65536 frames

I think it is unrelated, but we use the alsa backend: command line to start jack server

/usr/bin/jackd --sync --realtime --realtime-priority 89 --timeout 2000 -d dummy --period 256 --rate 48000 --playback 0 --capture 0 &
sleep 0.5
/usr/bin/jack_load audioadapter --init "-d hw:0 -p 256 -n 4 -r 48000"

uraura00 avatar Nov 26 '21 13:11 uraura00

Suppress the delay buildup by fixing the ringbuffer size which will be reset now and then. Suppress the input channel to be out of sync left and right to chose only 1 of the duplicated mono channel: /usr/bin/jack_load audioadapter --init "-d hw:0 -p 256 -n 4 -r 48000 -g 2048 -i 1 -o 2"

uraura00 avatar Nov 26 '21 14:11 uraura00