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)

ade 2011-11-14 19:30

Re: [ANNOUNCE] TV out control home plugin
 
Pali,

I do get a 3 as return value in both cases.

But it may very well be caused by my test: my TV does not have a video-in plugin, so I used the "Y Pb Pr" connector, which gives me a black and white display of my N900 screen. Maybe the "wrong" connector influences the return value. In that case it is just a bad testcase from my part and not a bug.

pali 2011-11-14 19:30

Re: [ANNOUNCE] TV out control home plugin
 
This code is in kernel module nokia-av, file kernel-2.6.28/drivers/misc/nokia-av.c

Code:

enum {
        UNKNOWN,
        HEADPHONES, /* or line input cable or external mic */
        VIDEO_CABLE,
        OPEN_CABLE,
        BASIC_HEADSET,
};

And statusmenu plugin read value each 5 seconds and if output is 2 show status menu button (otherwise hide).

2 = VIDEO_CABLE
3 = OPEN_CABLE

So problem is maybe in kernel.

pali 2011-11-14 19:35

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

Originally Posted by ade (Post 1123555)
Pali,

I do get a 3 as return value in both cases.

But it may very well be caused by my test: my TV does not have a video-in plugin, so I used the "Y Pb Pr" connector, which gives me a black and white display of my N900 screen. Maybe the "wrong" connector influences the return value. In that case it is just a bad testcase from my part and not a bug.

If you did not get output on your TV, then it is ok that status menu plugin is not visible. Status menu plugin should be visible only when TV output is ready.

ade 2011-11-14 19:49

Re: [ANNOUNCE] TV out control home plugin
 
I do get output, but in B&W (by using the Y plug from Y Pb Pr for the video signal instead of video-in).
It's logical the plugin does not appear when the value does not change. Most likely it's because of the different signal it returns and no bug. Sorry I can't test it on a proper video-in (my TV is too recent to still support it :().

maacruz 2011-11-15 00:10

Re: [ANNOUNCE] TV out control home plugin
 
