Basic power management consists of things like implementing boosting (so that the CPU clock is low most of the time and increases only when the PCM buffer gets low), implementing sleep functions for various peripherals (so that flash memory, the LCD controller and others can be switched off when not being actively used), and turning off any unneeded clocks/hardware/voltages. However, since you're running on top of the stock kernel, some of these may already be implemented by the host OS. Do you know how power management is handled in the stock music app? Are there APIs for controlling the CPU clock and storage controller, or do you have direct access to this hardware?
1. I implemented CPU scaling in the kernel, and this is already working well.
2. The sleep for various peripherals uhm uhm. Something is surely managed by the kernel, others don't know.
3. The stock music app is more than a simple application as already said. yes it has direct access for quite all the things.
4. CPU clock is controlled by the usual way in linux. Storage controllers too (so tipical mount/unmount). I guess power management is already implemented thus.
Okay this is the power save part.
The other part that I'm interestend into, is the battery levels management. We use AS3543 codec. So code is quite already done, but I cannot manage to make it work because I don't have a right idea on how this is managed at all (ie: standard api calls for rb...)
EDIT:
was digging for the radio thing. I guess that the samsung module for it has no direct acess to registers via ioctl, only some common functions like set frequency etc. But since this is already implemented in RB, a good way to workaround that is to reverse the module initialization and build another one with only register read/write capability. But don't know if I am able to do this
OR, alternately I could try guessing the ioctl structures (as I did with ascodec) till to be able to use these functions (ioctl codes that I reversed)
si470x.ko -> radio
dev -> /dev/si470x
0xA -> seek
0xD -> RSSI info (
)
0xC -> set rds
0x8 -> set signal level???
0x4 | 0x6 -> set radio region
0x1 -> get frequency
0x2 -> set frequency
0x0 -> close radio
EDIT2: I was also looking for the ARM optimizations. I just discovered that they are enabled on maemo build. So as an application they are working.
I just wonder why, after enabling this:
#elif (CONFIG_CPU == IMX31L) \
|| ((CONFIG_PLATFORM & PLATFORM_MAEMO4) && defined(MAEMO_ARM_BUILD) \
|| (CONFIG_PLATFORM & PLATFORM_YPR0))
#define CPU_ARM
#define ARM_ARCH 6 /* ARMv6 */
I get this "strange" error:
make: *** No rule to make target `/home/lorenzo/YP-R0_DEV/rockbox/rockbox/build/pcm-mixer-armv6.c', needed by `/home/lorenzo/YP-R0_DEV/rockbox/rockbox/build/firmware/pcm_mixer.o'. Stop.
As you can see it doesn't find the file because it points to the wrong path :S Any idea?
Last question for this post (sorry but time is limited so I need to exploit it at better), since a while (don't remeber exactly after what) there is a bad issue with the back key. In some context (like exiting a plugin or wps), pressing the back key will produce a "double" press uhm uhm