You are not logged in.

#1 2018-07-06 18:25:23

nixIT
Member
Registered: 2010-01-13
Posts: 407

[SOLVED] pulseaudio jack and 2 audio cards

I am building a new rig and want to build it for voice over.

I posted a question here: https://linuxmusicians.com/viewtopic.php?f=27&t=18694

EDIT:

I've followed the steps in the wiki to setup alsa (alsa only works), pulse (pulse only works) and jack, and even followed the steps in the wiki to set up pulse and jack.

My audio interfaces:

$ cat /proc/asound/cards
0 [SB             ]: HDA-Intel - HDA ATI SB
                      HDA ATI SB at 0xfe300000 irq 16
 1 [NVidia         ]: HDA-Intel - HDA NVidia
                      HDA NVidia at 0xfe080000 irq 46
 2 [USB            ]: USB-Audio - Scarlett 2i2 USB
                      Focusrite Scarlett 2i2 USB at usb-0000:00:12.2-2.4.4.4, high speed

My end goal would be to use hw:SB for playback (via pulse) and hw:USB for capture (via jack). I know I can run qjackctl with the device set to capture, however, when I want to edit my recording I have to save and quit my audio application then either 1) stop qjackctl and put it in playback mode then relaunch audio app to edit and then go back to capture if I need to re-record something, or quit qjackctl and stop jack2dbus. This is time consuming and would be a PITA if I had to re-record items.

Is it possible to set the system up this way?

If the answer is yes, I can post the indepth steps I've taken to try an achieve this to see where I'm going wrong.

I know that's not much to go on, but it will save me much typing if that answer is "no, not possible". smile

Thanx

--nixIT

Last edited by nixIT (2018-07-14 03:40:56)


ASRock 970 Extreme4  | AMD FX 8350 | 32GB G.SKILL Ripjaw X  | 180GB Corsair Force Series GS SSD | MSI GeForce GTX 960 GTX Gaming 4G 4GB

Offline

#2 2018-07-07 09:57:38

ooo
Member
Registered: 2013-04-10
Posts: 1,517

Re: [SOLVED] pulseaudio jack and 2 audio cards

I'm not sure if I understand your question, or what exactly you're trying to achieve. I think the question is, whether it's possible to switch between pulseaudio and jack without restarting your recording application and stopping jack server. Yet you didn't tell what application you're using for recording.

Have you tried using both devices with jack, for playback and capture respectively? The fourth method would probably be the simplest, and 'jack_control dps {capture,playback}' should work equivalently with jackdbus. If I understood your use case correctly, I don't the clock drift between different sound cards would cause problems either.

Offline

#3 2018-07-07 16:50:44

nixIT
Member
Registered: 2010-01-13
Posts: 407

Re: [SOLVED] pulseaudio jack and 2 audio cards

@OOO

Thanx for responding. I use Audacity and Ardour for my recording and editing, and whenever I stop/start the jack server, I need to restart the app b/c the connection is lost.

I have pulseaudio-jack installed, and I can see the sink and source getting set within the Connections window of qjackctl.

Within qjackctl, I have tried with the following:

Audio: Duplex
output: hw:SB
input: hw:USB

If I understand that correctly, that should be the same as using the -C -P in the link you provided. with this configuration, I get constant xruns, and according to a reply on Linuxmusicians.com, they said this could be because I am using two different audio cards, one for input and one for output and their timing can't be synced..  Should I be concerned with this this I am only concerned with recording from hw:USB?

when I launch audacity, I select:

JACK Audio Connection Kit (not alsa)
mic: PulseAudio JACK SINK
speaker: PulseAudio JACK Source

This is where it's interesting, when I launch PA Volume Control under input devices I have PulseAudio JACK Source and under output devices I have PulseAudio JACK Sink, the opposite of what Audacity says.

Could this be why I can't record and or playback with Audacity with these settings?

I initially installed Pulse, Jack Qjackctl via the arch wiki, and things didn't work, so I spent the next several days searching the net and trial and error to still produce nothing.

My end goal would be to use the hw:USB as my input 100% of the time and hw:SB for output 100% of the time, all while using Jack for the audio recording. is there a way to have jack only take control of one device?

