Release - XBMC LCDproc Python addon

  Thread Rating:
  • 2 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
herrnst Offline
Idle & Lurking
Posts: 228
Joined: Feb 2012
Reputation: 5
Location: Germany
Post: #16
(2012-11-01 19:58)jardes69 Wrote:  Thanks for a quick response. I have downloaded and installed the addon just this morning.
I checked the code, corrections from 377b7d5 are there.

btw: Dimming on screensaver works OK
Ah, now I got it - suspending the whole application. Yeah thats yet not handled, need to check how to best do this.

Thanks for the feedback on the dimming Smile

script.xbmc.lcdproc!
Krypton+VDPAU+HD-Audio+LCDproc addon,TVHeadend-master/DVB-C/T2+pvr.tvh addon on Ubuntu 14.04 (amd64)
find quote
jardes69 Offline
Junior Member
Posts: 22
Joined: Jan 2012
Reputation: 0
Lightbulb  RE: XBMC LCDproc Python addon (testing needed)
Post: #17
Yes, that's it!

I think it just need to check some kind of XBMC "suspend request" flag.


Acer Aspire Revo 3600 1Gb RAM + Antec Fusion 350 + Sure Electronics 20*4 LCD + Chinavision IR Receiver + Logitech Harmony 525 + XBMCbuntu Eden
find quote
herrnst Offline
Idle & Lurking
Posts: 228
Joined: Feb 2012
Reputation: 5
Location: Germany
Post: #18
Hm...

@XBMC-Devs: Does anything like "xbmc.abortRequested" exists for this, like "xbmc.suspendRequest"?

script.xbmc.lcdproc!
Krypton+VDPAU+HD-Audio+LCDproc addon,TVHeadend-master/DVB-C/T2+pvr.tvh addon on Ubuntu 14.04 (amd64)
find quote
jardes69 Offline
Junior Member
Posts: 22
Joined: Jan 2012
Reputation: 0
Post: #19
I found this:

### check if XBMC is shutting down
if xbmc.abortRequested:
log('XBMC abort requested, aborting')


Acer Aspire Revo 3600 1Gb RAM + Antec Fusion 350 + Sure Electronics 20*4 LCD + Chinavision IR Receiver + Logitech Harmony 525 + XBMCbuntu Eden
find quote
Martijn Offline
Team Kodi
Posts: 16,936
Joined: Jul 2011
Reputation: 310
Location: Dawn of time
Post: #20
(2012-11-01 20:28)herrnst Wrote:  Hm...

@XBMC-Devs: Does anything like "xbmc.abortRequested" exists for this, like "xbmc.suspendRequest"?

nope. not judging from the docs. guess you could make it a feature request for post-Frodo. Not sure how it is handled internally

Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
(This post was last modified: 2012-11-01 20:55 by Martijn.)
find quote
jardes69 Offline
Junior Member
Posts: 22
Joined: Jan 2012
Reputation: 0
Post: #21
I do not know python, but can it be done like this?:

#main loop
while not xbmc.abortRequested:
settings_setup()
process_lcd() #lcd loop

g_lcdproc.SetBackLight(0)


Acer Aspire Revo 3600 1Gb RAM + Antec Fusion 350 + Sure Electronics 20*4 LCD + Chinavision IR Receiver + Logitech Harmony 525 + XBMCbuntu Eden
find quote
herrnst Offline
Idle & Lurking
Posts: 228
Joined: Feb 2012
Reputation: 5
Location: Germany
Post: #22
(2012-11-01 20:54)Martijn Wrote:  
(2012-11-01 20:28)herrnst Wrote:  Hm...

@XBMC-Devs: Does anything like "xbmc.abortRequested" exists for this, like "xbmc.suspendRequest"?

nope. not judging from the docs. guess you could make it a feature request for post-Frodo. Not sure how it is handled internally

Ok, thanks for clearing. Guess this will get another option "Dim on Suspend/Shutdown" or so. Due to the extrastuff feature, some post-shutdown handling is required anyways, to clear things set by "option" LCDproc commands - currently, icons stay at their last state when unloading the addon Angel

script.xbmc.lcdproc!
Krypton+VDPAU+HD-Audio+LCDproc addon,TVHeadend-master/DVB-C/T2+pvr.tvh addon on Ubuntu 14.04 (amd64)
find quote
herrnst Offline
Idle & Lurking
Posts: 228
Joined: Feb 2012
Reputation: 5
Location: Germany
Post: #23
@jardes69:

Can you please try to update to latest GIT master, then set "Dim on Shutdown" in the GUI settings to true, and then retry the suspend thing?

The addon now at least does shutdown handling, but am not sure if this has any effect on suspend operations. If it doesn't, according to Martijn something like that probably needs to be implemented in XBMCs addon interface first.

Edit: You also should see a "Shutting down" NOTICE originating from the addon in xbmc.log.

