1
0
Fork 0
forked from len0rd/rockbox

Removed muting from pcm buffer during starts, stops and pauses for tlv320 and uda1380. Far less in the way of pops now. Voice during FM radio playback keeps radio steady. If it is determined that other audio codecs don't benefit from this remove the muting code and defines altogether. Saving the state and not resetting more than needed seems to prevent popping more effectively than muting at DMA starts and stops. Voice can click a little if truncating a clip (not annoyingly though) but that should be handled by a DSP fade out over a few ms instead-- a side benefit would be a general DSP fade rather than using volume control.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11538 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Sevakis 2006-11-16 05:33:42 +00:00
parent ef35bb9d47
commit bf65676226

View file

@ -37,6 +37,13 @@
#include "dsp.h"
#include "thread.h"
/* Define PCMBUF_MUTING if the codec requires muting to prevent pops
* Currently assumes anything other than tlv320 and uda1380 require it
*/
#if !defined(HAVE_UDA1380) && !defined(HAVE_TLV320)
#define PCMBUF_MUTING
#endif
/* Keep watermark high for iPods at least (2s) */
#define PCMBUF_WATERMARK (NATIVE_FREQUENCY * 4 * 2)
@ -333,9 +340,13 @@ void pcmbuf_play_stop(void)
{
/** Prevent a very tiny pop from happening by muting audio
* until dma has been initialized. */
#ifdef PCMBUF_MUTING
pcm_mute(true);
#endif
pcm_play_stop();
#ifdef PCMBUF_MUTING
pcm_mute(false);
#endif
pcmbuf_unplayed_bytes = 0;
pcmbuf_mix_chunk = NULL;
@ -413,11 +424,15 @@ size_t pcmbuf_get_bufsize(void)
}
void pcmbuf_pause(bool pause) {
#ifdef PCMBUF_MUTING
if (pause)
pcm_mute(true);
pcm_mute(true);
#endif
pcm_play_pause(!pause);
#ifdef PCMBUF_MUTING
if (!pause)
pcm_mute(false);
#endif
trigger_cpu_boost();
}
@ -426,9 +441,11 @@ void pcmbuf_play_start(void)
{
if (!pcm_is_playing() && pcmbuf_unplayed_bytes)
{
#ifdef PCMBUF_MUTING
/** Prevent a very tiny pop from happening by muting audio
* until dma has been initialized. */
pcm_mute(true);
#endif
if (pcmbuf_read != NULL)
{
@ -438,8 +455,10 @@ void pcmbuf_play_start(void)
(unsigned char *)pcmbuf_read->addr, last_chunksize);
}
#ifdef PCMBUF_MUTING
/* Now unmute the audio. */
pcm_mute(false);
#endif
}
}