mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-07 05:35:02 -05:00
usbaudio: block playback while usbaudio is active
Needed due to us commandeering the AUDIO DSP "channel" for USBAudio. If/When we add another DSP channel, this can be reverted. Works, but still goes to a "blank" WPS screen for a split second before cancelling out. Change-Id: I5fb8a1e226b4d3e46c86c59d593d807f49d7a35f
This commit is contained in:
parent
c533222851
commit
a1837d2d80
3 changed files with 28 additions and 0 deletions
|
|
@ -398,6 +398,9 @@ int buffers_filled_max_last;
|
|||
static int last_frame = 0;
|
||||
static int frames_dropped = 0;
|
||||
|
||||
/* for blocking normal playback */
|
||||
static bool usbaudio_active = false;
|
||||
|
||||
/* Schematic view of the RX situation:
|
||||
* (in case NR_BUFFERS = 4)
|
||||
*
|
||||
|
|
@ -1181,6 +1184,7 @@ void usb_audio_init_connection(void)
|
|||
{
|
||||
logf("usbaudio: init connection");
|
||||
|
||||
usbaudio_active = true;
|
||||
dsp = dsp_get_config(CODEC_IDX_AUDIO);
|
||||
dsp_configure(dsp, DSP_RESET, 0);
|
||||
dsp_configure(dsp, DSP_SET_STEREO_MODE, STEREO_INTERLEAVED);
|
||||
|
|
@ -1202,6 +1206,12 @@ void usb_audio_disconnect(void)
|
|||
|
||||
usb_audio_stop_playback();
|
||||
usb_audio_free_buf();
|
||||
usbaudio_active = false;
|
||||
}
|
||||
|
||||
bool usb_audio_get_active(void)
|
||||
{
|
||||
return usbaudio_active;
|
||||
}
|
||||
|
||||
bool usb_audio_get_alloc_failed(void)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue