From 8712acb5395d1552870fef3b1b99df2f53df880a Mon Sep 17 00:00:00 2001 From: Ross Owen Date: Mon, 20 Jan 2014 18:13:54 +0000 Subject: [PATCH] deliver thread no longer waits for AUDIO_PLL_LOCK_DELAY - this was causing pop issues on rate change as DAC has mclk but no bclk/lrclk. This seems to cause issues. This delay now added to audio SF change in EP0 for safety. Related to BUG #14769 --- module_usb_audio/audio.xc | 15 ++++++++++----- module_usb_audio/endpoint0/audiorequests.xc | 8 ++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/module_usb_audio/audio.xc b/module_usb_audio/audio.xc index 89d321be..b4f11369 100755 --- a/module_usb_audio/audio.xc +++ b/module_usb_audio/audio.xc @@ -948,11 +948,16 @@ void audio(chanend c_mix_out, chanend ?c_dig_rx, chanend ?c_config, chanend ?c) /* No delay for DFU modes */ if ((curSamFreq != AUDIO_REBOOT_FROM_DFU) && (curSamFreq != AUDIO_STOP_FOR_DFU) && retVal1) { - timer t; - unsigned time; - t :> time; - t when timerafter(time+AUDIO_PLL_LOCK_DELAY) :> void; - +#if 0 + /* User should ensure MCLK is stable in AudioHwConfig */ + if(retVal1 == SET_SAMPLE_FREQ) + { + timer t; + unsigned time; + t :> time; + t when timerafter(time+AUDIO_PLL_LOCK_DELAY) :> void; + } +#endif /* Handshake back */ outct(c_mix_out, XS1_CT_END); } diff --git a/module_usb_audio/endpoint0/audiorequests.xc b/module_usb_audio/endpoint0/audiorequests.xc index 1cd3fbf1..57c838d8 100644 --- a/module_usb_audio/endpoint0/audiorequests.xc +++ b/module_usb_audio/endpoint0/audiorequests.xc @@ -308,17 +308,17 @@ int AudioClassRequests_2(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp, c outuint(c_audioControl, SET_SAMPLE_FREQ); outuint(c_audioControl, g_curSamFreq); - /* Wait for handshake back - i.e. pll locked and clocks okay */ + /* Wait for handshake back - i.e. PLL locked and clocks okay */ chkct(c_audioControl, XS1_CT_END); } - /* Allow time for our feedback to stabalise*/ + /* Allow time for our feedback to stabilise*/ { timer t; unsigned time; t :> time; - t when timerafter(time+5000000):> void; + t when timerafter(time+5000000+40000000):> void; } } @@ -1049,7 +1049,7 @@ int AudioEndpointRequests_1(XUD_ep ep0_out, XUD_ep ep0_in, USB_SetupPacket_t &sp timer t; unsigned time; t :> time; - t when timerafter(time+50000000):> void; + t when timerafter(time+50000000+40000000):> void; } } }