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

From: Karsten Wiese <annabellesgarden@email-addr-hidden>
Date: Tue Feb 22 2005 - 02:45:27 EET

Am Montag 21 Februar 2005 18:09 schrieb Rui Nuno Capela:
> Spencer Russell wrote:
> > The US428 has 4 capture channels and 2 playback channels. Capture
> > channels 3 and 4 are switchable between analog and digital. The
> > button to switch doesn't seem to do anything, though.
> >
> > -spencer
> >
> > On Mon, Feb 21, 2005 at 09:05:32AM +0000, Rui Nuno Capela wrote:
> >>
> >> BTW, shouldn't the US-428 have 8 playback channels, the US-224 have 4,
> >> and finally 2 for US-122?
> >>
>
> 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.
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.
It works only, if you call jackd like this:
$jackd -dalsa -dhw:n,2
with n being the us428 alsa card nr.
You have to use latest snd-usb-usx2y, which is already in kernel >= 2.6.11-rc3 .
and it only works with jack. plain alsa only knows us428's first 2 channels.
beware of calling jackd with -dhw:n,1! it can crash your machine as i just experienced.
digital in doesn't yet work.
will make the above hack obsolete hopefully before spring;-)

best regards,
Karsten
Received on Tue Feb 22 04:15:14 2005

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