Page 2 of 4

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Fri Apr 26, 2019 6:30 pm
by Spanner
I'm stupid but what I would do first is record the pops and then analyse the recorded sound so that I might identify a probable origin.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Fri Apr 26, 2019 10:32 pm
by crocket
merlyn wrote:I use Catia to manage JACK connections and Firefox appears as a JACK client called 'Audio IPC Server'. It auto-connects to the system outputs. Other than that I'm not sure what you mean about Firefox being its own patchbay.
Firefox automatically connects to system outputs. That's the problem. I want to control jack connections with my own jack patchbay.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sat Apr 27, 2019 6:01 pm
by merlyn
The Firefox JACK code was written by zam :

http://www.zamaudio.com/?p=1580

In another thread it was found that alsa_in worked without glitches using the minimum of options.

viewtopic.php?f=27&t=19610&start=15

So you could try

Code: Select all

alsa_in -j cloop -d cloop 

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 4:31 am
by crocket
merlyn wrote:The Firefox JACK code was written by zam :

http://www.zamaudio.com/?p=1580

In another thread it was found that alsa_in worked without glitches using the minimum of options.

viewtopic.php?f=27&t=19610&start=15

So you could try

Code: Select all

alsa_in -j cloop -d cloop 
I think the problem is too much jitter coming from ALSA loopback because softwares like mpv and firefox and vivaldi feed sound signals into ALSA loopback instead of hardware capture devices. Softwares have to compete each other for CPU resource. Also, xruns between ALSA loopback and alsa_in/zita-a2j cannot be detected by either alsa_in or zita-a2j.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 12:11 pm
by merlyn
After you type alsa_in it outputs 'delay = xxxx'. If the delay changes there is a glitch. To stop the delay changing leave out the options specifying the size of the buffer used for re-sampling.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 1:50 pm
by crocket
merlyn wrote:After you type alsa_in it outputs 'delay = xxxx'. If the delay changes there is a glitch. To stop the delay changing leave out the options specifying the size of the buffer used for re-sampling.
I get no delay from alsa_in after configuring realtime cpu scheduling for rtaudio cgroup. What happens if I don't specify "-p" and "-n" for alsa_in?

Code: Select all

alsa_in -j cloop -d cloop -c 2 -p 2048 -n 3 -q 1
(Is it 256 frames per period and 3 periods per buffer? "-p" can be bytes or frames per period.)
This seems to produce much less pops than zita-a2j after configuring realtime cpu scheduling for rtaudio cgroup. The pops from alsa_in are far quieter, too.
It seems that alsa_in is better than zita-a2j at handling alsa loopback.

However, I still haven't managed to eliminate pops.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 2:01 pm
by merlyn
I mean the output in the terminal. Here's my output:

Code: Select all

alsa_in -j photon -d hw:2
selected sample format: 24bit - real
delay = 2968
So if you see 'delay = xxxx' in your terminal and it changes then that's the cause of the glitches and it was fixed on my system by using only -j and -d.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 2:02 pm
by crocket
merlyn wrote:I mean the output in the terminal. Here's my output:

Code: Select all

alsa_in -j photon -d hw:2
selected sample format: 24bit - real
delay = 2968
So if you see 'delay = xxxx' in your terminal and it changes then that's the cause of the glitches and it was fixed on my system by using only -j and -d.
Delay doesn't change randomly over time whether or not I specify "-p" and "-n". What are the values of "-p" and "-n" if I don't specify them?

Why do I hear pops even if delay doesn't change?

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 2:18 pm
by merlyn
crocket wrote:What are the values of "-p" and "-n" if I don't specify them?
I don't know but bigger than 2048.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 2:34 pm
by crocket
merlyn wrote:
crocket wrote:What are the values of "-p" and "-n" if I don't specify them?
I don't know but bigger than 2048.
I just read alsa_in.c. The default period_size is 1024. The default number of periods is 2.

Even with "-p 1024 -n 2", I can still hear glitches in audio. Glitches occur even if delay doesn't change.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 2:41 pm
by merlyn
crocket wrote:The default period_size is 1024. The default number of periods is 2.
That's strange because the delay is much bigger when I leave options off compared to specifying a 1024 buffer.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 2:57 pm
by merlyn
crocket wrote:Glitches occur even if delay doesn't change
What delay do you get? On the other thread low delays e.g. 144 weren't working.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 3:04 pm
by crocket
merlyn wrote:
crocket wrote:Glitches occur even if delay doesn't change
What delay do you get? On the other thread low delays e.g. 144 weren't working.

Code: Select all

~> alsa_in -j cloop -d cloop -p 256 -n 3
selected sample format: 32bit
delay = 1195
delay = 769
delay = 770

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 3:10 pm
by merlyn

Code: Select all

~> alsa_in -j cloop -d cloop -p 256 -n 3
selected sample format: 32bit
delay = 1195
delay = 769
delay = 770
That means your delay is changing. On my output I get a delay value and it stays there. Just leave out -p and -n.

Re: How can I eliminate pop sounds from alsa_in and zita-a2j working on ALSA loopback?

Posted: Sun Apr 28, 2019 3:20 pm
by crocket
merlyn wrote:

Code: Select all

~> alsa_in -j cloop -d cloop -p 256 -n 3
selected sample format: 32bit
delay = 1195
delay = 769
delay = 770
That means your delay is changing. On my output I get a delay value and it stays there. Just leave out -p and -n.
The delay stabilizes after 770. It is ok for delay to change for the first few seconds.
Not specifying -p and -n is the same as "-p 1024 -n 2". I confirmed by reading delay.