summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/playback.c14
-rw-r--r--apps/playback.h1
2 files changed, 12 insertions, 3 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 2ea6e2f004..c3d28110dd 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -3443,6 +3443,11 @@ static bool ata_fillbuffer_callback(void)
3443static void audio_thread(void) 3443static void audio_thread(void)
3444{ 3444{
3445 struct event ev; 3445 struct event ev;
3446
3447 audiohw_postinit();
3448
3449 /* Unlock mutex that init stage locks before creating this thread */
3450 mutex_unlock(&mutex_codecthread);
3446 3451
3447 while (1) 3452 while (1)
3448 { 3453 {
@@ -3604,6 +3609,10 @@ void audio_init(void)
3604 starts running until ready if something yields such as talk_init. */ 3609 starts running until ready if something yields such as talk_init. */
3605#ifdef PLAYBACK_VOICE 3610#ifdef PLAYBACK_VOICE
3606 mutex_init(&mutex_codecthread); 3611 mutex_init(&mutex_codecthread);
3612 /* Take ownership of lock to prevent playback of anything before audio
3613 hardware is initialized - audio thread unlocks it after final init
3614 stage */
3615 mutex_lock(&mutex_codecthread);
3607#endif 3616#endif
3608 queue_init(&audio_queue, true); 3617 queue_init(&audio_queue, true);
3609 queue_enable_queue_send(&audio_queue, &audio_queue_sender_list); 3618 queue_enable_queue_send(&audio_queue, &audio_queue_sender_list);
@@ -3656,6 +3665,7 @@ void audio_init(void)
3656 3665
3657 /* initialize the buffer */ 3666 /* initialize the buffer */
3658 filebuf = audiobuf; /* must be non-NULL for audio_set_crossfade */ 3667 filebuf = audiobuf; /* must be non-NULL for audio_set_crossfade */
3668
3659 /* audio_reset_buffer must to know the size of voice buffer so init 3669 /* audio_reset_buffer must to know the size of voice buffer so init
3660 voice first */ 3670 voice first */
3661 talk_init(); 3671 talk_init();
@@ -3670,9 +3680,9 @@ void audio_init(void)
3670 IF_COP(, CPU, false)); 3680 IF_COP(, CPU, false));
3671 3681
3672 audio_set_crossfade(global_settings.crossfade); 3682 audio_set_crossfade(global_settings.crossfade);
3673 3683
3674 audio_is_initialized = true; 3684 audio_is_initialized = true;
3675 3685
3676 sound_settings_apply(); 3686 sound_settings_apply();
3677 audio_set_buffer_margin(global_settings.buffer_margin); 3687 audio_set_buffer_margin(global_settings.buffer_margin);
3678} /* audio_init */ 3688} /* audio_init */
diff --git a/apps/playback.h b/apps/playback.h
index ccf8b58472..82179f1ee2 100644
--- a/apps/playback.h
+++ b/apps/playback.h
@@ -74,7 +74,6 @@ extern void audio_prev_dir(void);
74#define audio_next_dir() 74#define audio_next_dir()
75#define audio_prev_dir() 75#define audio_prev_dir()
76#endif 76#endif
77void audio_preinit(void);
78 77
79#endif 78#endif
80 79