diff options
author | Solomon Peachy <pizza@shaftnet.org> | 2020-10-03 19:38:45 -0400 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2020-10-03 20:12:31 -0400 |
commit | 7642184fd9cdad3651d29e69cd1dff6f27c76946 (patch) | |
tree | aff153c1fc7083c76bba263ceba969eac28e38fd | |
parent | 80c3b84e08a1debc0e5af8567f9eeb0b1716303a (diff) | |
download | rockbox-7642184fd9cdad3651d29e69cd1dff6f27c76946.tar.gz rockbox-7642184fd9cdad3651d29e69cd1dff6f27c76946.zip |
alsa: Refactor pcm_dma_apply_settings_nolock()
Change-Id: I32190e6987afca99b24197ca7ae2853053062d30
-rw-r--r-- | firmware/target/hosted/pcm-alsa.c | 21 |
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) | ||
519 | static void pcm_dma_apply_settings_nolock(void) | 518 | static 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 | ||
533 | static 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 | ||
546 | void pcm_dma_apply_settings(void) | 539 | void pcm_dma_apply_settings(void) |
547 | { | 540 | { |