From daef425c5946651408b0ac496955bc07e2bdf632 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sat, 28 Mar 2026 08:14:52 -0400 Subject: [PATCH] pcm_mixer: Get default sample rate from pcm layer. Change-Id: I6eccb37556e70f23112bbb0e26f4a45ac0930245 --- firmware/pcm_mixer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/firmware/pcm_mixer.c b/firmware/pcm_mixer.c index d36560f149..92da971fb1 100644 --- a/firmware/pcm_mixer.c +++ b/firmware/pcm_mixer.c @@ -33,7 +33,7 @@ before the last samples are sent to the codec and so things are done in parallel (as much as possible) with sending-out data. */ -static unsigned int mixer_sampr = HW_SAMPR_DEFAULT; +static unsigned int mixer_sampr = -1UL; static unsigned int mix_frame_size = MIX_FRAME_SAMPLES*4; /* Define this to nonzero to add a marker pulse at each frame start */ @@ -266,7 +266,10 @@ static void mixer_start_pcm(void) #endif /* Requires a shared global sample rate for all channels */ - pcm_set_frequency(mixer_sampr); + if (mixer_sampr == -1UL) + mixer_sampr = pcm_get_frequency(); + else + pcm_set_frequency(mixer_sampr); /* Prepare initial frames and set up the double buffer */ mixer_buffer_callback(PCM_DMAST_STARTED);