maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   [ANNOUNCE] TV out control home plugin (https://talk.maemo.org/showthread.php?t=68294)

pali 2011-11-16 20:01

Re: [ANNOUNCE] TV out control home plugin
 
I removed code which poll every 5s for tvout state (via sysfs). I replaced it with HAL (it gets events from kernel), so it could fix problem with battery. Please test if it is OK now.

After installing deb packages do not remember to reboot device!

maacruz 2011-11-16 20:29

Re: [ANNOUNCE] TV out control home plugin
 
You beat me by the minute
The battery drain comes from having tvout activated. After installation, your applet sets tvout to ON, so it starts causing drain, while the old one lets it at OFF till you press the on/off button (the drain happens when it is left at ON).
Both correctly detect when the video cable is plugged and unplugged changing the on/off button accordingly (do they use HAL?) while /sys/.../nokia-av/detect still shows 3
To fix this issue, IMHO, the applet shoudn't turn on tvout when the cable is not inserted.


EDIT: It seems the poll in your old applet also causes drain, too.
Will test your new packages now.

pali 2011-11-16 20:33

Re: [ANNOUNCE] TV out control home plugin
 
enabled/disabled Tvout state is stored into gconf. So when you disable Tv out it will be disabled after reboot too...

Estel 2011-11-16 21:02

Re: [ANNOUNCE] TV out control home plugin
 
"Old" tv-out control widget (available from repos) doesn't cause any increased battery drain. I'm using it for ages, without any issues (changing size, aspect ratio and pal/ntsc just works).

What exactly is going to be "better" in new one? It's "just" the thing that it show status menu applet when tv-out is connected (and You can have settings in control panel, instead of using widget and wasting space+memory), or there is some other change in mechanics?

Don't get me wrong I'm not trying to depreciate work put on new version. In fact, I think that Pali's plans are *exact;y* how it should work (automatic detection, status menu applet visible, only when tv-out is initiated, etc). I would just like to know what was changed, to help in "debugging".

/Estel

ade 2011-11-16 21:11

Re: [ANNOUNCE] TV out control home plugin
 
afaik: functionality is also added in this plugin:
- change imagesize (%)
- switch 4:3 / 16:9

All these changes make it this good device even better ;)

pali 2011-11-16 21:28

Re: [ANNOUNCE] TV out control home plugin
 
@Estel:

"Old" desktop widget using Xv for changing size, aspect, ... (that Xv attributes are supported by X fb driver)
Maemo5 original control panel plugin only change one gconf key for format. Daemon ohm monitor that key and if modified, it change Xv attribute for format.

My changes:
I intoduced new gconf keys (for enable, aspect and scale).
I created status menu plugin which show button (with info) when tvout cable is connected. This status menu plugin also monitor that 3 new gconf keys and when are modified it change Xv attributes.
I created new control panel plugin which has same functionality as "old" desktop widget. But it only change gconf keys (not directly Xv attributes).
And I rewritten some parts in desktop widget - now it only change gconf keys.

So Maemo ohm daemon still handle gconf key for format (PAL/NTSC). All other gconf keys are handled by status menu plugin - so it must be loaded to proper control panel and desktop widget work.

Status menu plugin now use HAL and HAL inform it when someting is pluggend into jack port. In my first version of status menu plugin it polled kernel every 5s for status of jack port - and this could drain battery...

kernel (module nokia-av) send event when jack status changed and that changes are exported to userspace in device /dev/input/event2. HAL daemon is on N900 still running and watching that file, so when something is changed it send event to status menu plugin (and it show/hide status item)

So tvout status menu plugin is running also when cable is disconnected (with hidden status menu item)

My first post: http://talk.maemo.org/showpost.php?p...5&postcount=28

WhiteWolf 2011-11-16 21:31

Re: [ANNOUNCE] TV out control home plugin
 
Thank you very much. It's something that I asked at the time and so glad I saw him come true.

Congratulations on the great work.

maacruz 2011-11-16 23:02

Re: [ANNOUNCE] TV out control home plugin
 
Results of new applet version testing:
Battery drain is fixed, as long as tvout is off.
statusbar plugin still doesn't show when the cable is plugged in.

I still think that the on/off button in the desktop applet should be disabled if the cable is not plugged in, it is too easy to accidentally turn it on draining the battery in a few hours. If someone wants to forcibly turn on tvout without cable it could use the control pannel applet.
Also, you should make sure gconf key tvout_enable is initialized at "off", right now it is initialized at "on".

pali 2011-11-16 23:14

Re: [ANNOUNCE] TV out control home plugin
 
Quote:

Originally Posted by maacruz (Post 1124702)
statusbar plugin still doesn't show when the cable is plugged in.

this is bug. it must be visible... But bug must be in kernel...

Can you test again what output you get after is initialized TV output (when you see screen on your TV) ?

$ cat /sys/devices/platform/nokia-av/detect

Quote:

Originally Posted by maacruz (Post 1124702)
Also, you should make sure gconf key tvout_enable is initialized at "off", right now it is initialized at "on".

Thanks for info, I changed default value to off in git repository.

maacruz 2011-11-17 08:09

Re: [ANNOUNCE] TV out control home plugin
 
Quote:

Originally Posted by pali (Post 1124707)
this is bug. it must be visible... But bug must be in kernel...

Can you test again what output you get after is initialized TV output (when you see screen on your TV) ?

$ cat /sys/devices/platform/nokia-av/detect

Now it always returns 3, so either that module is buggy or it is a very unreliable hardware. But as I previously said, the device correctly turns on tvout when the cable is connected to a video input (and the desktop tvout applet correctly detects it), so it must be using some other way to detect that the video cable is connected.

On the other hand, thinking again about the on/off setting from a usability point of view, I think it should be removed from the control pannel applet, because it is redundant and very probably will cause problems because the semantics it implies.
Let me explain: the tvout is automatically turned on when the cable is connected, and off when it is disconnected, so no manual control is needed for it to work, and the only use of such control is to turn tvout off when the cable is connected, since turning it on with no cable is of no use. On the other hand, the on/off setting in the control panel, implies that the control is manual and one should set it at on for it to work.
That's what it happened to me, and I'm no noob. Now think what will happen if this is included as it is now in the CSSU and all those people who can't even manage to read the first post of a thread turn on tvout and start complaining of battery drain (me shudders).


All times are GMT. The time now is 09:16.

vBulletin® Version 3.8.8