forked from PAWPAW-Mirror/lib_xua
Removed guard that was used when re-calling SetReady_In on sample rate change. New (non-channel-based XUD API means this can be called multiple times without locking)
This commit is contained in:
@@ -640,7 +640,6 @@ void decouple(chanend c_mix_out,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int t = array_to_xc_ptr(outAudioBuff);
|
int t = array_to_xc_ptr(outAudioBuff);
|
||||||
int aud_in_ready = 0;
|
|
||||||
|
|
||||||
#ifndef OUT_VOLUME_IN_MIXER
|
#ifndef OUT_VOLUME_IN_MIXER
|
||||||
p_multOut = array_to_xc_ptr(multOut);
|
p_multOut = array_to_xc_ptr(multOut);
|
||||||
@@ -731,8 +730,6 @@ void decouple(chanend c_mix_out,
|
|||||||
GET_SHARED_GLOBAL(p, g_aud_to_host_buffer);
|
GET_SHARED_GLOBAL(p, g_aud_to_host_buffer);
|
||||||
read_via_xc_ptr(len, p)
|
read_via_xc_ptr(len, p)
|
||||||
XUD_SetReady_InPtr(aud_to_host_usb_ep, g_aud_to_host_buffer, len);
|
XUD_SetReady_InPtr(aud_to_host_usb_ep, g_aud_to_host_buffer, len);
|
||||||
aud_in_ready = 1;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -784,7 +781,7 @@ void decouple(chanend c_mix_out,
|
|||||||
|
|
||||||
/* Update size of zeros buffer */
|
/* Update size of zeros buffer */
|
||||||
{
|
{
|
||||||
int min, mid, max, usb_speed;
|
int min, mid, max, usb_speed, p;
|
||||||
GET_SHARED_GLOBAL(usb_speed, g_curUsbSpeed);
|
GET_SHARED_GLOBAL(usb_speed, g_curUsbSpeed);
|
||||||
GetADCCounts(sampFreq, min, mid, max);
|
GetADCCounts(sampFreq, min, mid, max);
|
||||||
if (usb_speed == XUD_SPEED_HS)
|
if (usb_speed == XUD_SPEED_HS)
|
||||||
@@ -793,20 +790,11 @@ void decouple(chanend c_mix_out,
|
|||||||
mid*=NUM_USB_CHAN_IN_FS*SAMPLE_SUBSLOT_SIZE_FS;
|
mid*=NUM_USB_CHAN_IN_FS*SAMPLE_SUBSLOT_SIZE_FS;
|
||||||
|
|
||||||
asm("stw %0, %1[0]"::"r"(mid),"r"(g_aud_to_host_zeros));
|
asm("stw %0, %1[0]"::"r"(mid),"r"(g_aud_to_host_zeros));
|
||||||
}
|
|
||||||
|
/* Mark EP ready with the zero buffer. Note this will simply update the packet size
|
||||||
|
* if it is already ready */
|
||||||
/* Check if we have an IN packet ready to go */
|
|
||||||
if (aud_in_ready)
|
|
||||||
{
|
|
||||||
xc_ptr p;
|
|
||||||
int len;
|
|
||||||
|
|
||||||
GET_SHARED_GLOBAL(p, g_aud_to_host_buffer);
|
GET_SHARED_GLOBAL(p, g_aud_to_host_buffer);
|
||||||
read_via_xc_ptr(len, p);
|
XUD_SetReady_InPtr(aud_to_host_usb_ep, p+4, mid);
|
||||||
|
|
||||||
/* Update packet size */
|
|
||||||
XUD_SetReady_InPtr(aud_to_host_usb_ep, p+4, len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Reset OUT buffer state */
|
/* Reset OUT buffer state */
|
||||||
@@ -822,7 +810,6 @@ void decouple(chanend c_mix_out,
|
|||||||
outOverflow = 0;
|
outOverflow = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Wait for handshake back and pass back up */
|
/* Wait for handshake back and pass back up */
|
||||||
chkct(c_mix_out, XS1_CT_END);
|
chkct(c_mix_out, XS1_CT_END);
|
||||||
|
|
||||||
@@ -1010,7 +997,6 @@ void decouple(chanend c_mix_out,
|
|||||||
/* Signals that the IN endpoint has sent data from the passed buffer */
|
/* Signals that the IN endpoint has sent data from the passed buffer */
|
||||||
/* Reset flag */
|
/* Reset flag */
|
||||||
SET_SHARED_GLOBAL(g_aud_to_host_flag, 0);
|
SET_SHARED_GLOBAL(g_aud_to_host_flag, 0);
|
||||||
aud_in_ready = 0;
|
|
||||||
|
|
||||||
if (inUnderflow)
|
if (inUnderflow)
|
||||||
{
|
{
|
||||||
@@ -1074,7 +1060,6 @@ void decouple(chanend c_mix_out,
|
|||||||
GET_SHARED_GLOBAL(p, g_aud_to_host_buffer);
|
GET_SHARED_GLOBAL(p, g_aud_to_host_buffer);
|
||||||
asm("ldw %0, %1[0]":"=r"(len):"r"(p));
|
asm("ldw %0, %1[0]":"=r"(len):"r"(p));
|
||||||
XUD_SetReady_InPtr(aud_to_host_usb_ep, p+4, len);
|
XUD_SetReady_InPtr(aud_to_host_usb_ep, p+4, len);
|
||||||
aud_in_ready = 1;
|
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user