script.xbmc.lcdproc!
Krypton+VDPAU+HD-Audio+LCDproc addon,TVHeadend-master/DVB-C/T2+pvr.tvh addon on Ubuntu 14.04 (amd64)
(This post was last modified: 2012-11-02 00:58 by herrnst.)
find quote
jardes69 Offline
Junior Member
Posts: 22
Joined: Jan 2012
Reputation: 0
Smile  RE: XBMC LCDproc Python addon (testing needed)
Post: #24
Excellent, I will let you know!


Acer Aspire Revo 3600 1Gb RAM + Antec Fusion 350 + Sure Electronics 20*4 LCD + Chinavision IR Receiver + Logitech Harmony 525 + XBMCbuntu Eden
find quote
herrnst Offline
Idle & Lurking
Posts: 228
Joined: Feb 2012
Reputation: 5
Location: Germany
Post: #25
@sphere: Thanks for your pointer to "xbmcgui.getCurrentWindowId()", works like a charm (even if for readability I had to self-define some interesting window ids Cool ).

@jardes69: Did you check the suspend stuff already?

@all: Please check if everything still works like it should since my last commits (2279eee, as I did some bigger rework on the InfoLabel retrieval stuff to make the code more readable.

@iMON/mdm166a users: Please check if especially the codec icons setting still works, as I implemented some pseudo-caching for this to save a bit on CPU cycles (don't determine icon/codec match if nothing changed). Still curious if mdm166a works at all Wink BTW: Extrastuff handling as implemented like in Ticket#8981 is now complete Blush

Regards,
Daniel

script.xbmc.lcdproc!
Krypton+VDPAU+HD-Audio+LCDproc addon,TVHeadend-master/DVB-C/T2+pvr.tvh addon on Ubuntu 14.04 (amd64)
(This post was last modified: 2012-11-05 00:48 by herrnst.)
find quote
jardes69 Offline
Junior Member
Posts: 22
Joined: Jan 2012
Reputation: 0
Post: #26
Daniel, I did not have time to check it yet, maybe tonight, I will definitelly let you know.


Acer Aspire Revo 3600 1Gb RAM + Antec Fusion 350 + Sure Electronics 20*4 LCD + Chinavision IR Receiver + Logitech Harmony 525 + XBMCbuntu Eden
find quote
jardes69 Offline
Junior Member
Posts: 22
Joined: Jan 2012
Reputation: 0
Post: #27
I have just checked it. It does not dim the display when XBMC suspends.
The core LCD functionality does this though. Looks like it can not be done by a service addon.


Acer Aspire Revo 3600 1Gb RAM + Antec Fusion 350 + Sure Electronics 20*4 LCD + Chinavision IR Receiver + Logitech Harmony 525 + XBMCbuntu Eden
find quote
herrnst Offline
Idle & Lurking
Posts: 228
Joined: Feb 2012
Reputation: 5
Location: Germany
Post: #28
Thanks for checking that! Honestly, I had that feeling it wouldn't work as intended Wink I've posted a Feature Request on this in the Feature Request forum, maybe suspend handling can be done one day.

However, as a workaround, you might handle this on system level. IIRC, when the system is put to sleep, some events are triggered or scripts executed from some /etc/suspend.d dir (I personally do not use this, so someone else needs to provide correct directions on this). You could put a LCDproc unload/load handler there and configure LCDproc to turn off the display on unload, or even a script that connects to LCDproc, sets up a screen with higher priority and turns off the backlight afterwards. On resume, vice-versa needs to be done of course.

HTH,
Daniel

script.xbmc.lcdproc!
Krypton+VDPAU+HD-Audio+LCDproc addon,TVHeadend-master/DVB-C/T2+pvr.tvh addon on Ubuntu 14.04 (amd64)
find quote
jardes69 Offline
Junior Member
Posts: 22
Joined: Jan 2012
Reputation: 0
Post: #29
Thanks for you reply. I have Lcdproc script for unloading/loading, but it does not switch the panel off. It's a good point, but I need to do some research. It's another option in my mind - if your script can check the keyboard, I can send a keypress in a sequence before the suspend command.

Jaro


Acer Aspire Revo 3600 1Gb RAM + Antec Fusion 350 + Sure Electronics 20*4 LCD + Chinavision IR Receiver + Logitech Harmony 525 + XBMCbuntu Eden
find quote
herrnst Offline
Idle & Lurking
Posts: 228
Joined: Feb 2012
Reputation: 5
Location: Germany
Post: #30
Maybe you can also try:
  • put "Backlight=on" into your LCDd.conf (probably replacing Backlight=auto) - as a side effect this will disable backlight control from clients
  • On suspend, do a "LCDd stop" via the system. This should turn off the light.
  • On resume, do "LCDd start", again via the system. That should re-light the display. The LCDproc addon will reconnect after approx. 10 seconds.

script.xbmc.lcdproc!
Krypton+VDPAU+HD-Audio+LCDproc addon,TVHeadend-master/DVB-C/T2+pvr.tvh addon on Ubuntu 14.04 (amd64)
find quote
Post Reply