[SOLVED] audio crackling in duplex mode

Optimize your system for ultimate performance.

Moderators: MattKingUSA, khz

nixit
Established Member
Posts: 26
Joined: Fri Jun 30, 2017 2:11 pm

Re: audio crackling in duplex mode

Post by nixit »

@pablo,

Thanx for all the info, installing lsof now so I can compare what I have to what you have.

While I do this, could you post your qjackctl settings? specifically the Settings/Advanced tab as well as the Options and Misc tabs?

There has to be something I'm missing..:

--nixIT
Jack Winter
Established Member
Posts: 381
Joined: Sun May 28, 2017 3:52 pm

Re: audio crackling in duplex mode

Post by Jack Winter »

nixit wrote: I'm not sure how to stop the zita bridge after I close/stop qjackctl and jack2dbus
Try adding "pkill zita-a2j; pkill zita-j2a;" to "execute script after shutdown" in qjackctl. Though thinking about it I suppose that it ought to die by itself when you kill the JACK server.
My recommendation would be to always run JACK, unless you have a specific reason not to. I also use 2 soundcards, but I use my good soundcard with JACK and let PA output to the onboard one. But with pavucontrol I can easily switch playback to the better card. And using the excellent zita-njbridge I can even output to JACK servers running on my other computers, so I just switch output channels in my DAW, and output switches to the TV or laptop speakers, etc.
this is the end result I am trying to achieve. the soundcard I want to use with JACK is my scarlett 2i2 (hw:usb) and the one I want to use with PA is my onboard (hw:sb).
You are confusing me :) I thought what you wanted to do is to record from your scarlet 2i2 with audacious using JACK while outputting the audacious output (plus desktop sound) to your SB?
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux
nixit
Established Member
Posts: 26
Joined: Fri Jun 30, 2017 2:11 pm

Re: audio crackling in duplex mode

Post by nixit »

@jack winter
You are confusing me :) I thought what you wanted to do is to record from your scarlet 2i2 with audacious using JACK while outputting the audacious output (plus desktop sound) to your SB?
I'll be honest Jack, I am so confused by this right now. :(

You are correct, I do want to use JACK and have it record via my scarlett 2i2, and then any output go to the onboard SB card.

When I have the following on the "Execute Script after startup" option in qjackctl:

Code: Select all

pasuspender -- zita-j2a -d hw:SB -c 6 -r 48000 &
I can get playback sound through audacity, I don't use audacious. And when I go to play audio through the browser or a movie, nothing plays, the audio or video doesn't even start because it's frozen. I even tried mapping a connection from PulseAudio JACK Sink to zita-j2a source, as well as selecting JACK bridge within the playback tab of pavucontrol.

I then change the execute script after startup to be:

Code: Select all

zita-j2a -d hw:SB -c 6 -r 48000 &
and when I press start in qjackctl I get this message in the Messages window:

Code: Select all

10:27:25.748 zita-j2a -d hw:SB -c 6 -r 48000 &
10:27:25.756 JACK connection graph change.
Can't open ALSA playback device 'hw:SB'.
I am assuming this happens because pulse is controlling the SB card.

So apparently I am not understanding something. Is what I want to do out of the norm? From what I've read from @Pablo's comments he is achieving something that I want to.

If I can ever get this working, I am definitely writing up a doc on how to do it for future reference.

--nixIT

EDIT: instead of going through the previous messages and trying to decipher the info, would it help if I compiled all necessary info (hardware setup, software, objective) into one message?
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: audio crackling in duplex mode

Post by Pablo »

I thought you got it working at some point... I also thought that you don't want to suspend pulseaudio. The pasuspender prefix was a trick that some people used to resort to when pulseaudio and jack didn't get along with each other, but I assume you have an up to date system.

It could be that things are broken again, but I hope not.

So now the problem seems to be the same that some days ago, that zita-j2a doesn't work? Have you tried with alsa_out? Also, try not specifying the number of channels. Do you really need to include that in the command to get 6 channels? Don't all of them appear by default? Also, only add the command to the execute script when you are completely sure that zita-j2a (or alsa_out) starts reliably.

