From 8291cd76de8ee3797ca01ebeffee176d0177b353 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Thu, 8 May 2008 21:36:50 +0000 Subject: [PATCH] Fix the short audio dropout at disk spinup from power-off on portalplayer targets (observed on Mini G2, probably affected others as well). git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17426 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/ata.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/firmware/drivers/ata.c b/firmware/drivers/ata.c index 397cb9ac82..2dca17512e 100644 --- a/firmware/drivers/ata.c +++ b/firmware/drivers/ata.c @@ -1022,7 +1022,15 @@ static int ata_power_on(void) int rc; ide_power_enable(true); - sleep(HZ/50); /* allow voltage to build up */ + sleep(HZ/4); /* allow voltage to build up */ + + /* Accessing the PP IDE controller too early after powering up the disk + * makes the core hang for a short time, causing an audio dropout. This + * also depends on the disk; iPod Mini G2 needs at least HZ/5 to get rid + * of the dropout. Since this time isn't additive (the wait_for_bsy() in + * ata_hard_reset() will shortened by the same amount), it's a good idea + * to do this on all HDD based targets. */ + if( ata_hard_reset() ) return -1; @@ -1235,7 +1243,7 @@ int ata_init(void) if (!ide_powered()) /* somebody has switched it off */ { ide_power_enable(true); - sleep(HZ/50); /* allow voltage to build up */ + sleep(HZ/4); /* allow voltage to build up */ } /* first try, hard reset at cold start only */