Skip to contentSkip to conversation

snd-usb-usx2y

PATCH In review Karsten Wiese 4 participants 9 messages Nov 27, 2003 – Dec 5, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 snd-usb-usx2y

Hi,

this fixes an us428 error that crept in during us122 merge. Please commit with comment:
- Start devices audio-engine on driver startup.
- Prepare for us224 - Tests.

Thanks,
Karsten

Index: alsa-driver/usb/usx2y/usbusx2y.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/usb/usx2y/usbusx2y.c,v retrieving revision 1.2

usb/usx2y/usbusx2y.c +11 -1
diff -u -r1.2 usbusx2y.c
@@ -1,6 +1,11 @@
 /*
  * usbus428.c - ALSA USB US-428 Driver
  *
+2003-11-27 Karsten Wiese, Martin Langer
+	Version 0.4:
+	us122 support.
+	us224 could be tested by uncommenting the sections containing USB_ID_US224
+
 2003-11-03 Karsten Wiese
 	Version 0.3:
 	24Bit support. 
@@ -229,6 +234,11 @@
 		.idVendor =	0x1604,
 		.idProduct =	USB_ID_US122 
 	},
+/* 	{ FIXME: uncomment  to test us224 support*/
+/* 		.match_flags =	USB_DEVICE_ID_MATCH_DEVICE, */
+/* 		.idVendor =	0x1604, */
+/* 		.idProduct =	USB_ID_US224  */
+/* 	}, */
 	{ /* terminator */ }
 };
 
@@ -268,7 +278,7 @@
 	int		err;
 	snd_card_t*	card;
 	if (device->descriptor.idVendor != 0x1604 ||
-	    (device->descriptor.idProduct != USB_ID_US122 && device->descriptor.idProduct != USB_ID_US428) ||
+	    (device->descriptor.idProduct != USB_ID_US122 && /* device->descriptor.idProduct != USB_ID_US224 && */ device->descriptor.idProduct != USB_ID_US428) ||
 	    !(card = snd_usX2Y_create_card(device)))
 		return 0;
 	if ((err = snd_usX2Y_hwdep_new(card, device)) < 0  ||

Index: alsa-driver/usb/usx2y/usbusx2yaudio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/usb/usx2y/usbusx2yaudio.c,v retrieving revision 1.1

usb/usx2y/usbusx2yaudio.c +2 -1
diff -u -r1.1 usbusx2yaudio.c
@@ -1225,7 +1225,8 @@
 	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_ATOMIC))
-	    || 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_ATOMIC))) {
+	    || 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_ATOMIC))
+	    || 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.
 		snd_usX2Y_audio_stream_free(usX2Y_stream);
 		return err;
 	}
#1 lore raw

At Thu, 27 Nov 2003 15:44:21 +0100,

Quoted 7 lines · Karsten Wiese

Hi,

this fixes an us428 error that crept in during us122 merge. Please commit with comment:
- Start devices audio-engine on driver startup.
- Prepare for us224 - Tests.

applied together with my fixes.

thanks.

Takashi

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#2 lore raw
In reply to Karsten Wiese

Am Donnerstag, 27. November 2003 15:44 schrieb Karsten Wiese:

Quoted 5 lines

Hi,

this fixes an us428 error that crept in during us122 merge. Please commit with comment:
- Start devices audio-engine on driver startup.

should be:
- Start device's audio-engine on driver startup.

Quoted 4 lines

- Prepare for us224 - Tests.

Thanks,
Karsten

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#3 lore raw
In reply to Karsten Wiese
usb/usx2y/usbusx2yaudio.c +2 -1
diff -u -r1.1 usbusx2yaudio.c
@@ -1225,7 +1225,8 @@
 	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_ATOMIC))
-	    || 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_ATOMIC))) {
+	    || 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_ATOMIC))
+	    || 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.
 

Karsten, your us428 fix breaks us122 support. usX2Y_rate_set(usX2Y_stream, 44100)) isn't possible on us122.

martin

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#4 lore raw

Am Donnerstag, 4. Dezember 2003 20:30 schrieb Martin Langer:

Quoted 4 lines

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?

Karsten

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#5 lore raw
Quoted 9 lines · Karsten Wiese

Am Donnerstag, 4. Dezember 2003 20:30 schrieb Martin Langer:

Quoted 4 lines

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.

martin

Signature · 8 lines
The only nice thing about spam is that it doesn't ring.


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
#6 lore raw

Am Donnerstag, 4. Dezember 2003 23:46 schrieb Martin Langer:

Quoted 9 lines · Karsten Wiese
Quoted 7 lines

Am Donnerstag, 4. Dezember 2003 20:30 schrieb Martin Langer:

Quoted 2 lines

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?

Quoted 6 lines

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

usb/usx2y/usbusx2yaudio.c +6 -3
diff -u -r1.3 usbusx2yaudio.c
@@ -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;
 	}
#7 lore raw
Quoted 3 lines · Karsten Wiese

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.

It also slipped to rc2. Thanks.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/

#8 lore raw
Quoted 7 lines · Jaroslav Kysela
Quoted 3 lines · Karsten Wiese

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.

It also slipped to rc2. Thanks.

US122 works fine with that patch (like expected).

martin

Signature · 8 lines
The only nice thing about spam is that it doesn't ring.


-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/