mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 12:45:26 -05:00
playback,talk: Share audiobuffer via core_alloc_maximum().
This fixes the radioart crash that was the result of buffering.c working on a freed buffer at the same time as buflib (radioart uses buffering.c for the images). With this change the buffer is owned by buflib exclusively so this cannot happen. As a result, audio_get_buffer() doesn't exist anymore. Callers should call core_alloc_maximum() directly. This buffer needs to be protected as usual against movement if necessary (previously it was not protected at all which cased the radioart crash), To get most of it they can adjust the willingness of the talk engine to give its buffer away (at the expense of disabling voice interface) with the new talk_buffer_set_policy() function. Change-Id: I52123012208d04967876a304451d634e2bef3a33
This commit is contained in:
parent
64b9e1fa7b
commit
22e802e800
15 changed files with 676 additions and 587 deletions
|
|
@ -230,21 +230,6 @@ void usb_insert_int(void)
|
|||
}
|
||||
#endif /* USB_STATUS_BY_EVENT */
|
||||
|
||||
#ifdef HAVE_BOOTLOADER_USB_MODE
|
||||
/* Replacement function that returns all unused memory after the bootloader
|
||||
* because the storage driver uses the audio buffer */
|
||||
extern unsigned char freebuffer[];
|
||||
extern unsigned char freebufferend[];
|
||||
unsigned char *audio_get_buffer(bool talk_buf, size_t *buffer_size)
|
||||
{
|
||||
if (buffer_size)
|
||||
*buffer_size = freebufferend - freebuffer + 1;
|
||||
|
||||
return freebuffer;
|
||||
(void)talk_buf;
|
||||
}
|
||||
#endif /* HAVE_BOOTLOADER_USB_MODE */
|
||||
|
||||
void usb_drv_int_enable(bool enable)
|
||||
{
|
||||
/* enable/disable USB IRQ in CPU */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue