mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 21:22:39 -05:00
alsa: Refactor pcm_dma_apply_settings_nolock()
Change-Id: I32190e6987afca99b24197ca7ae2853053062d30
This commit is contained in:
parent
80c3b84e08
commit
7642184fd9
1 changed files with 13 additions and 20 deletions
|
|
@ -515,33 +515,26 @@ void pcm_play_unlock(void)
|
||||||
#endif
|
#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
|
|
||||||
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)
|
static void pcm_dma_apply_settings_nolock(void)
|
||||||
{
|
{
|
||||||
logf("PCM DMA Settings %d %d", sample_rate, pcm_sampr);
|
logf("PCM DMA Settings %d %d", sample_rate, pcm_sampr);
|
||||||
|
|
||||||
snd_pcm_drop(handle);
|
if (sample_rate != pcm_sampr)
|
||||||
set_hwparams(handle);
|
{
|
||||||
|
#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);
|
||||||
#if defined(HAVE_NWZ_LINUX_CODEC)
|
#if defined(HAVE_NWZ_LINUX_CODEC)
|
||||||
/* Sony NWZ linux driver uses a nonstandard mecanism to set the sampling rate */
|
/* Sony NWZ linux driver uses a nonstandard mecanism to set the sampling rate */
|
||||||
audiohw_set_frequency(pcm_sampr);
|
audiohw_set_frequency(pcm_sampr);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* (Will be unmuted by pcm resuming) */
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void pcm_dma_apply_settings(void)
|
void pcm_dma_apply_settings(void)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue