summaryrefslogtreecommitdiffstats
path: root/firmware/target
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-10-03 19:38:45 -0400
committerSolomon Peachy <pizza@shaftnet.org>2020-10-03 20:12:31 -0400
commit7642184fd9cdad3651d29e69cd1dff6f27c76946 (patch)
treeaff153c1fc7083c76bba263ceba969eac28e38fd /firmware/target
parent80c3b84e08a1debc0e5af8567f9eeb0b1716303a (diff)
downloadrockbox-7642184fd9cdad3651d29e69cd1dff6f27c76946.tar.gz
rockbox-7642184fd9cdad3651d29e69cd1dff6f27c76946.zip
alsa: Refactor pcm_dma_apply_settings_nolock()
Change-Id: I32190e6987afca99b24197ca7ae2853053062d30
Diffstat (limited to 'firmware/target')
-rw-r--r--firmware/target/hosted/pcm-alsa.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/firmware/target/hosted/pcm-alsa.c b/firmware/target/hosted/pcm-alsa.c
index 09b4de0e5e..3d91bc18cf 100644
--- a/firmware/target/hosted/pcm-alsa.c
+++ b/firmware/target/hosted/pcm-alsa.c
@@ -515,33 +515,26 @@ void pcm_play_unlock(void)
#endif
}
-#if defined(HAVE_XDUOO_LINUX_CODEC) || defined(HAVE_FIIO_LINUX_CODEC) || defined(HAVE_ROCKER_CODEC)
static void pcm_dma_apply_settings_nolock(void)
{
logf("PCM DMA Settings %d %d", sample_rate, pcm_sampr);
+
if (sample_rate != pcm_sampr)
{
#ifdef AUDIOHW_MUTE_ON_PAUSE
+ // XXX AK4450 (xDuoo X3ii) needs to be muted when switching rates.
audiohw_mute(true);
#endif
snd_pcm_drop(handle);
set_hwparams(handle);
- /* Will be unmuted by pcm resuming */
- }
-}
-#else
-static void pcm_dma_apply_settings_nolock(void)
-{
- logf("PCM DMA Settings %d %d", sample_rate, pcm_sampr);
-
- snd_pcm_drop(handle);
- set_hwparams(handle);
#if defined(HAVE_NWZ_LINUX_CODEC)
- /* Sony NWZ linux driver uses a nonstandard mecanism to set the sampling rate */
- audiohw_set_frequency(pcm_sampr);
+ /* Sony NWZ linux driver uses a nonstandard mecanism to set the sampling rate */
+ audiohw_set_frequency(pcm_sampr);
#endif
+
+ /* (Will be unmuted by pcm resuming) */
+ }
}
-#endif
void pcm_dma_apply_settings(void)
{