File tree Expand file tree Collapse file tree 3 files changed +37
-27
lines changed Expand file tree Collapse file tree 3 files changed +37
-27
lines changed Original file line number Diff line number Diff line change @@ -151,6 +151,12 @@ static int snd_usx2y_card_used[SNDRV_CARDS];
151
151
static void snd_usx2y_card_private_free (struct snd_card * card );
152
152
static void usx2y_unlinkseq (struct snd_usx2y_async_seq * s );
153
153
154
+ #ifdef USX2Y_NRPACKS_VARIABLE
155
+ int nrpacks = USX2Y_NRPACKS ; /* number of packets per urb */
156
+ module_param (nrpacks , int , 0444 );
157
+ MODULE_PARM_DESC (nrpacks , "Number of packets per URB." );
158
+ #endif
159
+
154
160
/*
155
161
* pipe 4 is used for switching the lamps, setting samplerate, volumes ....
156
162
*/
@@ -432,6 +438,11 @@ static int snd_usx2y_probe(struct usb_interface *intf,
432
438
struct snd_card * card ;
433
439
int err ;
434
440
441
+ #ifdef USX2Y_NRPACKS_VARIABLE
442
+ if (nrpacks < 0 || nrpacks > USX2Y_NRPACKS_MAX )
443
+ return - EINVAL ;
444
+ #endif
445
+
435
446
if (le16_to_cpu (device -> descriptor .idVendor ) != 0x1604 ||
436
447
(le16_to_cpu (device -> descriptor .idProduct ) != USB_ID_US122 &&
437
448
le16_to_cpu (device -> descriptor .idProduct ) != USB_ID_US224 &&
Original file line number Diff line number Diff line change 7
7
8
8
#define NRURBS 2
9
9
10
+ /* Default value used for nr of packs per urb.
11
+ * 1 to 4 have been tested ok on uhci.
12
+ * To use 3 on ohci, you'd need a patch:
13
+ * look for "0000425-linux-2.6.9-rc4-mm1_ohci-hcd.patch.gz" on
14
+ * "https://bugtrack.alsa-project.org/alsa-bug/bug_view_page.php?bug_id=0000425"
15
+ *
16
+ * 1, 2 and 4 work out of the box on ohci, if I recall correctly.
17
+ * Bigger is safer operation, smaller gives lower latencies.
18
+ */
19
+ #define USX2Y_NRPACKS 4
20
+
21
+ #define USX2Y_NRPACKS_MAX 1024
22
+
23
+ /* If your system works ok with this module's parameter
24
+ * nrpacks set to 1, you might as well comment
25
+ * this define out, and thereby produce smaller, faster code.
26
+ * You'd also set USX2Y_NRPACKS to 1 then.
27
+ */
28
+ #define USX2Y_NRPACKS_VARIABLE 1
29
+
30
+ #ifdef USX2Y_NRPACKS_VARIABLE
31
+ extern int nrpacks ;
32
+ #define nr_of_packs () nrpacks
33
+ #else
34
+ #define nr_of_packs () USX2Y_NRPACKS
35
+ #endif
10
36
11
37
#define URBS_ASYNC_SEQ 10
12
38
#define URB_DATA_LEN_ASYNC_SEQ 32
Original file line number Diff line number Diff line change 28
28
#include "usx2y.h"
29
29
#include "usbusx2y.h"
30
30
31
- /* Default value used for nr of packs per urb.
32
- * 1 to 4 have been tested ok on uhci.
33
- * To use 3 on ohci, you'd need a patch:
34
- * look for "0000425-linux-2.6.9-rc4-mm1_ohci-hcd.patch.gz" on
35
- * "https://bugtrack.alsa-project.org/alsa-bug/bug_view_page.php?bug_id=0000425"
36
- *
37
- * 1, 2 and 4 work out of the box on ohci, if I recall correctly.
38
- * Bigger is safer operation, smaller gives lower latencies.
39
- */
40
- #define USX2Y_NRPACKS 4
41
-
42
- /* If your system works ok with this module's parameter
43
- * nrpacks set to 1, you might as well comment
44
- * this define out, and thereby produce smaller, faster code.
45
- * You'd also set USX2Y_NRPACKS to 1 then.
46
- */
47
- #define USX2Y_NRPACKS_VARIABLE 1
48
-
49
- #ifdef USX2Y_NRPACKS_VARIABLE
50
- static int nrpacks = USX2Y_NRPACKS ; /* number of packets per urb */
51
- #define nr_of_packs () nrpacks
52
- module_param (nrpacks , int , 0444 );
53
- MODULE_PARM_DESC (nrpacks , "Number of packets per URB." );
54
- #else
55
- #define nr_of_packs () USX2Y_NRPACKS
56
- #endif
57
-
58
31
static int usx2y_urb_capt_retire (struct snd_usx2y_substream * subs )
59
32
{
60
33
struct urb * urb = subs -> completed_urb ;
You can’t perform that action at this time.
0 commit comments