If then fails, it would seem like a bug or misuse of qjacktl. But the main problem would be solved. Crossing my fingers...
nixit
Established Member
Posts: 26
Joined: Fri Jun 30, 2017 2:11 pm

Re: audio crackling in duplex mode

Post by nixit »

@pablo,

It does appear to work if I complete uninstall and remove pulseaudio, however I need pulseadio

Qjackctl is set up as follows:

Code: Select all

Settings/parameters tab
--Driver: Alsa
--Interface: hw:USB

Settings/advanced tab
--server prefix: jack_control start
--Audio: Capture Only

Options tab
--Execute script after startup: zita-j2a -d hw:SB -c 6 -r 48000 &  (this works when pulse is not installed)

Misc tab
--enable d-bus interface checked
--enable jack d-bus interface checked
--stop jack audio server on app exit checked
When pulse is installed zita-j2a does not load, I get the message:

Code: Select all

15:44:50.118 zita-j2a -d hw:SB -c 6 -r 48000 &
Thu Jul 12 15:44:50 2018: New client 'qjackctl' with PID 1074
Can't open ALSA playback device 'hw:SB'.
So I remove the zita-j2a line when I install pulse.

When pulse is installed, and qjackctl is running, in the connection window I can see:

Code: Select all

Readable clients:
--pulseaudio jack sink
--system

Writeable clients:
--pulseaudio jack source
With the above running, I load pavucontrol and see the following

Code: Select all

Output Devices tab:
--build in audio (hw:SB)
--jack sink (Pulseaudio sink)

input devices tab:
--focusrite scarlett 2i2
--jack source (pulseaudio jack source)
with pulse installed, it appears I can record audio with ardour and audacity through my scarlett 2i2 (hw:USB), but when I play it back, no audio is heard. Audio does appear to play through the browser and movies/music on my computer, just not through my audio editing programs.

are the pulseaudio jack sink/source set up correctly?

am I attempting to do something that can't be done?

hw:USB --capture through jack
hw:SB --playback through pulse



--nixIT
nixit
Established Member
Posts: 26
Joined: Fri Jun 30, 2017 2:11 pm

Re: audio crackling in duplex mode

Post by nixit »

since zita-j2a and alsa_out both work correctly when pulseaudio is not installed, is there a pacmd or pactl command that is equivalent to either zita-j2a -d hw:SB or alsa_out -d hw:SB.

Thanx

--nixIT
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: audio crackling in duplex mode

Post by Pablo »

Misc tab
--enable d-bus interface checked
--enable jack d-bus interface checked
--stop jack audio server on app exit checked
I have the same settings.
zita-j2a -d hw:SB -c 6 -r 48000 & (this works when pulse is not installed)
OK.
When pulse is installed zita-j2a does not load
Sigh.
So I remove the zita-j2a line when I install pulse.
But then it is normal that ardour and audacity's jack outputs don't work. You simply can't connect any jack audio output to the SB card if zita-j2a is not running.

If you install pulseaudio, start jackdbus via qjakctl without the zita-j2a command in the scripts to execute, then open pavucontrol and configure pulseaudio output to the jack sink, and after that try executing the zita-j2a command in a terminal, does zita-j2a start?

