patjak / mba6x_bl

MacBook Air 6,1 and 6,2 (mid 2013) backlight driver
GNU General Public License v2.0
125 stars 21 forks source link

mba6x_bl always stays dark after suspend/blank event #9

Closed oliv3r closed 10 years ago

oliv3r commented 10 years ago

Using XUbunutu 14.04 I ran into the issue that after suspend or 'blank screen', the image is always black. Really hard to enter a password. Using the keyboard shortcuts, but only After logging in (authorisation issue i'm sure for accessing the sysfs interface) I have to lower the brightness 1 notch to get the backlight going again. Going a notch up doesn't change a thing. Doing a 'down/up' toggle makes the BL work fine. I tried to see what could cause this but so far, no luck yet ...

patjak commented 10 years ago

Hi, at the login screen you can probably not change the brightness because the hotkeys are not active. At least they are not on my Ubuntu Desktop install. When the screen goes on after suspend it should be restored to the previous value but I suspect that something is interfering with the restore (perhaps the Intel driver). Have you tried the latest code from the repo or are you using an older DKMS package?

oliv3r commented 10 years ago

I initially used the dkms, but wanted to make some modifications, so I switched to the current git head.

The only modification I made actually is the following:

this because the list of probed sysfs interfaces for xfce4 contains mbp, but not (obviously) mba6x.

The hotkeys not being available sounds reasonable, but having a dark screen makes it almost unworkable :( the brightness value seems to stick though, i'll do some more sysfs debugging when I have my external monitor connected again on monday.

On 12-04-14 09:13, Patrik Jakobsson wrote:

Hi, at the login screen you can probably not change the brightness because the hotkeys are not active. At least they are not on my Ubuntu Desktop install. When the screen goes on after suspend it should be restored to the previous value but I suspect that something is interfering with the restore (perhaps the Intel driver). Have you tried the latest code from the repo or are you using an older DKMS package?

— Reply to this email directly or view it on GitHub https://github.com/patjak/mba6x_bl/issues/9#issuecomment-40273811.

patjak commented 10 years ago

Hmm, sound like the sane thing for xfce4 to do is to probe all the sysfs backlight entries.

Anyhow, could you try to ssh into the box while the screen is black and set the backlight manually through sysfs. If that works, one hack to fix this could be to delay the resume so that whatever is touching the LP8550 is finished and we can override it again. But that would certainly be a hack and not very nice.

oliv3r commented 10 years ago

With the mba6x_bl driver, writing the exact same value as the actual_brightness shows, brings the screen back to life. So my first hunch is, that in the suspend/resume functions the actual value should be stored/restored.

On 13-04-14 19:59, Patrik Jakobsson wrote:

Hmm, sound like the sane thing for xfce4 to do is to probe all the sysfs backlight entries.

Anyhow, could you try to ssh into the box while the screen is black and set the backlight manually through sysfs. If that works, one hack to fix this could be to delay the resume so that whatever is touching the LP8550 is finished and we can override it again. But that would certainly be a hack and not very nice.

— Reply to this email directly or view it on GitHub https://github.com/patjak/mba6x_bl/issues/9#issuecomment-40314288.

patjak commented 10 years ago

Sorry for late reply, I've been busy. I played around with the resume hook yesterday and found out that it's broken on my system. I cannot make any ACPI calls at all in resume so it always fails. The weird thing is that backlight comes back up anyway so something else must be going on here. I'm currently looking into this.

patjak commented 10 years ago

I've pushed some updates that you can try. Please report back if it fixes your problem.

directrandom commented 10 years ago

Same story with KDE.

patjak commented 10 years ago

I have some ideas that I'll try next week. We're probably racing with something on the SMBUS.

patjak commented 10 years ago

@directrandom @oliv3r Please try the current version and see if your problems are fixed.

drgonzo1881 commented 10 years ago

The mutex you used, seems to have fixed the problem. After "systemctl hybrid-sleep" and wake up, the module still works now, and i am able to adjust the brightness as before the sleep. Thumb up for your work!

patjak commented 10 years ago

That's good. to hear Let's hope this works for all of you. I'm closing the issue but feel free to reopen if you're still having problems.