summaryrefslogtreecommitdiff
path: root/apps/playback.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-03-25 02:34:12 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-03-25 02:34:12 +0000
commit27cf67733936abd75fcb1f8da765977cd75906ee (patch)
treef894211a8a0c77b402dd3250b2bee2d17dcfe13f /apps/playback.c
parentbc2f8fd8f38a3e010cd67bbac358f6e9991153c6 (diff)
downloadrockbox-27cf67733936abd75fcb1f8da765977cd75906ee.tar.gz
rockbox-27cf67733936abd75fcb1f8da765977cd75906ee.zip
Add a complete priority inheritance implementation to the scheduler (all mutex ownership and queue_send calls are inheritable). Priorities are differential so that dispatch depends on the runnable range of priorities. Codec priority can therefore be raised in small steps (pcmbuf updated to enable). Simplify the kernel functions to ease implementation and use the same kernel.c for both sim and target (I'm tired of maintaining two ;_). 1) Not sure if a minor audio break at first buffering issue will exist on large-sector disks (the main mutex speed issue was genuinely resolved earlier). At this point it's best dealt with at the buffering level. It seems a larger filechunk could be used again. 2) Perhaps 64-bit sims will have some minor issues (finicky) but a backroll of the code of concern there is a 5-minute job. All kernel objects become incompatible so a full rebuild and update is needed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16791 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/playback.c')
-rw-r--r--apps/playback.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/apps/playback.c b/apps/playback.c
index 7eecd23e35..9005b3485c 100644
--- a/apps/playback.c
+++ b/apps/playback.c
@@ -2549,9 +2549,7 @@ void audio_init(void)
2549 to send messages. Thread creation will be delayed however so nothing 2549 to send messages. Thread creation will be delayed however so nothing
2550 starts running until ready if something yields such as talk_init. */ 2550 starts running until ready if something yields such as talk_init. */
2551 queue_init(&audio_queue, true); 2551 queue_init(&audio_queue, true);
2552 queue_enable_queue_send(&audio_queue, &audio_queue_sender_list);
2553 queue_init(&codec_queue, false); 2552 queue_init(&codec_queue, false);
2554 queue_enable_queue_send(&codec_queue, &codec_queue_sender_list);
2555 queue_init(&pcmbuf_queue, false); 2553 queue_init(&pcmbuf_queue, false);
2556 2554
2557 pcm_init(); 2555 pcm_init();
@@ -2587,11 +2585,17 @@ void audio_init(void)
2587 codec_thread_name IF_PRIO(, PRIORITY_PLAYBACK) 2585 codec_thread_name IF_PRIO(, PRIORITY_PLAYBACK)
2588 IF_COP(, CPU)); 2586 IF_COP(, CPU));
2589 2587
2588 queue_enable_queue_send(&codec_queue, &codec_queue_sender_list,
2589 codec_thread_p);
2590
2590 audio_thread_p = create_thread(audio_thread, audio_stack, 2591 audio_thread_p = create_thread(audio_thread, audio_stack,
2591 sizeof(audio_stack), CREATE_THREAD_FROZEN, 2592 sizeof(audio_stack), CREATE_THREAD_FROZEN,
2592 audio_thread_name IF_PRIO(, PRIORITY_SYSTEM) 2593 audio_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE)
2593 IF_COP(, CPU)); 2594 IF_COP(, CPU));
2594 2595
2596 queue_enable_queue_send(&audio_queue, &audio_queue_sender_list,
2597 audio_thread_p);
2598
2595#ifdef PLAYBACK_VOICE 2599#ifdef PLAYBACK_VOICE
2596 voice_thread_init(); 2600 voice_thread_init();
2597#endif 2601#endif