After a full reboot (there goes my uptime :-( )all the settings work.
kernel detection still refuses to work (tested with stock nokia kernel and my own build)

pali 2011-11-15 07:21

Re: [ANNOUNCE] TV out control home plugin
 
Stupid question, but is your TV ouput (on TV) working if kernel detection not? I think that kernel sysfs file is used if output could be enabled or not.

Gusse 2011-11-15 08:04

Re: [ANNOUNCE] TV out control home plugin
 
I notided quite huge battery drain right after installing these 3 files from Pali's directory. I rebooted, took battery off, but didn't change drain.

Now, recovered with backupmenu. Let's see if things are back to normal.
Anybody else noticed extensive battery drain?

EDIT: After backup all OK again.

maacruz 2011-11-15 15:12

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

Originally Posted by pali (Post 1123772)
Stupid question, but is your TV ouput (on TV) working if kernel detection not? I think that kernel sysfs file is used if output could be enabled or not.

TV output works fine (tested with a variety of devices).
dmesg shows the gpio headphones message each time I plug in the cable.
nokia-av.ko shows nothing strange in dmesg at insertion and removal.

maacruz 2011-11-16 13:23

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

Originally Posted by Gusse (Post 1123786)
I notided quite huge battery drain right after installing these 3 files from Pali's directory. I rebooted, took battery off, but didn't change drain.

Now, recovered with backupmenu. Let's see if things are back to normal.
Anybody else noticed extensive battery drain?

I can confirm a battery drain of about 8%/hour with the device idle in flight mode.
The drain persisted after uninstalling the debs and forcing a hildon-statusmenu restart (didn't restarted hildon-desktop though) till I rebooted the device (no time to try restarting hildon-desktop). No noticeable cpu usage associated to the battery drain.

pali 2011-11-16 14:52

Re: [ANNOUNCE] TV out control home plugin
 
Can you check if this same battery drain problem is wil OLD tvout control desktop widget too?

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).

pali 2011-11-17 09:50

Re: [ANNOUNCE] TV out control home plugin
 
I cable detection is not working for you, how can we check if disable button should be shown? (As I understand you enable/disable button is redundant with disconnected cable)

maacruz 2011-11-17 11:28

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

Originally Posted by pali (Post 1124912)
I cable detection is not working for you, how can we check if disable button should be shown?

Cable detection is working: connecting cable to video input -> tvout automatically turns on -> I see image in TV
/sys/.../nokia-av/detect is not working or unreliable -> always 3
Because cable detection is working but nokia-av/detect==3 -> there is another way to detect cable
Sollution is in tvout desktop applet: connecting cable to video input -> applet "on/off" button automatically changes to on. Why?
(Hope you understand now)
Quote:

(As I understand you enable/disable button is redundant with disconnected cable)
That is correct.

pali 2011-11-17 11:37

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

Originally Posted by maacruz (Post 1124961)
Sollution is in tvout desktop applet: connecting cable to video input -> on/off button automatically changes to on (Why?)

Xorg driver change Xv tvout enable attribute automatically (when tvout cable is plugin/unplugged). "Old" tvout desktop widget listening for Xv attributes changes so it update button text ON/OFF.

Auto enable/disable tvout output is done by Xorg driver (not software, daemon or tvout widget).

Status menu plugin using same code for Xv attributes, so it should update gconf key when Xorg driver disable tvout output. Desktop widget now monitor only gconf keys, so if you did not see that button ON/OFF changed, there is problem in status menu widget...


I think that in status menu widget is some race condition (and that is maybe reason why is not working):

Xv enable attrbite was changed --> run callback function which should update gconf key

and when gconf key is changed --> run callback function which should update Xv attributes (and Xorg driver will enable/disable output)

Estel 2011-11-17 16:35

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

Originally Posted by maacruz (Post 1124876)
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.

Can't agree, and please, don't even think about it.

N900 turns tv-out automatically, when a resistance of ~75 Ohm is detected, between appropriate pins of jack socket. Particularly, it's result of it detecting such resistance on plug, due to it being connected to composite video in of TV - resistance there *should* be 75 Ohm.

Ho ever, many TV's - especially new ones - doesn't follow rule of 75 Ohm (it was technical reason, not a rule of thumb - some part got such resistance in older TV's), and, in "worse" cases (at least for our device), it doesn't enable composite in (and such 75 Ohm resistance), unless it detect signal.

At the same time, N900 doesn't enable signal, until it gets 75 Ohm. So, both devices are waiting forever for each other. In times before TV-Out control widget, one need to prepare special cable, with 75 Ohm resistor bundled inside, and switch, to "cheat" N900 into detecting 75 Ohm, and quickly turn switch, so TV detect signal - and hope, that it will be detected by N900, again, before it disables signal "thinking", that TV cable isn't connected.

So, with all due respect, ideas of disabling manual control over TV-Out, should be fought with fire. I don't care about noobs messing up in their control panel - if someone doesn't understand basic things, he/she got enough things inside controls, to f*** everything this way or another. If someone doesn't feel confident with changing settings, let them stay away from control panel.

At the same time, I doesn't have anything against removing on/off from desktop widget - little inconvenient, but, if it's available from CP, it's ok.

/Estel

maacruz 2011-11-17 17:41

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

Originally Posted by Estel (Post 1125074)
Can't agree, and please, don't even think about it.

...

Ho ever, many TV's - especially new ones - doesn't follow rule of 75 Ohm (it was technical reason, not a rule of thumb - some part got such resistance in older TV's), and, in "worse" cases (at least for our device), it doesn't enable composite in (and such 75 Ohm resistance), unless it detect signal.

At the same time, N900 doesn't enable signal, until it gets 75 Ohm. So, both devices are waiting forever for each other. In times before TV-Out control widget, one need to prepare special cable, with 75 Ohm resistor bundled inside, and switch, to "cheat" N900 into detecting 75 Ohm, and quickly turn switch, so TV detect signal - and hope, that it will be detected by N900, again, before it disables signal "thinking", that TV cable isn't connected.

/Estel

Ok, if you are going to be that angry, I'll admit "octopus" as pet :D
Let's the control panel have the option to force enable the tv out. But it should be made clear that is an override, so instead of "[] Enable" it should read "[] Force enable" or "[] Manually turn on" or something like that, so at least intelligent noobs understand that they are screwing something.

maacruz 2011-11-17 18:02

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

Originally Posted by pali (Post 1124963)
Xorg driver change Xv tvout enable attribute automatically (when tvout cable is plugin/unplugged). "Old" tvout desktop widget listening for Xv attributes changes so it update button text ON/OFF.

Auto enable/disable tvout output is done by Xorg driver (not software, daemon or tvout widget).

Ok, understood.
Quote:

Status menu plugin using same code for Xv attributes, so it should update gconf key when Xorg driver disable tvout output. Desktop widget now monitor only gconf keys, so if you did not see that button ON/OFF changed, there is problem in status menu widget...
Your desktop widget works. Button changes. Gconf key is updated.

Quote:

I think that in status menu widget is some race condition (and that is maybe reason why is not working):
status menu widget is not shown

Quote:

Xv enable attrbite was changed --> run callback function which should update gconf key
This works
Quote:

and when gconf key is changed --> run callback function which should update Xv attributes (and Xorg driver will enable/disable output)
This works too.

willi6868 2011-11-25 12:07

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

Originally Posted by alex-12gods (Post 1122937)
after installing .dep files(with clean app) i lost all apples on status menu and also tvout control widget wont start.... what did i do wrong???(sorry for my english)

have the same problem!! Reboot and removing of the app didn't work:( What should I do?!

What have i to do to see my apps in status bar again?! :confused:

pls help me


EDIT:

Ok it works.:cool: I restarted my phone about 5 times... :)

Gusse 2011-11-30 13:10

Re: [ANNOUNCE] TV out control home plugin
 
There seems to be a bug with scaling. Scale > 93%, picture disappear totally. Tested via control panel setup.
Tested with 2 TV sets.

pali 2011-11-30 14:50

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

Originally Posted by Gusse (Post 1131048)
There seems to be a bug with scaling. Scale > 93%, picture disappear totally. Tested via control panel setup.
Tested with 2 TV sets.

This is problem in Xorg driver, not in plugins...

pali 2011-11-30 14:51

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

Originally Posted by willi6868 (Post 1128835)
have the same problem!! Reboot and removing of the app didn't work:( What should I do?!

What have i to do to see my apps in status bar again?! :confused:

pls help me


EDIT:

Ok it works.:cool: I restarted my phone about 5 times... :)

If you have any uninstall problems, you could try to shutdown device, wait some minutes and power on again.

WhiteWolf 2011-11-30 15:13

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

Originally Posted by Gusse (Post 1131048)
There seems to be a bug with scaling. Scale > 93%, picture disappear totally. Tested via control panel setup.
Tested with 2 TV sets.

Idem. The same thing happens to me.

Raimu 2011-11-30 15:51

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

Originally Posted by Estel (Post 1125074)
At the same time, I doesn't have anything against removing on/off from desktop widget - little inconvenient, but, if it's available from CP, it's ok.

I would prefer to have the on-off toggler in the desktop widget as well. I thought the point of desktop widgets and status applets was that you didn't have to resort to slowbrowsing through either your menus or the control panel when you need something done quick in an unusual situation.

(Edit: Yeah, or when you need to do something so often it's annoying!)

pali 2011-12-02 20:34

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

Originally Posted by Estel (Post 1125074)
Can't agree, and please, don't even think about it.

N900 turns tv-out automatically, when a resistance of ~75 Ohm is detected, between appropriate pins of jack socket. Particularly, it's result of it detecting such resistance on plug, due to it being connected to composite video in of TV - resistance there *should* be 75 Ohm.

Ho ever, many TV's - especially new ones - doesn't follow rule of 75 Ohm (it was technical reason, not a rule of thumb - some part got such resistance in older TV's), and, in "worse" cases (at least for our device), it doesn't enable composite in (and such 75 Ohm resistance), unless it detect signal.

At the same time, N900 doesn't enable signal, until it gets 75 Ohm. So, both devices are waiting forever for each other. In times before TV-Out control widget, one need to prepare special cable, with 75 Ohm resistor bundled inside, and switch, to "cheat" N900 into detecting 75 Ohm, and quickly turn switch, so TV detect signal - and hope, that it will be detected by N900, again, before it disables signal "thinking", that TV cable isn't connected.

So, with all due respect, ideas of disabling manual control over TV-Out, should be fought with fire. I don't care about noobs messing up in their control panel - if someone doesn't understand basic things, he/she got enough things inside controls, to f*** everything this way or another. If someone doesn't feel confident with changing settings, let them stay away from control panel.

At the same time, I doesn't have anything against removing on/off from desktop widget - little inconvenient, but, if it's available from CP, it's ok.

/Estel

I found one bug (thanks to Merlin1991 on IRC!) which badly detect connected type. I fixed it and now I rebuilded deb packages. After updating is needed to reboot device.

If someone else has problem that when tv output is working and status menu entry is not shown post output of this command:
Code:

lshal -u /org/freedesktop/Hal/devices/platform_soc_audio_logicaldev_input

maacruz 2011-12-04 12:56

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

Originally Posted by pali (Post 1132310)
I found one bug (thanks to Merlin1991 on IRC!) which badly detect connected type. I fixed it and now I rebuilded deb packages. After updating is needed to reboot device.

If someone else has problem that when tv output is working and status menu entry is not shown post output of this command:
Code:

lshal -u /org/freedesktop/Hal/devices/platform_soc_audio_logicaldev_input

Works fine now :)


All times are GMT. The time now is 08:20.

vBulletin® Version 3.8.8