Author: janderwald
Date: Fri Nov 4 18:07:44 2016
New Revision: 73124
URL:
http://svn.reactos.org/svn/reactos?rev=73124&view=rev
Log:
[USBAUDIO]
- fix buffer calculation for usb headsets
- usb headsets now partially work with usbaudio in win2k3
Modified:
trunk/reactos/drivers/usb/usbaudio/pin.c
trunk/reactos/drivers/usb/usbaudio/usbaudio.h
Modified: trunk/reactos/drivers/usb/usbaudio/pin.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/pin.c…
==============================================================================
--- trunk/reactos/drivers/usb/usbaudio/pin.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbaudio/pin.c [iso-8859-1] Fri Nov 4 18:07:44 2016
@@ -874,6 +874,7 @@
IoSetCompletionRoutine(Irp, UsbAudioRenderComplete, Pin, TRUE, TRUE, TRUE);
/* calculate packet count */
+ /* FIXME support various sample rates */
WaveFormatEx = (PKSDATAFORMAT_WAVEFORMATEX)Pin->ConnectionFormat;
TotalPacketSize = WaveFormatEx->WaveFormatEx.nAvgBytesPerSec / 1000;
ASSERT(TotalPacketSize <=
PinContext->DeviceExtension->InterfaceInfo->Pipes[0].MaximumPacketSize);
@@ -882,8 +883,6 @@
PacketCount = CloneStreamPointer->OffsetIn.Remaining / TotalPacketSize;
ASSERT(PacketCount < 255);
-
- //DPRINT1("PinRenderProcess Irp %p TotalPacketSize %lu MaximumPacketSize %lu
PacketCount %lu Count %lu Data %p\n", Irp, TotalPacketSize,
PinContext->DeviceExtension->InterfaceInfo->Pipes[0].MaximumPacketSize,
PacketCount, CloneStreamPointer->OffsetIn.Count,
CloneStreamPointer->OffsetIn.Data);
Urb = (PURB)AllocFunction(GET_ISO_URB_SIZE(PacketCount));
ASSERT(Urb);
@@ -893,8 +892,8 @@
Urb->UrbIsochronousTransfer.Hdr.Length = GET_ISO_URB_SIZE(PacketCount);
Urb->UrbIsochronousTransfer.PipeHandle =
PinContext->DeviceExtension->InterfaceInfo->Pipes[0].PipeHandle;
Urb->UrbIsochronousTransfer.TransferFlags = USBD_TRANSFER_DIRECTION_OUT |
USBD_START_ISO_TRANSFER_ASAP;
- Urb->UrbIsochronousTransfer.TransferBufferLength =
CloneStreamPointer->OffsetIn.Remaining;
- Urb->UrbIsochronousTransfer.TransferBuffer =
CloneStreamPointer->OffsetIn.Data;
+ Urb->UrbIsochronousTransfer.TransferBufferLength = PacketCount * TotalPacketSize;
+ Urb->UrbIsochronousTransfer.TransferBuffer =
CloneStreamPointer->StreamHeader->Data;
Urb->UrbIsochronousTransfer.NumberOfPackets = PacketCount;
Urb->UrbIsochronousTransfer.StartFrame = 0;
Modified: trunk/reactos/drivers/usb/usbaudio/usbaudio.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/usb/usbaudio/usbau…
==============================================================================
--- trunk/reactos/drivers/usb/usbaudio/usbaudio.h [iso-8859-1] (original)
+++ trunk/reactos/drivers/usb/usbaudio/usbaudio.h [iso-8859-1] Fri Nov 4 18:07:44 2016
@@ -205,6 +205,7 @@
PKSWORKER CaptureWorker; /* capture worker */
WORK_QUEUE_ITEM StarvationWorkItem; /* work item */
PKSWORKER StarvationWorker; /* capture worker */
+ ULONG BufferOffset;
}PIN_CONTEXT, *PPIN_CONTEXT;
/* filter.c */