Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: rangi_chip on November 06, 2008, 02:02:43 PM

Title: Screen dim whiling booting Apple OS
Post by: rangi_chip on November 06, 2008, 02:02:43 PM
Hey guys,

I noticed, that when I boot into the Apple OS, the screen is fairly dim. When I say 'fairly dim' what I mean is it is half way between being bright and dim when running the Apple OS.

Lets say, for example, when using the Apple OS, the screen is at 100% brightness, while using the buttons and scrolling.
When you don't touch any buttons or scroll (after the backlight timer has run out) the screen turns dim, lets say 10% brightness.

Now, when booting into the Apple OS using the RB bootloader (hold switch ON), the screen is at about 40% brightness. Once it has booted into the Apple OS, the screen will continue to stay at this 40% brightness level while you're using the buttons and scrolling.
The only thing that undoes it (resets it), is if you don't touch any buttons or scroll and let it revert to its original dim (10%) state.
Now when you use the buttons again, it's back to 100% brightness (and 10% brightness when not touched) and will continue this way until you reboot in the Apple OS again, in which case this process starts again.

Anyone else noticed this?
Title: Re: Screen dim whiling booting Apple OS
Post by: Chronon on November 06, 2008, 03:04:34 PM
I haven't used an iPod in quite a while, but I can't say I recall this behavior.  The Rockbox bootloader shouldn't cause any effects to the Apple firmware since, as far as I understand, it just launches the Apple firmware code if the hold switch is engaged (i.e. it shouldn't do any changes to the state of the hardware).  I'm not sure how to explain what you're seeing.  We'll see if other iPod users experience this or not.
Title: Re: Screen dim whiling booting Apple OS
Post by: rangi_chip on November 06, 2008, 03:48:49 PM
Thanks for the reply.

If I uninstall the RB bootloader using ipodpatcher and boot my Apple OS, it boots up with 100% brightness and runs fine.

As soon as I put the RB bootloader back on, it changes...

I thought that the RB bootloader simply calls the Apple firmware too.
But obviously something's changed with the RB bootloader...
Title: Re: Screen dim whiling booting Apple OS
Post by: Llorean on November 06, 2008, 04:22:17 PM
The bootloader also initializes hardware. It's possible that the Apple firmware just assumes that by the time it has control the backlight will already be at the right brightness, so if the bootloader's setting it dimmer, the Apple firmware might leave it untouched until it needs to change the brightness.

Though I don't remember the Rockbox bootloader having a dim backlight, I'm not using the absolute latest one.
Title: Re: Screen dim whiling booting Apple OS
Post by: rangi_chip on November 06, 2008, 05:15:39 PM
That's sounds reasonable to me  ;)

How would i go about adjusting the backlight in the ipod.c file? I know may way around it and can compile a bootloader...

I just need to know what to change and what to change it to.
Title: Re: Screen dim whiling booting Apple OS
Post by: rangi_chip on November 13, 2008, 02:09:38 PM
I figured it out...

Code: [Select]
#ifndef HAVE_BACKLIGHT_INVERSION
    backlight_init(); /* Turns on the backlight */
#endif
This was the code that was giving me trouble.

Doing away with all three lines fixed the problem.
Title: Re: Screen dim whiling booting Apple OS
Post by: LambdaCalculus on November 13, 2008, 02:19:11 PM
Want to post a patch onto Flyspray for your fix?
Title: Re: Screen dim whiling booting Apple OS
Post by: Llorean on November 13, 2008, 02:23:41 PM
That's not simply "just strange". The #ifndef / #endif pair are removed by the preprocessor anyway, so removing all the code should result in a functionally identical binary to just removing the one line.

Given that, you should probably investigate what's actually going wrong instead of coming up with hacked fixes that "work" but we don't know why, because we have no way of knowing if they're the right fix.
Title: Re: Screen dim whiling booting Apple OS
Post by: rangi_chip on November 13, 2008, 09:05:37 PM
Sorry Llorean, I had muddled my bootloaders up. It wasn't as i said  :-[

It was the "backlight_init();" that was incorrect, so doing away with this line of code corrects the problem.
Doing away with the #ifndef / #endif aswell works too. My bad.
Title: Re: Screen dim whiling booting Apple OS
Post by: Llorean on November 13, 2008, 09:12:03 PM
So the next step is determining what's wrong within backlight_init();

My guess is still as it was earlier, that backlight init is just setting the backlight to a dim value, then when the Apple OS boots it doesn't re-set the brightness to a new value until after it dims the first time.
Title: Re: Screen dim whiling booting Apple OS
Post by: rangi_chip on November 13, 2008, 09:32:40 PM
Yes, I agree with that.

I took that code out, and it works fine. I boot into RB and the backlight is fine too.

If it means anything, my Apple firmware is modded...
Would that make a difference?

I guess I could try the original Apple firmware and see if it has the same problem.

Does no one else have this problem?
Title: Re: Screen dim whiling booting Apple OS
Post by: soap on November 14, 2008, 07:02:23 AM
If it means anything, my Apple firmware is modded...
Would that make a difference?
You're seeing unreported behavior on a popular player and believe the problem is with an old piece of code, yet you're uncertain if your modded test platform is a factor?
Title: Re: Screen dim whiling booting Apple OS
Post by: linuxstb on November 14, 2008, 09:36:27 AM
Which ipod are you using?   Different ipods have different backlight handling.
Title: Re: Screen dim whiling booting Apple OS
Post by: rangi_chip on November 16, 2008, 01:15:03 PM
I'm using a 5.5G 80GB iPod...