Zink
Member
- Joined
- Mar 8, 2012
- Messages
- 170
There is a bug, reported long time ago, but never fixed: if the lid close action is set to "Turn off the screen", then when the lid is closed on a powered on Pandora, the screen gets turned off as intended. But after the automatic screen blanking period (around 15 minutes, I think) if a shoulder button is pressed, the screen turns on and will never go off again (until the lid is opened and closed again).
This is somewhat annoying for people listening to audio on Pandora, as when Pandora is in a pocket, the shoulder buttons can get easily pressed by accident, significantly lowering the battery life (not mentioning the backlight life).
And it just got unbearably annoying, as I have found a way to bind the right shoulder button to DeaDBeeF's pause function (after 3 years!), so I can pause playing without taking Pandora out of the pocket. But when I press the shoulder button, the screen goes on, and won't turn off by itself!
So my approach was this:
1. The /usr/pandora/scripts/op_power.sh file defines what happens to the backlight in various situations. There is a function display_on(), which does what its name says, so it should be enough to add a simple check whether the lid is up, and do nothing if it isn't.
2. But there is a problem: no easy way to check the current state of the lid.
3. So I have written this simple program, lidstate, that will echo 0 or 1 depending on the current lid state (source and binary attached).
4. Then I have added the following code to the dislpay_on() function:
if [ $(lidstate) = "1" ]; then
return 0
fi
And this works, but has a bad side effect: if the lid is down for more than 15 minutes, opening it won't turn on the screen. Nor will pressing any buttons, or moving the nubs. I have to close the lid again, and open it for the second time to make the screen lit. I don't understand why that is. If you have any ideas, please tell.
I would like to debug it, but I don't know how. the op_power.sh file contains some debug echos, and I tried adding my own echos, but I don't know where the output from the echo goes. I can't see it on the terminal. How can I display anything from the scripts when they are called by the system?
This is somewhat annoying for people listening to audio on Pandora, as when Pandora is in a pocket, the shoulder buttons can get easily pressed by accident, significantly lowering the battery life (not mentioning the backlight life).
And it just got unbearably annoying, as I have found a way to bind the right shoulder button to DeaDBeeF's pause function (after 3 years!), so I can pause playing without taking Pandora out of the pocket. But when I press the shoulder button, the screen goes on, and won't turn off by itself!
So my approach was this:
1. The /usr/pandora/scripts/op_power.sh file defines what happens to the backlight in various situations. There is a function display_on(), which does what its name says, so it should be enough to add a simple check whether the lid is up, and do nothing if it isn't.
2. But there is a problem: no easy way to check the current state of the lid.
3. So I have written this simple program, lidstate, that will echo 0 or 1 depending on the current lid state (source and binary attached).
4. Then I have added the following code to the dislpay_on() function:
if [ $(lidstate) = "1" ]; then
return 0
fi
And this works, but has a bad side effect: if the lid is down for more than 15 minutes, opening it won't turn on the screen. Nor will pressing any buttons, or moving the nubs. I have to close the lid again, and open it for the second time to make the screen lit. I don't understand why that is. If you have any ideas, please tell.
I would like to debug it, but I don't know how. the op_power.sh file contains some debug echos, and I tried adding my own echos, but I don't know where the output from the echo goes. I can't see it on the terminal. How can I display anything from the scripts when they are called by the system?