Re: [linux-audio-user] US428 Channels 3 and 4

From: Rui Nuno Capela <rncbc@email-addr-hidden>
Date: Tue Feb 22 2005 - 11:27:21 EET

Hi Karsten,

> Am Montag 21 Februar 2005 18:09 schrieb Rui Nuno Capela:
>>
>> I took a quick look into Karsten's original jackd usx2y_driver code
>> and...
>> I'm affraid that the number of channels were being hardcoded as 2 for
>> capture and 2 for playback.
>>
>> OTOH already in the current jack CVS trunk, the number of channels are
>> either given on the jackd command line (-i,-o) or taken from the maximum
>> allowed by the ALSA driver (via snd_pcm_hw_params_get_channels_max()).
>> Maybe its around here where the issue is? Karsten?
>>
>> I could also check that the jackd usx2y specific code has support for no
>> more than 4 capture and 2 playback channels.
>>
> yes , us428 has 4 ins & 2 outs. to make it work with latest jack alsa
> driver, you have to hardcode 2 in channels in
jack/drivers/alsa/alsa_driver.c like
> this:
>
>>>>>>>>
> --- alsa_driver.c.~1.65.~ 2005-02-22 01:15:07.000000000 +0100
> +++ alsa_driver.c 2005-02-22 01:16:32.000000000 +0100
> @@ -450,7 +450,7 @@
> }
>
> if ((err = snd_pcm_hw_params_set_channels (handle, hw_params,
> - *nchns)) < 0) {
> + 2 /* *nchns*/)) < 0) {
> jack_error ("ALSA: cannot set channel count to %u for %s",
> *nchns, stream_name);
> return -1;
> <<<<<<<
>
> confusing, no? (even annoying, if you also use other cards with more than
> 2 in channels...)
> its because the alsa layer doesn't correctly know about us428's channels 3
> + 4.

I maybe missing something, but is this hack really necessary? Isn't this
equivalent as issuing the jackd command line explicitly with -i2
(--inchannels=2) ?

The default (0) just asks jackd to set the maximum number of channels as
read from the alsa layer, as read from
snd_pcm_hw_params_get_channels_max(). Again, I think is here where the
issue lies: if I'm not teelling you a gross mistake, snd-usb-usx2y should
be hinting here the correct values, either from the US-122, US-224 (mine)
or US-428 (the only one capable of 4 input channels?), whatever is
actually plugged-in.

> in raw-usb mode some standard parts of alsa pcm are bypassed, and so
> currently you can only use
> us428's 4 in channels with the above hack.

Surely it's confusing, but you should/must know it better :)

> will make the above hack obsolete hopefully before spring;-)
>

Take care. Spring its only one moth away ;)

Cheers.

-- 
rncbc aka Rui Nuno Capela
rncbc@email-addr-hidden
Received on Tue Feb 22 12:15:18 2005

This archive was generated by hypermail 2.1.8 : Tue Feb 22 2005 - 12:15:19 EET