path: root/firmware/pcm_mixer.c
diff options
authorMichael Sevakis <>2012-05-02 17:22:28 -0400
committerMichael Sevakis <>2012-05-02 17:22:28 -0400
commitda6cebb6b0b17b4a75a2bd4f51b7cf70b5dafe40 (patch)
treedf0eb18120c38ec7b08d3ae1e0837f0781065e87 /firmware/pcm_mixer.c
parent3d3a144cf68186fd34f7bf11181b7757c7a6018d (diff)
Use buflib for the allocation of voice PCM resources.
Buffers are not allocated and thread is not created until the first call where voice is required. Adds a different callback (sync_callback) to buflib so that other sorts of synchonization are possible, such as briefly locking-out the PCM callback for a buffer move. It's sort of a messy addition but it is needed so voice decoding won't have to be stopped when its buffer is moved. Change-Id: I4d4d8c35eed5dd15fb7ee7df9323af3d036e92b3
Diffstat (limited to 'firmware/pcm_mixer.c')
1 files changed, 10 insertions, 0 deletions
diff --git a/firmware/pcm_mixer.c b/firmware/pcm_mixer.c
index c3e7ffa478..85d31ade70 100644
--- a/firmware/pcm_mixer.c
+++ b/firmware/pcm_mixer.c
@@ -406,6 +406,16 @@ void mixer_channel_calculate_peaks(enum pcm_mixer_channel channel,
*right = peaks->val[1];
+/* Adjust channel pointer by a given offset to support movable buffers */
+void mixer_adjust_channel_address(enum pcm_mixer_channel channel,
+ off_t offset)
+ pcm_play_lock();
+ /* Makes no difference if it's stopped */
+ channels[channel].start += offset;
+ pcm_play_unlock();
/* Stop ALL channels and PCM and reset state */
void mixer_reset(void)