I'm using a CompactFlash card.
If you don't have problems you probably shouldn't change anything. Looking at the code Rockbox seems to actually cut off power as the function is called ata_power_down(). My problem was that my ipod classic was taking time to get the next track and it was annoying. My guess is that once the buffer is filled rockbox calls ata_spindown() or ata_sleep() which leads to ata_power_down() being triggered earlier.
I commented out lines 1207-1210 of firmware/target/arm/s5l8702/ipod6g/storage_ata-ipod6g.c
"create_thread(ata_thread, ata_stack,
sizeof(ata_stack), 0, "ATA idle monitor"
IF_PRIO(, PRIORITY_USER_INTERFACE)
IF_COP(, CPU));"
So as you can see, it's an idle monitor thread. To put it simply, threads allow programs to do a bit of multitasking. (To be honest, I'm not that great at threads but I have written a few projects dealing with them so I have a basic understanding of how they work with mutexes and race conditions, etc.) The function for the thread is called ata_thread. So let's go look at that.
"static void ata_thread(void)
{
while (true)
{
mutex_lock(&ata_mutex);
if (TIME_AFTER(current_tick, ata_last_activity_value + ata_sleep_timeout) && ata_powered)
{
call_storage_idle_notifys(false);
ata_power_down();
}
mutex_unlock(&ata_mutex);
sleep(HZ / 2);
}
}"
So basic rundown of what the ata_thread function does.
Acquires the lock, which blocks any other thread from acquiring the lock until it's released.
After that, it checks to see if it's past the time the ipod was last active + the sleep timeout and if the drive is powered on
If so, then it calls ata_power_down()
It releases the lock
Then it sleeps for a certain period of time.
The ata_power_down() function is a little long, but as far as I can tell it does some writing to disk (the method depending on whether it's a CE-ATA drive, the original one that came with the ipod, or not). It does some direct operations on memory. Then it sends a boolean value of false to ide_power_enable(), which seems to set a flag to false, and then calls another function pmu_hdd_enable (pmu = power management unit), which calls a function dealing with the i2c bus which writes a 0 to a certain memory address.
So I don't understand the full extent of everything that's going on, but I get the gist that ata_power_down() is powering down the drive, and that doesn't need to be done for a CF card. If you're actually using a SSD drive, it's probably better to not change anything. Looking at the
runtimes, the mSATA is actually the worst. He does comment that several 256GB drives have runtimes approaching that of the HDD, which means the power consumption is around the same as the HDD. CF is comparable to SDXC, if you look at
this thread. CF pretty much has the highest runtime out of all the choices, but the least amount of space.