diff options
Diffstat (limited to 'apps/playback.c')
-rw-r--r-- | apps/playback.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/apps/playback.c b/apps/playback.c index fe7a9f6ab1..89caec92aa 100644 --- a/apps/playback.c +++ b/apps/playback.c | |||
@@ -194,9 +194,9 @@ static bool audio_is_initialized = false; | |||
194 | /* TBD: Split out "audio" and "playback" (ie. calling) threads */ | 194 | /* TBD: Split out "audio" and "playback" (ie. calling) threads */ |
195 | 195 | ||
196 | /* Main state control */ | 196 | /* Main state control */ |
197 | static volatile bool audio_codec_loaded; /* Is codec loaded? (C/A-) */ | 197 | static volatile bool audio_codec_loaded NOCACHEBSS_ATTR;/* Codec loaded? (C/A-) */ |
198 | static volatile bool playing; /* Is audio playing? (A) */ | 198 | static volatile bool playing NOCACHEBSS_ATTR; /* Is audio playing? (A) */ |
199 | static volatile bool paused; /* Is audio paused? (A/C-) */ | 199 | static volatile bool paused NOCACHEBSS_ATTR; /* Is audio paused? (A/C-) */ |
200 | static volatile bool filling IDATA_ATTR; /* Is file buffer refilling? (A/C-) */ | 200 | static volatile bool filling IDATA_ATTR; /* Is file buffer refilling? (A/C-) */ |
201 | 201 | ||
202 | /* Ring buffer where compressed audio and codecs are loaded */ | 202 | /* Ring buffer where compressed audio and codecs are loaded */ |
@@ -290,7 +290,7 @@ static void audio_reset_buffer(size_t pcmbufsize); | |||
290 | 290 | ||
291 | /* Codec thread */ | 291 | /* Codec thread */ |
292 | extern struct codec_api ci; | 292 | extern struct codec_api ci; |
293 | static struct event_queue codec_queue; | 293 | static struct event_queue codec_queue NOCACHEBSS_ATTR; |
294 | static long codec_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)] | 294 | static long codec_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)] |
295 | IBSS_ATTR; | 295 | IBSS_ATTR; |
296 | static const char codec_thread_name[] = "codec"; | 296 | static const char codec_thread_name[] = "codec"; |
@@ -304,7 +304,7 @@ static volatile int current_codec IDATA_ATTR; /* Current codec (normal/voice) */ | |||
304 | extern struct codec_api ci_voice; | 304 | extern struct codec_api ci_voice; |
305 | 305 | ||
306 | static struct thread_entry *voice_thread_p = NULL; | 306 | static struct thread_entry *voice_thread_p = NULL; |
307 | static struct event_queue voice_queue; | 307 | static struct event_queue voice_queue NOCACHEBSS_ATTR; |
308 | static long voice_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)] | 308 | static long voice_stack[(DEFAULT_STACK_SIZE + 0x2000)/sizeof(long)] |
309 | IBSS_ATTR_VOICE_STACK; | 309 | IBSS_ATTR_VOICE_STACK; |
310 | static const char voice_thread_name[] = "voice codec"; | 310 | static const char voice_thread_name[] = "voice codec"; |
@@ -324,12 +324,12 @@ static unsigned char *iram_buf[2] = { NULL, NULL }; | |||
324 | /* Pointer to DRAM buffers for normal/voice codecs */ | 324 | /* Pointer to DRAM buffers for normal/voice codecs */ |
325 | static unsigned char *dram_buf[2] = { NULL, NULL }; | 325 | static unsigned char *dram_buf[2] = { NULL, NULL }; |
326 | /* Mutex to control which codec (normal/voice) is running */ | 326 | /* Mutex to control which codec (normal/voice) is running */ |
327 | static struct mutex mutex_codecthread; | 327 | static struct mutex mutex_codecthread NOCACHEBSS_ATTR; |
328 | 328 | ||
329 | /* Voice state */ | 329 | /* Voice state */ |
330 | static volatile bool voice_thread_start; /* Triggers voice playback (A/V) */ | 330 | static volatile bool voice_thread_start; /* Triggers voice playback (A/V) */ |
331 | static volatile bool voice_is_playing; /* Is voice currently playing? (V) */ | 331 | static volatile bool voice_is_playing NOCACHEBSS_ATTR; /* Is voice currently playing? (V) */ |
332 | static volatile bool voice_codec_loaded; /* Is voice codec loaded (V/A-) */ | 332 | static volatile bool voice_codec_loaded NOCACHEBSS_ATTR; /* Is voice codec loaded (V/A-) */ |
333 | static char *voicebuf; | 333 | static char *voicebuf; |
334 | static size_t voice_remaining; | 334 | static size_t voice_remaining; |
335 | 335 | ||
@@ -863,7 +863,8 @@ void audio_preinit(void) | |||
863 | queue_init(&codec_queue, true); | 863 | queue_init(&codec_queue, true); |
864 | 864 | ||
865 | create_thread(audio_thread, audio_stack, sizeof(audio_stack), | 865 | create_thread(audio_thread, audio_stack, sizeof(audio_stack), |
866 | audio_thread_name IF_PRIO(, PRIORITY_BUFFERING)); | 866 | audio_thread_name IF_PRIO(, PRIORITY_BUFFERING) |
867 | IF_COP(, CPU, false)); | ||
867 | } | 868 | } |
868 | 869 | ||
869 | void audio_init(void) | 870 | void audio_init(void) |
@@ -888,7 +889,7 @@ void voice_init(void) | |||
888 | queue_init(&voice_queue, true); | 889 | queue_init(&voice_queue, true); |
889 | voice_thread_p = create_thread(voice_thread, voice_stack, | 890 | voice_thread_p = create_thread(voice_thread, voice_stack, |
890 | sizeof(voice_stack), voice_thread_name | 891 | sizeof(voice_stack), voice_thread_name |
891 | IF_PRIO(, PRIORITY_PLAYBACK)); | 892 | IF_PRIO(, PRIORITY_PLAYBACK) IF_COP(, CPU, false)); |
892 | 893 | ||
893 | while (!voice_codec_loaded) | 894 | while (!voice_codec_loaded) |
894 | yield(); | 895 | yield(); |
@@ -3533,7 +3534,8 @@ static void audio_playback_init(void) | |||
3533 | 3534 | ||
3534 | codec_thread_p = create_thread( | 3535 | codec_thread_p = create_thread( |
3535 | codec_thread, codec_stack, sizeof(codec_stack), | 3536 | codec_thread, codec_stack, sizeof(codec_stack), |
3536 | codec_thread_name IF_PRIO(, PRIORITY_PLAYBACK)); | 3537 | codec_thread_name IF_PRIO(, PRIORITY_PLAYBACK) |
3538 | IF_COP(, COP, true)); | ||
3537 | 3539 | ||
3538 | while (1) | 3540 | while (1) |
3539 | { | 3541 | { |