User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Managing multiple sound systems

Thu Jan 11, 2018 1:05 am

I bought an external USB sound card (StarTech ICUSBAUDIO7D) because I wanted to use a Pi as a remote recording device with a couple of electret mic cartridges. Haven't tried that yet. Meanwhile I got an electric guitar again, and looking in Synaptic found Rakarrack, a guitar effects processor. And GTick, a metronome written in software.

Now GTick apparently only does Pulseaudio or OSS. Rakarrack seems to only use Jack. How do I I get Rakarrack to see my guitar, the output of Gtick to come out my USB sound card's outputs along with output from Rakarrack?

Rakarrack knows:
rakarrack.png
rakarrack.png (32.38 KiB) Viewed 867 times
Qjackctl knows:
qjackctl.png
qjackctl.png (50 KiB) Viewed 867 times

All I know is that I can get output from omxplayer by specifying omxplayer -o alsa:hw:1,0 to get to the USB card. I assume I need to do most of the configuration through Qjackctl, but maybe I go back through Alsa somehow since I can at least specify the hw:1 there to get to the USB soundcard. I plug my guitar into the USB card and Rakarrack doesn't see it, I can run Gtick and listen on headphones plugged into the USB soundcard and not hear anything.

tvjon
Posts: 617
Joined: Mon Jan 07, 2013 9:11 am

Re: Managing multiple sound systems

Thu Jan 11, 2018 9:11 pm

We have lift off :)

It has some problems though.

I tried it initially on Jessie, but no visible input as per your picture. I think now it might work though so if I get time, I'll retry it.

I also had a midi keyboard plugged in, but decided too many variables, so removed it.

Next popped in a Stretch µSD card, & this time an input appeared.

The main issue appears to be configuring jack(2). jack1 was installed on jessie but useless as it just produced bus error, so I replaced it.

The only guitar here has no strings currently, so I tested with a lapel microphone plugged into a CM-108 usb card.

Stretch doesn't seem to want to let go of this audio card, as to reboot or shutdown I need to remove it, & sometimes pull the power plug.

I crashed rakarrack a few times by quickly changing effects. It's worth pursuing however, as there are some useful effects, even for microphone.

Incidentally it might be worth your while testing with your mic', as it's a tad more convenient when making numerous changes.

The (jack) settings you can see on the screenshot were the only ones I could get to work after much trial & ERROR, so maybe you have similar layout with your Startech card?

Good luck!
jessierak.jpg
jessierak.jpg (61.1 KiB) Viewed 825 times
stretchrak.jpg
stretchrak.jpg (64.18 KiB) Viewed 825 times

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Managing multiple sound systems

Thu Jan 11, 2018 10:05 pm

Hmm, what do you mean by jack(2)? I didn't know there were 2 versions around but I see at http://www.jackaudio.org/downloads/ that there's a JACK 0.125.0. and a JACK 1.9.12. I have:

ii dssi-host-jack 1.1.1~dfsg0-1 armhf Example of DSSI host
ii jack-mixer 10-1+b1 armhf JACK Audio Mixer
ii jack-tools 20131226-1 armhf various JACK tools: dl, record, scope, osc, plumbing, udp, play, transport
ii jackd 5 all JACK Audio Connection Kit (default server package)
ii jackd2 1.9.10+20140719git3eb0ae6a~dfsg-2 armhf JACK Audio Connection Kit (server and example clients)
ii jackeq 0.5.9-2 armhf routes and manipulates audio from/to multiple sources
ii libjack-jackd2-0:armhf 1.9.10+20140719git3eb0ae6a~dfsg-2 armhf JACK Audio Connection Kit (libraries)
ii libjack-jackd2-dev:armhf 1.9.10+20140719git3eb0ae6a~dfsg-2 armhf JACK Audio Connection Kit (development files)
ii projectm-jack 2.1.0+dfsg-1+b7 armhf projectM JackAudio module
ii pulseaudio-module-jack 5.0-13 armhf jackd modules for PulseAudio sound server
ii qjackctl 0.3.12-1 armhf User interface for controlling the JACK sound server

Under Jessie. I don't know a lot about Jack, seems like a nice idea but I've rarely gotten it to work. This is a convoluted box running off a USB hard drive, not an SD card. I'd be tempted to uninstall the jack from debs and build from source tarballs. Somewhat understandably the debs can be years behind. Yeah, my jack tools looks like it's from 2013.