If it starts, you will probably have to manually connect (I mean jack audio virtual connections in the connect window of qjackctl) the pulseaudio jack sink ports to the SB playback ports (which are in that place thanks to zita-j2a and nothing else). Then, both desktop applications and audio production applications will make sound (assuming you also connect ardour's master or whatever to the same SB playback ports, of course).

If zita-j2a doesn't start following that sequence of instructions, does alsa_out start if you follow the same sequence?
Last edited by Pablo on Thu Jul 12, 2018 10:59 pm, edited 1 time in total.
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: audio crackling in duplex mode

Post by Pablo »

since zita-j2a and alsa_out both work correctly when pulseaudio is not installed, is there a pacmd or pactl command that is equivalent to either zita-j2a -d hw:SB or alsa_out -d hw:SB.
pacmd and pactl are pulseaudio utilities so they can't be used if pulseaudio is not up and running.
nixit
Established Member
Posts: 26
Joined: Fri Jun 30, 2017 2:11 pm

Re: audio crackling in duplex mode

Post by nixit »

If you install pulseaudio, start jackdbus via qjakctl without the zita-j2a command in the scripts to execute, then open pavucontrol and configure pulseaudio output to the jack sink, and after that try executing the zita-j2a command in a terminal, does zita-j2a start?
That would be a negative, I get the following:

Code: Select all

$ zita-j2a -d hw:SB
Can't open ALSA playback device 'hw:SB'.
same thing for alsa_out.

in pavucontrol/output devices tab lists the jack sink (pulseaudio jack sink),
nixit
Established Member
Posts: 26
Joined: Fri Jun 30, 2017 2:11 pm

Re: audio crackling in duplex mode

Post by nixit »

@pablo & @jack winter

I REALLY appreciate the help you two are giving me. I'm sure we can figure this out. let me know what other info I haven't provided that I can, or if I should consolidate everything I've tried into one post for easy reference.

--nixIT
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: audio crackling in duplex mode

Post by Pablo »

That would be a negative, I get the following:

Code: Select all

$ zita-j2a -d hw:SB
Can't open ALSA playback device 'hw:SB'.
I guess that pulseaudio owns the hw:SB and it doesn't allow zita-j2a to grab it. However, it should allow jackdbus to grab it, I hope.

So, I suggest you try the following: with pulseaudio running, run jackdbus on the hw:SB (qjackctl: interface SB,maybe in playback only mode) and then use "zita-a2j -d hw:USB" (not "j2a") to get the capture ports of your Scarlett.
nixit
Established Member
Posts: 26
Joined: Fri Jun 30, 2017 2:11 pm

Re: audio crackling in duplex mode

Post by nixit »

After another late trying trying many things, I *think* I got it nailed down. After going through every document, wiki, blog post on how to set up pulse/jack and confirming the steps I tried. I started mixing and matching, figuring it couldn't hurt.

And I finally found one that allowed me to capture from hw:USB and playback through hw:SB, the solution for me was:

Qjackctl-->Setup-->Options

Execute Script on Startup:

Code: Select all

pacmd suspend true
Execute script after startup:

Code: Select all

zita-j2a -d hw:SB -c 6 -r 48000 &
Execute script after shutdown:

Code: Select all

pacmd suspend false
This allows me to achieve the results I've been after.

At one point I even tried the scripts in this thread on the arch wiki located here: https://wiki.archlinux.org/index.php/Pu ... ipt_method

yet those scripts didn't work.

I am finally glad this is working, and I THANK YOU @pablo and @Jack Winter for helping me out.

marking solved

--nixIT
Jack Winter
Established Member
Posts: 381
Joined: Sun May 28, 2017 3:52 pm

Re: [SOLVED] audio crackling in duplex mode

Post by Jack Winter »

I'm happy you got it working, and sorry for the bad advice on how to interact with pulseaudio, I know a bit about JACK though :)

I don't know pulseaudio well, I just load the modules after I've started JACK1 and it works. Your case is a bit different.

I just tried your solution and was amazed that after "pacmd suspend true", the pulseaudio to JACK module still worked. As I understand it, you have implemented the right solution for what you wanted to do.
Reaper/KDE/Archlinux. i7-2600k/16GB + i7-4700HQ/16GB, RME Multiface/Babyface, Behringer X32, WA273-EQ, 2 x WA-412, ADL-600, Tegeler TRC, etc 8) For REAPER on Linux information: https://wiki.cockos.com/wiki/index.php/REAPER_for_Linux
Pablo
Established Member
Posts: 1274
Joined: Thu Apr 17, 2008 9:57 pm
Been thanked: 3 times

Re: [SOLVED] audio crackling in duplex mode

Post by Pablo »

I am also very glad you got it working! :D Very good solution!
Post Reply