Am Donnerstag, 4. Dezember 2003 23:46 schrieb Martin Langer:
> On Thu, Dec 04, 2003 at 11:02:14PM +0100, Karsten Wiese wrote:
> > Am Donnerstag, 4. Dezember 2003 20:30 schrieb Martin Langer:
> > > Karsten, your us428 fix breaks us122 support.
> > > usX2Y_rate_set(usX2Y_stream, 44100)) isn't possible on us122.
> >
> > usX2Y_rate_set() is being called when you start audio also.
> > So audio stops working on the us122 with this patch?
> > Would it work with 48000 instead of 44100?
>
> no success with both frequencies. it produces the same error:
> ALSA usX2Yhwdep.c:315: snd_us428_create_alsa_devices error -19
>
> I guess we have to check the device id here and allow this only in case of
> ID=8001.
>

The attached patch against CVS-HEAD does that.
Please try it. If us122 works again, ask Jaroslav to commit it, as Takashi is 
on vacation.

Best,
Karsten
Index: alsa-driver/usb/usx2y/usbusx2yaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/usb/usx2y/usbusx2yaudio.c,v
retrieving revision 1.3
diff -u -r1.3 usbusx2yaudio.c
--- alsa-driver/usb/usx2y/usbusx2yaudio.c	2 Dec 2003 10:15:02 -0000	1.3
+++ alsa-driver/usb/usx2y/usbusx2yaudio.c	4 Dec 2003 23:24:00 -0000
@@ -1224,9 +1224,12 @@
 
 	sprintf(pcm->name, NAME_ALLCAPS" Audio #%d", usX2Y(card)->chip.pcm_devs);
 
-	if (0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream,  64*1024, 128*1024, GFP_KERNEL))
-	    || 0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream ,  usX2Y_capt_substream->endpoints * 64*1024, usX2Y_capt_substream->endpoints * 128*1024, GFP_KERNEL))
-	    || 0 > (err = usX2Y_rate_set(usX2Y_stream, 44100))) {  // needed to make us428 recognize output-volume settings for direct-monitoring and master-pcm. shouldn't disturb other usx2y.
+	if (0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream, 64*1024, 128*1024, GFP_KERNEL)) ||
+	    0 > (err = snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream,
+							usX2Y_capt_substream->endpoints * 64*1024,
+							usX2Y_capt_substream->endpoints * 128*1024, GFP_KERNEL)) ||
+	    (usX2Y(card)->chip.dev->descriptor.idProduct == USB_ID_US428 &&
+	     0 > (err = usX2Y_rate_set(usX2Y_stream, 44100)))) {	// Lets us428 recognize output-volume settings, disturbs us122.
 		snd_usX2Y_audio_stream_free(usX2Y_stream);
 		return err;
 	}

Reply via email to