If I have to completely remove pulse and jack including configs to get this setup correct, I'm ok to do that.

Any guidance is appreciated.

--nixIT


ASRock 970 Extreme4  | AMD FX 8350 | 32GB G.SKILL Ripjaw X  | 180GB Corsair Force Series GS SSD | MSI GeForce GTX 960 GTX Gaming 4G 4GB

Offline

#4 2018-07-08 09:26:11

ooo
Member
Registered: 2013-04-10
Posts: 1,517

Re: [SOLVED] pulseaudio jack and 2 audio cards

nixIT wrote:

I use Audacity and Ardour for my recording and editing, and whenever I stop/start the jack server, I need to restart the app b/c the connection is lost.

I'd imagine you should be able to prevent restarting the application, by simply switching the audio backend between jack and ALSA in applications' preferences.

Within qjackctl, I have tried with the following:

Audio: Duplex
output: hw:SB
input: hw:USB

If I understand that correctly, that should be the same as using the -C -P in the link you provided. with this configuration, I get constant xruns,

There should be a gap in the recording every time you get a xrun. You could try if increasing frames per period size to reduce xruns, if some extra latency doesn't matter.

when I launch audacity, I select:

JACK Audio Connection Kit (not alsa)
mic: PulseAudio JACK SINK
speaker: PulseAudio JACK Source

This is where it's interesting, when I launch PA Volume Control under input devices I have PulseAudio JACK Source and under output devices I have PulseAudio JACK Sink, the opposite of what Audacity says.

That sounds correct. Pulseaudio is getting input from audacity's output via jack source, and outputting to jack via jack sink.

is there a way to have jack only take control of one device?

If you set up jack to only use one device, it will only take control of that device. Although, If you're only using jack to record from single device, and don't need it's routing capabilities, it seems like an unnecessary extra layer on your setup.

If you don't need pulseaudio, and have no specific reason to use jack, I'd try removing those and use ALSA only setup. There should be no issues using two soundcards, but there's some chance you encounter some other issues/difficulties depending on your workflow and setup.

Offline

#5 2018-07-08 15:30:54

nixIT
Member
Registered: 2010-01-13
Posts: 407

Re: [SOLVED] pulseaudio jack and 2 audio cards

@OOO

Thanx for the info. After completely removing pulse and getting my system back to basic alsa and jack. I reinstalled pulse by following the arch linux wiki and also installed zita-ajbridge, then I set qjackctl up with the following:

Audio: Playback only
interface: hw:SB
server prefix: jack_control start
Execute script after start: zita-a2j -d hw:USB -r 48000 &

This allows my audio to be played as well as bridging in my mic for recording. best part is, ran some tests and no xruns!  WOOT!

question on the zita-ajbridge, when I issue the zita-a2j does that just do a passthru to my mic, or does that bridge my mic into jack and let jack control it?

As a test, I wanted to reverse the scene:
Audio: capture only
interface: hw:USB
server prefix: jack_control start
Execute script after start: zita-j2a -d hw:SB -r 48000 &

I appear to be able to record, but I don't get any audio out, and am curious why.

I will run a couple more tests with the playback setting from above to see if all works how I need it to. excited to finally have this resolved.

thanx for your help

--nixIT


ASRock 970 Extreme4  | AMD FX 8350 | 32GB G.SKILL Ripjaw X  | 180GB Corsair Force Series GS SSD | MSI GeForce GTX 960 GTX Gaming 4G 4GB

Offline

#6 2018-07-14 03:40:23

nixIT
Member
Registered: 2010-01-13
Posts: 407

Re: [SOLVED] pulseaudio jack and 2 audio cards

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:

pacmd suspend true

Execute script after startup:

zita-j2a -d hw:SB -c 6 -r 48000 &

Execute script after shutdown:

pacmd suspend false

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

marking thread as solved.


ASRock 970 Extreme4  | AMD FX 8350 | 32GB G.SKILL Ripjaw X  | 180GB Corsair Force Series GS SSD | MSI GeForce GTX 960 GTX Gaming 4G 4GB

Offline

Board footer

Powered by FluxBB