Author Topic: Jack multichannel - setting alsa to use more than one system capture/playback  (Read 5894 times)

Offline LinuxWay

  • Newbie
  • *
  • Posts: 4
Hi. Before I start, forgive me for any grammatical error. I can well understand, but not write well in English. Ok, let's go.

I use Ubuntu 9.04 and Debian Lenny. I'm a linux user since 2007.

I've tried without success, using jackd and through qjacktl interface, use the default capture of my notebook (VAIO VGN NW 130J, microfone entrance) combined with a microfone of the USB sound card. The qjacktl interface returns me only the system microfone capture and the default playback. I would like to use both of them, to be abble to use separated audio software treatment via Jamin, Creox, Jack-Rack etc, and separately get audio signal from each card.

The USB Audio Card is one of this: http://produto.mercadolivre.com.br/MLB-138390607-placa-de-som-usb-51-pronta-entrega-no-brasil-frete-barrato-_JM

What information I've already got:

http://www.vivaolinux.com.br/artigo/Som-multicanal-(surround)-no-Linux/?pagina=1
http://www.cse.ohio-state.edu/~bondhugu/alsamch.shtml
http://azulebanana.com/bluey/tag/jackd/
http://ccrma-mail.stanford.edu/pipermail/planetccrma/2006-July/012213.html

I've read those links a lot. I guess I've lost some important thing about the configuration. If I'm not wrong, ALSA will create a virtual drive that includes both cards. This appears sort of obscure to me.

What I've already tried:

First, I did:

applay -l

Obtaining these lines below:

**** List of PLAYBACK Hardware Devices ****
I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
I: caps.c: Dropping root privileges.
I: caps.c: Limited capabilities successfully to CAP_SYS_NICE.
card 0: Intel [HDA Intel], device 0: ALC262 Analog [ALC262 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: default [USB AUDIO ], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0

Then, I created the .asoundrc in my /home/user, with these entries:

# **********************************

pcm.multi_capture {
type multi;
slaves.a.pcm "hw:0,0";
slaves.a.channels 2;
slaves.b.pcm "hw:1,0";
slaves.b.channels 2;

bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;

bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b;
bindings.3.channel 1;
}

ctl.multi_capture {
type hw;
card 0;
}

pcm.multi_playback {
type multi;
slaves.a.pcm "hw:0,0";
slaves.a.channels 2;
slaves.b.pcm "hw:1,0";
slaves.b.channels 2

bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
bindings.3.slave b
bindings.3.channel 1
}

ctl.multi_playback {
type hw;
card 0;

# **********************************

Finally, I started the jack (after reload alsa/reboot system) as normal user with:

jackd -d alsa -C multi_capture -P multi_playback

Unfortunately, I got this error message:

JACK compiled with System V SHM support.
loading driver ..
creating alsa driver ... multi_playback|multi_capture|1024|2|48000|0|0|nomo n|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: no playback configurations available (Invalid argument)
ALSA: cannot configure capture channel
cannot load driver module alsa

Using the combination jackd + Jack-Rack, for example, with a simple

jackd -d alsa -p 512 -r 96000

under a Real Time Kernel, I obtained good results (in terms of latency - 10.7 ms and a few xruns) to use that in live audio treatment, just like Shows and general events.
But this do not allow me individual audio signal treatment: The voice signal of microfones deserves some echo and equalization. For the guittars, I want to equalize them separately. The same as the bass and keyboards (just examples).

Sooner or later, I will get a Delta 1010 sound card or something like, but I want to know how to configure alsa; also, for personnal understanding.

Thanks for any help.
« Last Edit: March 31, 2010, 12:07:53 AM by LinuxWay »

Ubuntu Forums (Ubuntu Linux Support)


Offline joe12

  • Sr. Member
  • ****
  • Posts: 449
hi
-first find out if Ubuntu has found your USB sound card by opening up the Terminal and type :
Code: [Select]
sudo  lsusb

- you can tell what to use by going to System , preferences , open sound ! before you change the in/out put  click hardware and chose which one you wan t to configure .

hope it helps

Offline LinuxWay

  • Newbie
  • *
  • Posts: 4
Thanks for the help.

Yes, I've tried that before. The USB sound card is correctly recognized and work fine, but it's necessary to choose it instead the default capture. In other words, it's the same when using the default capture. Just one stereo channel capture, and so playback.

Also, I'm testing a clean instalation of Ubuntu with a real time kernel. The results are great, I can use my notebook instead the traditional equalizer, with the obviously vantage of ladspa plugins. I think about buy a Delta 1010 for my PC and use it, but will be necessary to configure the .asoundrc for the multiple inputs of the sound card.

Offline joe12

  • Sr. Member
  • ****
  • Posts: 449
Hi
The Delta 1010 look's very good  then you  not need to play with 2 sound card's  . !  i would think that Ubuntu find& use the  multiple inputs, you will just have to play around .

Offline LinuxWay

  • Newbie
  • *
  • Posts: 4
Hi, people. Thank for the help.

I found this: http://alsa-project.org/main/index.php/Asoundrc#Virtual_multi_channel_devices

This is the link to the ALSA project, and it could explain more effectively the .asoundrc. What happens is that it's possible to create this virtual drive that I've said. The advantage is that we can customize the sound features (start the jack with xxxxxx sample rate etc). In the alsa project we have some examples.

Also, it's possible combine 2, 3 or more sound cards to multiply the audio connection and set the definitions. For example, with the virtual drive, we can create a mini-drive with just 4 in/out, even with the Delta 1010, and ignore the rest.

About the in/out recognizing in the Delta1010, I think the ALSA will not allow me to use every in/out without configure .asoundrc, at least from what I read. Check http://www.jrigg.co.uk/linuxaudio/ice1712multi.html for more details (english, finally!)

I am really trying to understand the configurations, but I'm having the same message:

ALSA: no playback configurations available (Invalid argument)
ALSA: cannot configure capture channel
cannot load driver module alsa


Probably my poor English... who knows...

In fact, Ubuntu is the perfect platform for audio treatment. It's amazing what we can do with a real time kernel and some open source apps. I cannot find, in Windows, application that allow me to do what I do in Linux (Ubuntu, mostly) without a powerfull hardware. I'm writting a how-to about real time audio treatment and equalization. A deserved contribution for the community that has always provided me knowledge. If I succed to configure the asoundrc, my how-to will be finished (also, my project). I'm working in the English version too...
« Last Edit: March 31, 2010, 02:31:56 PM by LinuxWay »

Offline joe12

  • Sr. Member
  • ****
  • Posts: 449
hi

"About the in/out recognizing in the Delta1010, I think the ALSA will not allow me to use every in/out without configure .asoundrc,"

you could see is if it's work with out being being  config , so long as you tell ubuntu to use the Delta ??
 

Offline LinuxWay

  • Newbie
  • *
  • Posts: 4
Hi people.

Excuse-me joe12, I'm not sure if I understood this last phrase: "so long as you tell ubuntu to use the Delta ??".

About to use every inputs and outputs, the recognizing is not automatically, according what I read in these links above. But I'm not sure, I've not tested yet, since I don't have a Delta1010.

In any case, I want to learn how to configure it for the case of multiple sound cards, and in this case, for a USB sound card. In fact, a lot of USB sound cards. It will be usefull for the Delta1010 too, because it's necessary to edit the .asoundrc.
« Last Edit: March 31, 2010, 02:26:17 PM by LinuxWay »

Offline joe12

  • Sr. Member
  • ****
  • Posts: 449
Hi

igore that bit ,i mean  so long as ubuntu finds it. it will anway


Offline lennart

  • Newbie
  • *
  • Posts: 1
I know what your problem is, and I'm sure of that because I want to do exactly the same: multiple USB soundcards on ALSA. :)

I think the main problem is the channel number you set on pcm.multi_capture. I don't know if you're aware of this information, but this USB soundcard you have (which I have a similar one) is STEREO output and MONO input, meaning that it has dual-channel playback and ONLY single-channel recording.

PM me if you had advanced or still have interest in this specific topic. I am working on a university project that is leading me to this same multiple USB soundcards issue.