Repository navigation
Description
[ 165.533763] rpi-backlight rpi_backlight: Backlight change failed
[ 167.085803] rpi-backlight rpi_backlight: Backlight change failed
[ 168.281433] rpi-backlight rpi_backlight: Backlight change failed
[ 169.628353] rpi-backlight rpi_backlight: Backlight change failed
[ 169.742678] rpi-backlight rpi_backlight: Backlight change failed
Linux screenpi 4.1.12-v7+ #824 SMP PREEMPT Wed Oct 28 16:46:35 GMT 2015 armv7l GNU/Linux
I have an application controling the backlight via the
/sys/class/backlight/rpi_backlight/bl_power
Powering off writing 4 into the file seems reliable however power on fails.
I can sometime prod it into life via echoing more stuff into the file manually but its not reliable.
val = level == 0 and "4" or "0"
if self:getSettings()["backlight"] and (not only or only == "backlight") then
dirNodeSetValue("/sys/class/backlight","bl_power",val,skipbacklight)
end
end
function dirNodeSetValue(dir,node,val,skip)
for entry in lfs.dir(dir) do repeat
local entrydir = dir.."/"..entry
if skip and skip[entry] then
break
end
local entrymode = lfs.attributes(entrydir, "mode")
log:debug("dirNodeSetValue: ",entrydir," is ", entrymode)
if entry:match("^%.") or (entrymode ~= "directory") then
break
end
local fblank = entrydir.."/"..node
local mode = lfs.attributes(fblank,"mode")
log:debug("dirNodeSetValue: ",fblank," mode is ", mode)
if mode == "file" then
local fh = io.open(fblank,"w")
if fh then
log:info("dirNodeSetValue: ",fblank," to ",val)
fh:write(val)
fh:flush()
fh:close()
end
end
break -- oddness as we are in a double loop
until true end
end
Code works on gpio_backlight for fbtft displays (adafruit28rt).
Activity
[-]Switching on baclight [/-][+]Switching on baclkight[/+][-]Switching on baclkight[/-][+]Switching on backlight[/+]P33M commentedon Oct 31, 2015
There's a known bug with the firmware glue switching the DSI backlight. A fix is in the patch queue.
pssc commentedon Oct 31, 2015
Ok thanks, will retest then as soon as its pushed out...
firmware: rpi_display: fix backlight ratelimiting on STC rollover
popcornmix commentedon Nov 1, 2015
Firmware is pushed. Please test after running rpi-update.
firmware: rpi_display: fix backlight ratelimiting on STC rollover
pssc commentedon Nov 1, 2015
@popcornmix one on off cycle then off and back to:-
And if i leave it a while it seems to toggle again sometimes
P33M commentedon Nov 2, 2015
You're switching the backlight at a fast interval. I can see two entries in the log that are less than 500ms apart.
Switching the backlight on and off that quickly will hit the ratelimit built into the firmware.
Is the issue still present if your do .. until loop incorporates a ~1 second delay?
pssc commentedon Nov 2, 2015
@P33M I am triggering on a key press (activating soft off), I left the install overnight and tired triggering again no joy, I am also toggling the frame buffer blanking? at the same time. Even if it skips a setting it should fix after a pause and timer reset, is that rate limit there for any real reason? and as said this code path works fine for backlights provided via gpio_backlight and fbtft,
I will go back and generate an a application log and corresponding kernel log a am fairly sure that I only wrote once in a second to the sysfs bl power file but i didn't save the logs.
Phill.
P33M commentedon Nov 2, 2015
Setting framebuffer blanking as well as backlight power is unnecessary - blanking the fb will turn off the backlight.
pssc commentedon Nov 2, 2015
@P33M ok yes that's probably whats causing the backlight setting in rapid succession though it really should recover gracefully as left overnight and just switching on failed? i am not sure if toggling the blanking on a fbtft frame buffer toggles the bl(and not all display have bl control) which is why the codes in there for the blanking and of course blanking the HDMI output before calling vcgencmd display_power to cause HDMI screen power saving.
P33M commentedon Nov 2, 2015
Part of the problem is that it appears the linux-side expects a backlight change to never fail - the backlight update function can return a value, but this value is ignored by the framebuffer update.
c.f. http://lxr.free-electrons.com/source/drivers/video/backlight/backlight.c#L40
Therefore there's the possibility that the backlight state and framebuffer blank/unblank could get out of sync until the next time the backlight is set.
I'll think about this a bit more.
pssc commentedon Nov 2, 2015
@P33M something doesn't smell right in my case I am setting blank and power off then unblank and poweron, so it shouldn't matter that the second op failed as it would be set to the same state by either call...
I am doing a complete open close for each file toggle and not keeping the descriptor open.
P33M commentedon Nov 2, 2015
Hm. That's right actually - even with the limit you should still be seeing the backlight actually switch state.
Can you post the full script you use so I can replicate the behaviour?
69 remaining items
GreenEyes2796 commentedon Mar 13, 2017
I should add that the sometimes the screen will not wake up on touch or keyboard, but then a few minutes later it seems to work fine.
popcornmix commentedon Mar 13, 2017
@GreenEyes2796 what does
vcgencmd versionreport for you?GreenEyes2796 commentedon Mar 13, 2017
Nov 25 2016 16:03:50
Copyright (c) 2012 Broadcam
version (long hex string) (clean) (releases)
Do you need the hex string version number? Thanks
popcornmix commentedon Mar 13, 2017
Your firmware is too old. The dist-upgrade version should be newer than that (with a March date).
GreenEyes2796 commentedon Mar 13, 2017
Hmm. Just ran update and upgrade again and the version did not change. Known working internet connection. Any idea why I'm stuck in Nov. 2016?
popcornmix commentedon Mar 13, 2017
I assume you rebooted after updating?
Have you ever run rpi-update or otherwise manually updated firmware?
You could try:
GreenEyes2796 commentedon Mar 13, 2017
Yes. Did reboot after update and dist-upgrade.
I'll try your reinstall.
GreenEyes2796 commentedon Mar 13, 2017
It failed. I think all the dist-upgrades are failing, Maybe I should just download a current distribution?
popcornmix commentedon Mar 13, 2017
Yes, I think installing the latest raspbian jessie image is probably advisable.
Something is wrong on your image. It may be possible to fix it, but that will probably be harder than reinstalling, and you'll never know if you have fixed everything.
GreenEyes2796 commentedon Mar 13, 2017
GreenEyes2796 commentedon Mar 14, 2017
bonding: fix suspicious RCU usage in bond_ipsec_offload_ok()
bonding: fix suspicious RCU usage in bond_ipsec_offload_ok()
bonding: fix suspicious RCU usage in bond_ipsec_offload_ok()