Did you use the Add button in the patch bay to add stuff or did it just detect everything so it showed up?

tvjon
Posts: 617
Joined: Mon Jan 07, 2013 9:11 am

Re: Managing multiple sound systems

Thu Jan 11, 2018 10:44 pm

ab1jx wrote:
Thu Jan 11, 2018 10:05 pm
Hmm, what do you mean by jack(2)? ...

Did you use the Add button in the patch bay to add stuff or did it just detect everything so it showed up?

Install:

synaptic

then search it for jack.

Initially yes, but that was a red herring, so don't do it.

You need to make your Startech the default audio device via this menu, then it'll appear in the jack2 list. Next you connect the relevant imputs to outputs as per my previous screenshot.

synaptic.jpg
synaptic.jpg (52.66 KiB) Viewed 813 times

audio-settings.jpg
audio-settings.jpg (24.09 KiB) Viewed 813 times

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Managing multiple sound systems

Fri Jan 12, 2018 12:54 am

Oops, I wasn't doing the menu thing before, but it didn't help. I think the ALSA driver in Jack isn't looking at the ALSA config file (~/.asoundrc) where I set my default sound card to be the USB. It's still using hw:0 instead of hw:1.

The preferences now look like:
guiconfig.png
guiconfig.png (42.4 KiB) Viewed 801 times
alsamixergui looks like
alsamixergui.png
alsamixergui.png (19.87 KiB) Viewed 801 times
But my Jack patch bay still looks like
qjackctl.png
qjackctl.png (164.12 KiB) Viewed 801 times

I found there's a ~/.jackdrc which by default says -dalsa -dhw:0 and tried changing that to hw:1 but that didn't seem to make any difference. In ~/.asoundrc is where I set the default device to be 1 (the USB) instead of 0, I think that's what is responsible for the USB card's setting showing in alsamixergui.

Oh, this is a useful page to know about of Jack applications with links http://www.jackaudio.org/applications/. I had to build Jack, qjackctl and rakarrack from sources but at least I know they're up to date. No major problems, I had to do an ldconfig on /usr/local/lib afterward before it would find a jack library, that was about it.

Hmm, the solution's probably here http://www.jackaudio.org/faq/multiple_devices.html but I'm getting hungry. See the man pages for alsa_in and alsa_out.

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Managing multiple sound systems

Fri Jan 12, 2018 2:18 am

I eventually got to something like this:
patchbay.png
patchbay.png (51.19 KiB) Viewed 787 times
but the only thing I've heard out of it so far is noise.

alsa_in and alsa_out are simple command line programs which will read or write ALSA sound on one end and jack on the other end. You start them with a command line argument like alsa_in -d hw:1. Each has to run in its own terminal window and it has to stay open all the time you're using hw:1 with jack. That's my understanding anyway, but then I also haven't got it working yet either. Quitting for tonight probably. There was another guitar effects program in that list of Jack programs, I don't know if it's as cumbersome to use.

tvjon
Posts: 617
Joined: Mon Jan 07, 2013 9:11 am

Re: Managing multiple sound systems

Fri Jan 12, 2018 10:37 am

I don't go anywhere near ~./asoundrc

Anyway your Audio device Settings look fine now.

You still have no mention of

rakarrack

in your jack pic's. Reasonably enough, Jack must have knowledge of it or it won't work.

In the attached screenshot, notice in Jack's Settings panel that I've set the Output & Input devices to focus on my C-media usb card.

In a console window run

qjackctl

Then start up:

rakarrack

from either a console or the Sound & Video menu popdown.

What do you then see when you press:

Connect

from the Jack window, for the alsa & audio sub panels?


I haven't needed to do any of that lot in your last but one post, but I'll read through your posts again later, & see if I can reproduce your setup.

So far, apart from the occasional wobbles (which seem to depend on whether jack likes the sound card or not), I haven't found rakarrack to be cumbersome at all, rather, in fact, quite responsive.

I now have a reasonable Darth Vader® voice changer :)
rakarrack.jpg
rakarrack.jpg (64.24 KiB) Viewed 767 times

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Managing multiple sound systems

Fri Jan 12, 2018 3:28 pm

Oh, ~./asoundrc is very useful. It was the first thing I changed weeks ago, it's how simpler programs know to feed audio through the USB sound. Because the USB sound card won't always be plugged into this Pi, and I haven't seen any sign yet that anything's smart enough to default to hw:0 if hw:1 isn't present. So it has to be switched manually and the fewer places the better. A year from now or whenever I'm not likely to remember this stuff.

This morning I started up qjackctl then rakarrack, hit Connect instead of going into the patch panel and it looks like:
audio_patch2.png
audio_patch2.png (38.5 KiB) Viewed 751 times
and
alsa_patch.png
alsa_patch.png (30.67 KiB) Viewed 758 times
Haven't physically plugged everything in yet, don't know if it actually does anything or not. Interesting, alsa_in and alsa_out may get started automatically, which is certainly less cumbersome than having 2 more windows that have to be on the desktop.

I found last night that what it was calling an input or output didn't always seem right. Ultimately I want to get to the USB card's headphone jack, that doesn't show up anywhere in these diagrams. I hadn't used the Connect button before, it must automatically match inputs and outputs, the patchbay is for manual fiddling The patchbay still looks the same.

Rakarrack 6.1 comes with a bunch more "banks", in fact 3 screens full.
rakarrack_6.1_banks.png
rakarrack_6.1_banks.png (52.12 KiB) Viewed 758 times
Question: do in_1 and in_2, out_1 and out_2, playback_1 and playback_2 refer to channels, like left and right or do they mean something else? Wow, and I'm not even looking at MIDI, you could jam with a bunch of MIDI tracks as backup.

tvjon
Posts: 617
Joined: Mon Jan 07, 2013 9:11 am

Re: Managing multiple sound systems

Fri Jan 12, 2018 10:22 pm

"it must automatically match inputs and outputs"

It (usually) finds them but may not get the connecting "wires" right, hence you need to select something lin the left & right panels & click connect. Next name & save the file to storage.

"do in_1 and in_2, out_1 and out_2, playback_1 and playback_2 refer to channels, like left and right...?"

From my testing so far, that appears to be the case, yes.

"Wow, and I'm not even looking at MIDI, you could jam with a bunch of MIDI tracks as backup"

Yes, it's versatile, but not 100% reliable with my cheap sound card yet. Hopefully your Startech will play nicely with jack.
You can make your own filters & create your own user bank.

I was going to try a M-audio Fast track today, but can't find my box of XLR 3 pin plugs. I may as well order one, then it'll turn up :)

I built the rakarrack source code too, which didn't take long on RPi3. Amazingly I already had all the dependencies installed.

Apparently there's a successor to qjackctl - Cadence, but it's not showing in Synaptic, & its source looks very X86 instruction set orientated.

User avatar
ab1jx
Posts: 636
Joined: Thu Sep 26, 2013 1:54 pm
Location: Heath, MA USA
Contact: Website

Re: Managing multiple sound systems

Sat Jan 13, 2018 1:13 am

Try https://www.allelectronics.com/category ... ike/1.html for XLRs, but they're Chinese, the quality varies. I've bought a lot of other stuff there, not XLRs.

I bought a $2 sound card on Aliexpress and it actually works. I got the StarTech because I wanted real microphone inputs, not line ins. It has both.

There are 13 "control applications" listed at http://www.jackaudio.org/applications/, Cadence is one of them.

What I don't get is why it doesn't enumerate the inputs and outputs on my sound card. I want to connect my guitar to the StarTech's mic 1 or 2 connector, through rakarrack, then probably back to an input, then to maybe speaker or headphone out. Alsamixergui can read that I have those input and outputs. Maybe it's just an inadequacy in Qjackctl, I should try something else. I still don't see how to get to my guitar.

I did a little sound programming once in OpenBSD and there was a way to discover devices, I think it was a linked list. You just kept going until you hit the end, reading descriptions, etc. as you found them.

tvjon
Posts: 617
Joined: Mon Jan 07, 2013 9:11 am

Re: Managing multiple sound systems

Sat Jan 13, 2018 5:36 pm

Thank you for the URL's.

Your guiconfig.pic doesn't show the capture tab contents. Is the red dot enabled on it?

Also your headphone output is probably 2 of the 8 Speaker outputs on that pic.

Looked up your Startech which has mic imputs but no guitar, so how are you connecting it?

Did you try feeding mic to rakarrack, as I've done for my tests?

Any audio will do for a test.

You have to have (system) capture_n (your mic') connected to kararrack's in_1 or whichever you're using in jack.

BTW, as a test I removed

~/.asoundrc

& kararrack still works.

Return to “Graphics, sound and multimedia”

Who is online

Users browsing this forum: No registered users and 8 guests