forked from len0rd/rockbox
Fixed pops from headphone audio output.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6977 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
cea09fa139
commit
45d6fa916c
2 changed files with 16 additions and 9 deletions
|
|
@ -158,10 +158,8 @@ void uda1380_enable_output(bool enable)
|
|||
{
|
||||
if (enable) {
|
||||
uda1380_write_reg(REG_PWR, uda1380_regs[REG_PWR] | PON_HP);
|
||||
|
||||
/* Sleep a while, then disable the master mute */
|
||||
sleep(HZ/8);
|
||||
uda1380_write_reg(REG_MUTE, MUTE_CH2);
|
||||
/* Don't unmute audio output here */
|
||||
// uda1380_write_reg(REG_MUTE, MUTE_CH2);
|
||||
} else {
|
||||
uda1380_write_reg(REG_MUTE, MUTE_MASTER);
|
||||
uda1380_write_reg(REG_PWR, uda1380_regs[REG_PWR] & ~PON_HP);
|
||||
|
|
|
|||
|
|
@ -247,9 +247,9 @@ void pcm_play_data(const unsigned char* start, int size,
|
|||
get_more(&next_start, &next_size);
|
||||
dma_start(start, size);
|
||||
|
||||
/* Sleep a while, then power on audio output */
|
||||
sleep(HZ/16);
|
||||
uda1380_enable_output(true);
|
||||
/* Sleep a while, then unmute audio output */
|
||||
sleep(1);
|
||||
uda1380_mute(false);
|
||||
}
|
||||
|
||||
void pcm_play_stop(void)
|
||||
|
|
@ -257,9 +257,9 @@ void pcm_play_stop(void)
|
|||
crossfade_active = false;
|
||||
pcm_set_boost_mode(false);
|
||||
if (pcm_playing) {
|
||||
uda1380_enable_output(false);
|
||||
uda1380_mute(true);
|
||||
pcm_boost(false);
|
||||
sleep(HZ/16);
|
||||
sleep(1);
|
||||
dma_stop();
|
||||
}
|
||||
}
|
||||
|
|
@ -277,10 +277,14 @@ void pcm_play_pause(bool play)
|
|||
IIS2CONFIG = (pcm_freq << 12) | 0x300 | 4 << 2;
|
||||
EBU1CONFIG = 7 << 12 | 3 << 8 | 5 << 2;
|
||||
DCR0 |= DMA_EEXT | DMA_START;
|
||||
sleep(1);
|
||||
uda1380_mute(false);
|
||||
}
|
||||
else if(!pcm_paused && !play)
|
||||
{
|
||||
logf("pause");
|
||||
uda1380_mute(true);
|
||||
|
||||
/* Disable DMA peripheral request. */
|
||||
DCR0 &= ~DMA_EEXT;
|
||||
IIS2CONFIG = 0x800;
|
||||
|
|
@ -695,6 +699,11 @@ void pcm_play_init(void)
|
|||
crossfade_active = false;
|
||||
crossfade_init = false;
|
||||
pcm_event_handler = NULL;
|
||||
|
||||
/* Turn on headphone power with audio output muted. */
|
||||
uda1380_mute(true);
|
||||
sleep(HZ/4);
|
||||
uda1380_enable_output(true);
|
||||
}
|
||||
|
||||
void pcm_crossfade_enable(bool on_off)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue