Skip to contentSkip to conversation

snd-usb-us428.patch.0.3

PATCH Applied Karsten Wiese 2 participants 2 messages Nov 3, 2003

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 snd-usb-us428.patch.0.3

Hi Takashi,

please commit this with Comment:

Quoted 1 line
Quoted 1 line
Quoted 1 line

24Bit in 3Bytes (S24_3LE) support.
<<<

Danke,
Karsten

Index: alsa-driver/usb/us428/usbus428.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/usb/us428/usbus428.c,v retrieving revision 1.6

usb/us428/usbus428.c +13 -25
diff -u -r1.6 usbus428.c
@@ -1,6 +1,11 @@
 /*
  * usbus428.c - ALSA USB US-428 Driver
  *
+2003-11-03 Karsten Wiese
+	Version 0.3:
+	24Bit support. 
+	"arecord -D hw:1 -c 2 -r 48000 -M -f S24_3LE|aplay -D hw:1 -c 2 -r 48000 -M -f S24_3LE" works.
+
 2003-08-22 Karsten Wiese
 	Version 0.0.8:
 	Removed EZUSB Firmware. First Stage Firmwaredownload is now done by tascam-firmware downloader.
@@ -75,7 +80,7 @@
 
 
 MODULE_AUTHOR("Karsten Wiese <[email protected]>");
-MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.2");
+MODULE_DESCRIPTION("TASCAM "NAME_ALLCAPS" Version 0.3");
 MODULE_LICENSE("GPL");
 MODULE_CLASSES("{sound}");
 MODULE_DEVICES("{{TASCAM(0x1604), "NAME_ALLCAPS"(0x8001) }}");
@@ -226,18 +231,14 @@
 {
 	int		dev;
 	snd_card_t*	card;
-
 	for (dev = 0; dev < SNDRV_CARDS; ++dev)
 		if (enable[dev] && !snd_us428_card_used[dev])
 			break;
-
 	if (dev >= SNDRV_CARDS)
 		return NULL;
-
 	card = snd_card_new(index[dev], id[dev], THIS_MODULE, sizeof(us428dev_t));
 	if (!card)
 		return NULL;
-
 	snd_us428_card_used[us428(card)->chip.index = dev] = 1;
 	card->private_free = snd_us428_card_private_free;
 	us428(card)->chip.dev = device;
@@ -245,7 +246,6 @@
 	init_MUTEX (&us428(card)->open_mutex);
 	INIT_LIST_HEAD(&us428(card)->chip.midi_list);
 	us428(card)->Seq04Complete = 1;
-	us428(card)->stride = 4;		// 16 Bit 
 	strcpy(card->driver, "USB "NAME_ALLCAPS"");
 	sprintf(card->shortname, "TASCAM "NAME_ALLCAPS"");
 	sprintf(card->longname, "%s (%x:%x if %d at %03d/%03d)",
@@ -258,25 +258,15 @@
 }
 
 
-static void* snd_us428_usb_probe(struct usb_device* device,
-				 struct usb_interface *intf,
-				 const struct usb_device_id* device_id)
+static void* snd_us428_usb_probe(struct usb_device* device, struct usb_interface *intf, const struct usb_device_id* device_id)
 {
 	int		err;
 	snd_card_t*	card;
-	
-			/* See if the device offered us matches what we can accept */
-	if (device->descriptor.idVendor != 0x1604 || device->descriptor.idProduct != 0x8001)
+	if (device->descriptor.idVendor != 0x1604 || device->descriptor.idProduct != 0x8001 ||
+	    !(card = snd_us428_create_card(device)))
 		return 0;
-
-	if (!(card = snd_us428_create_card(device)))
-		return 0;
-
-	if ((err = snd_usX2Y_hwdep_new(card, device)) < 0) {
-		snd_card_free(card);
-		return 0;
-	}
-	if ((err = snd_card_register(card)) < 0) {
+	if ((err = snd_usX2Y_hwdep_new(card, device)) < 0  ||
+	    (err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return 0;
 	}
@@ -287,8 +277,7 @@
 /*
  * new 2.5 USB kernel API
  */
-static int snd_us428_probe(struct usb_interface *intf,
-			   const struct usb_device_id *id)
+static int snd_us428_probe(struct usb_interface *intf, const struct usb_device_id *id)
 {
 	void *chip;
 	chip = snd_us428_usb_probe(interface_to_usbdev(intf), intf, id);
@@ -308,8 +297,7 @@
 /*
  * 2.4 USB kernel API
  */
-static void *snd_us428_probe(struct usb_device *dev, unsigned int ifnum,
-			     const struct usb_device_id *id)
+static void *snd_us428_probe(struct usb_device *dev, unsigned int ifnum, const struct usb_device_id *id)
 {
 	return snd_us428_usb_probe(dev, usb_ifnum_to_if(dev, ifnum), id);
 }

Index: alsa-driver/usb/us428/usbus428.h
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/usb/us428/usbus428.h,v retrieving revision 1.2

usb/us428/usbus428.h +4 -3
diff -u -r1.2 usbus428.h
@@ -14,12 +14,12 @@
 
 #define URBS_AsyncSeq 10
 #define URB_DataLen_AsyncSeq 32
-typedef struct{
+typedef struct {
 	urb_t*	urb[URBS_AsyncSeq];
 	char*   buffer;
 } snd_us428_AsyncSeq_t;
 
-typedef struct{
+typedef struct {
 	int	submitted;
 	int	len;
 	urb_t*	urb[0];
@@ -38,7 +38,8 @@
 	int 			Seq04Complete;
 	wait_queue_head_t	In04WaitQueue;
 	snd_us428_AsyncSeq_t	AS04;
-	int			rate;
+	unsigned int		rate,
+				format;
 	int			refframes;
 	purb_t			play_urb_waiting[2];
 	int			pipe0Aframes[NRURBS][NRPACKS];

Index: alsa-driver/usb/us428/usbus428audio.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/usb/us428/usbus428audio.c,v retrieving revision 1.6

usb/us428/usbus428audio.c +38 -30

174 lines not on this page · raw message

Applied
#1 lore raw

At Mon, 3 Nov 2003 12:10:46 +0100,

Quoted 8 lines · Karsten Wiese

[1 <text/plain; us-ascii (7bit)>]
Hi Takashi,

please commit this with Comment:

Quoted 1 line
Quoted 1 line
Quoted 1 line

24Bit in 3Bytes (S24_3LE) support.
<<<

thanks, applied to cvs now.

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/