Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
104 lines (97 sloc) 2.63 KB
diff -r 1af7e985cef6 kernel/drv/oss_usb/ossusb_audio.c
--- a/kernel/drv/oss_usb/ossusb_audio.c Tue Jul 21 19:46:03 2009 +0300
+++ b/kernel/drv/oss_usb/ossusb_audio.c Sat Jul 25 13:34:10 2009 +0300
@@ -86,11 +86,15 @@
buf, // buffer
l, // buflen
OSS_HZ);
+#if 0
if (len < 0)
{
cmn_err (CE_WARN, "Endpoint control write error %d\n", len);
return OSS_EIO;
}
+#else
+ if (len < 0) len = 3;
+#endif
return len;
}
@@ -858,11 +862,9 @@
return;
}
+ oss_audio_inputintr (portc->audio_dev, AINTR_NO_POINTER_UPDATES | AINTR_LOCALQUEUE);
+ start_input (portc->audio_dev, portc->devc, portc);
oss_audio_inc_byte_counter (dmap, len);
- oss_audio_inputintr (portc->audio_dev, AINTR_NO_POINTER_UPDATES);
-#ifdef linux
- start_input (portc->audio_dev, portc->devc, portc);
-#endif
}
#if 0
@@ -962,13 +964,9 @@
adev_p adev = audio_engines[dev];
dmap_p dmap = adev->dmap_out;
+ if (portc->stopping)
+ return 0;
+
MUTEX_ENTER_IRQDISABLE (devc->mutex, flags);
-
- if (portc->stopping)
- {
- MUTEX_EXIT_IRQRESTORE (devc->mutex, flags);
- return 0;
- }
-
pn = portc->curr_datapipe;
portc->curr_datapipe = (portc->curr_datapipe + 1) % NR_DATAPIPES;
@@ -994,8 +994,7 @@
{
int frag, err;
oss_native_word flags;
- adev_p adev = audio_engines[dev];
- dmap_p dmap = adev->dmap_in;
+ int pn;
if (portc->stopping)
return;
@@ -1003,10 +1002,12 @@
MUTEX_ENTER_IRQDISABLE (devc->mutex, flags);
frag = 0;
+ pn = portc->curr_datapipe;
+ portc->curr_datapipe = (portc->curr_datapipe + 1) % NR_DATAPIPES;
if ((err =
- udi_usb_submit_request (portc->datapipe[0], rec_callback, portc,
+ udi_usb_submit_request (portc->datapipe[pn], rec_callback, portc,
portc->endpoint_handle, UDI_USBXFER_ISO_READ,
- dmap->dmabuf + frag * portc->fragment_size,
+ portc->tmp_buf[pn],
portc->fragment_size)) < 0)
{
cmn_err (CE_WARN, "oss usbaudio: Read transfer error %d\n", err);
@@ -1040,7 +1041,7 @@
else if (!(state & PCM_ENABLE_OUTPUT))
{
portc->stopping = 1;
-#if 1
+#if 0
udi_usb_cancel_request (portc->datapipe[0]);
udi_usb_cancel_request (portc->datapipe[1]);
#endif
@@ -1055,15 +1056,16 @@
{
portc->prepared_modes &= ~PCM_ENABLE_INPUT;
portc->stopping = 0;
+ portc->curr_datapipe = 0;
+
+ start_input (dev, devc, portc);
start_input (dev, devc, portc);
}
else if (!(state & PCM_ENABLE_INPUT))
{
portc->stopping = 1;
-#if 0
udi_usb_cancel_request (portc->datapipe[0]);
udi_usb_cancel_request (portc->datapipe[1]);
-#endif
portc->curr_datapipe = 0;
}
}
Jump to Line
Something went wrong with that request. Please try again.