summaryrefslogtreecommitdiff
path: root/firmware/target
diff options
context:
space:
mode:
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)
515#endif 515#endif
516} 516}
517 517
518#if defined(HAVE_XDUOO_LINUX_CODEC) || defined(HAVE_FIIO_LINUX_CODEC) || defined(HAVE_ROCKER_CODEC)
519static void pcm_dma_apply_settings_nolock(void) 518static void pcm_dma_apply_settings_nolock(void)
520{ 519{
521 logf("PCM DMA Settings %d %d", sample_rate, pcm_sampr); 520 logf("PCM DMA Settings %d %d", sample_rate, pcm_sampr);
521
522 if (sample_rate != pcm_sampr) 522 if (sample_rate != pcm_sampr)
523 { 523 {
524#ifdef AUDIOHW_MUTE_ON_PAUSE 524#ifdef AUDIOHW_MUTE_ON_PAUSE
525 // XXX AK4450 (xDuoo X3ii) needs to be muted when switching rates.
525 audiohw_mute(true); 526 audiohw_mute(true);
526#endif 527#endif
527 snd_pcm_drop(handle); 528 snd_pcm_drop(handle);
528 set_hwparams(handle); 529 set_hwparams(handle);
529 /* Will be unmuted by pcm resuming */
530 }
531}
532#else
533static void pcm_dma_apply_settings_nolock(void)
534{
535 logf("PCM DMA Settings %d %d", sample_rate, pcm_sampr);
536
537 snd_pcm_drop(handle);
538 set_hwparams(handle);
539#if defined(HAVE_NWZ_LINUX_CODEC) 530#if defined(HAVE_NWZ_LINUX_CODEC)
540 /* Sony NWZ linux driver uses a nonstandard mecanism to set the sampling rate */ 531 /* Sony NWZ linux driver uses a nonstandard mecanism to set the sampling rate */
541 audiohw_set_frequency(pcm_sampr); 532 audiohw_set_frequency(pcm_sampr);
542#endif 533#endif
534
535 /* (Will be unmuted by pcm resuming) */
536 }
543} 537}
544#endif
545 538
546void pcm_dma_apply_settings(void) 539void pcm_dma_apply_settings(void)
547{ 540{