summaryrefslogtreecommitdiff
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/drivers/uda1380.c4
-rw-r--r--firmware/pcm_playback.c15
2 files changed, 9 insertions, 10 deletions
diff --git a/firmware/drivers/uda1380.c b/firmware/drivers/uda1380.c
index 07e92e7bba..1636f13365 100644
--- a/firmware/drivers/uda1380.c
+++ b/firmware/drivers/uda1380.c
@@ -53,7 +53,7 @@ unsigned short uda1380_defaults[2*NUM_DEFAULT_REGS] =
REG_MASTER_VOL, MASTER_VOL_LEFT(0x20) | MASTER_VOL_RIGHT(0x20), /* 00=max, ff=mute */
REG_MIX_VOL, MIX_VOL_CH_1(0) | MIX_VOL_CH_2(0xff), /* 00=max, ff=mute */
REG_EQ, EQ_MODE_MAX, /* Bass and tremble = 0 dB */
- REG_MUTE, MUTE_MASTER, /* Mute everything to start with */
+ REG_MUTE, MUTE_MASTER | MUTE_CH2, /* Mute everything to start with */
REG_MIX_CTL, MIX_CTL_MIX, /* Enable mixer */
REG_DEC_VOL, 0,
REG_PGA, MUTE_ADC,
@@ -158,8 +158,6 @@ void uda1380_enable_output(bool enable)
{
if (enable) {
uda1380_write_reg(REG_PWR, uda1380_regs[REG_PWR] | PON_HP);
- /* 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);
diff --git a/firmware/pcm_playback.c b/firmware/pcm_playback.c
index 03afdace0a..6f395a58e2 100644
--- a/firmware/pcm_playback.c
+++ b/firmware/pcm_playback.c
@@ -248,7 +248,7 @@ void pcm_play_data(const unsigned char* start, int size,
dma_start(start, size);
/* Sleep a while, then unmute audio output */
- sleep(1);
+ sleep(HZ/8);
uda1380_mute(false);
}
@@ -353,8 +353,14 @@ void pcm_init(void)
ICR4 = (ICR4 & 0xffff00ff) | 0x00001c00;
IMR &= ~(1<<14); /* bit 14 is DMA0 */
- pcm_play_init();
pcm_set_frequency(44100);
+
+ /* Turn on headphone power with audio output muted. */
+ uda1380_mute(true);
+ sleep(HZ/4);
+ uda1380_enable_output(true);
+
+ pcm_play_init();
}
void pcm_play_set_watermark(int numbytes, void (*callback)(int bytes_left))
@@ -699,11 +705,6 @@ 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)