Work in Progress - XBMC LCDproc Python addon (testing needed)

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
herrnst Offline
Team-Kodi Member
Posts: 185
Joined: Feb 2012
Reputation: 4
Location: Germany
Brick  XBMC LCDproc Python addon (testing needed)
Post: #1
ANNOUNCEMENT: "XBMC LCDproc" is now part of the official XBMC.org Addon repository and is installable and receives updates within Eden and Frodo!

Hi all,

I've lately been busy hacking on an LCDproc Python addon. The addon handles communication to LCDd more cleanly (reacts properly on any responses and only sends update when really needed, without spamming the socket) and improves on many other things (e.g. no more character translation table for any display type required, special chars handled via native LCDproc widgets etc.). While the addon runs very stable at least for me and can fully replace the code currently present in XBMC's core, it definitely requires testing by more users (different platforms, different displays, different LCD.xml configurations and so on). So I'd like to kindly ask anyone using a LCD or VFD driven by LCDproc to test this Smile

The addon can be found at my GitHub repo at https://github.com/herrnst/script.xbmc.lcdproc.

The repo has been reorganized a bit lately: Base functionality has been branched as version 1.1.0, and will receive bugfixes only from now on.

The "imonmdm" branch is now merged to master and will eventually become version 1.2.0. So, master now contains the additional functionality to drive the extra icons surrounding the text area of the display. @SoundGraph iMON LCD/Futaba mdm166a users: Please report back any problems you see with this. Especially mdm166a users should report back if the stuff works at all, as this support has been implemented blindly without any testing (no hardware). Everyone else: No harm or instability should be caused by this, please report if it unfortunately does.

For notes, instructions and so on, please check https://github.com/herrnst/script.xbmc.lcdproc/wiki (updated for version information etc.).

Would love to receive any feedback on this, and don't hesitate to ask questions or report problems Smile

Thanks to XBMC Team member Memphiz for the base implementation and letting me use it Smile

Best regards,
Daniel
Following up on the PR-discussion from PR#1482 here:

Memphiz Wrote:The only thing i found is that "$INFO[LCD.TimeWide21]" should show the clock not the player.time (when screensaver is on there is no player running).

I found out that the screensaver mode also gets active at least while music is playing, thus getting the LCD.TimeXX being drawn, but the output was scrambled due to special chars being directly posted. Haven't looked at the core code at that time, so it felt like a good idea to print the player.time at that point Smile However, looking afterwards it indeed states "systemtime" in core. What about leaving "player.time" when playing media, and showing "systemtime" when screensaver gets active without anything playing?

Greets,
Daniel

For script.xbmc.lcdproc support, check this forum-thread!
Gotham+VDPAU+HD-Audio+LCDproc addon driving a SoundGraph iMON LCD, TVHeadend-master/DVB-C+HTS addon on Ubuntu 12.04 (amd64)
(This post was last modified: 2013-02-06 21:07 by herrnst.)
find quote
Memphiz Offline
Team-Kodi Developer
Posts: 11,165
Joined: Feb 2011
Reputation: 113
Location: germany
Post: #2
Would be fine with me. Basically hack in what you like Big Grin

AppleTV2/iPhone/iPod: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for XBMC: Wiki NFS
HowTo configure avahi (zeroconf): Wiki Avahi
READ THE IOS FAQ!: iOS FAQ
find quote
herrnst Offline
Team-Kodi Member
Posts: 185
Joined: Feb 2012
Reputation: 4
Location: Germany
Post: #3
Done Wink

BTW (@all): Does any python equivalent to "g_windowmanager.GetActiveWindow()" exist (for comparison, see https://github.com/herrnst/xbmc/blob/imo...D.cpp#L618) ? Already found out about "Window.IsActive()", the former seems to be MIA.

Thanks!
find quote
sphere Offline
Team-Kodi Member
Posts: 1,221
Joined: Jul 2009
Reputation: 50
Location: Germany
Post: #4
(2012-10-29 23:29)herrnst Wrote:  BTW (@all): Does any python equivalent to "g_windowmanager.GetActiveWindow()" exist (for comparison, see https://github.com/herrnst/xbmc/blob/imo...D.cpp#L618) ? Already found out about "Window.IsActive()", the former seems to be MIA.

Just wanted to say: You are doing a good job on the LCD stuff!

Regarding your question: Yes, you can use "xbmcgui.getCurrentWindowId()" - not sure why its not documented but it works Smile

EDIT: it is documented, see http://mirrors.xbmc.org/docs/python-docs/xbmcgui.html (end of the document).

regards,
sphere

My GitHub. My Add-ons:
[Image: IOoywq0.jpg]
(This post was last modified: 2012-10-29 23:53 by sphere.)
find quote
herrnst Offline
Team-Kodi Member
Posts: 185
Joined: Feb 2012
Reputation: 4
Location: Germany
Post: #5
Thanks, and thanks for the hint and docs link! Can I also somehow access the defines (e.g. WINDOW_VIDEOS => 10006; didn't try yet) ?

Greetings,
nst
find quote
cfetzer Offline
Fan
Posts: 307
Joined: Jul 2011
Reputation: 16
Post: #6
This is really awesome! Until now I was using the imon patch from http://trac.xbmc.org/ticket/8981 and recently from your PR.
But having an addon looks like the right approach.

Just installed the addon and it's working quite fine already Smile

Just a few questions:
My imon lcd (usbid: 15c2:0038) has 2 bars above and below the text area. Previously they were used for a progress and volume indicator. Should this be working already? (it doesn't anymore for me)

The xbmc intern code allows having empty lines (with [CR]). Could you maybe add this?
I have another 4 line display where I had the last line always showing the weather and the time.

My LCD.xml was lacking the pvrtv and pvrradio tags which caused a crash when starting live tv (index out of range).

Cheers,
Christian

MythTV PVR addon - Wiki - Development
find quote
sphere Offline
Team-Kodi Member
Posts: 1,221
Joined: Jul 2009
Reputation: 50
Location: Germany
Post: #7
(2012-10-30 20:00)herrnst Wrote:  Thanks, and thanks for the hint and docs link! Can I also somehow access the defines (e.g. WINDOW_VIDEOS => 10006; didn't try yet) ?

They are listed here: http://wiki.xbmc.org/index.php?title=Window_IDs

My GitHub. My Add-ons:
[Image: IOoywq0.jpg]
find quote
herrnst Offline
Team-Kodi Member
Posts: 185
Joined: Feb 2012
Reputation: 4
Location: Germany
Post: #8
(2012-10-30 22:32)cfetzer Wrote:  This is really awesome! Until now I was using the imon patch from http://trac.xbmc.org/ticket/8981 and recently from your PR.
But having an addon looks like the right approach.

Just installed the addon and it's working quite fine already Smile
Thanks Smile

(2012-10-30 22:32)cfetzer Wrote:  Just a few questions:
My imon lcd (usbid: 15c2:0038) has 2 bars above and below the text area. Previously they were used for a progress and volume indicator. Should this be working already? (it doesn't anymore for me)
Yes, assuming you are using the imonmdm branch (which I'll plan to merge to master soon, after branching/versioning the current master), this works. Just add config tags like this to LCD.xml:
Code:
<lcd>
  <extrabar1>progress</extrabar1>
  <extrabar2>volume</extrabar2>
  ...
</lcd>
Possible options are "progress", "volume" and "menu", where "menu" simply displays a 100%-bar when navigating Smile

For the iMON, up to 4 bars (20 being currently the max. supported by the addon, for future use) may be defined, where 1 and 2 are top/bottom, and 3/4 being the small bars below/above the top/bottom bars.

(2012-10-30 22:32)cfetzer Wrote:  The xbmc intern code allows having empty lines (with [CR]). Could you maybe add this?
I have another 4 line display where I had the last line always showing the weather and the time.
Yeah, someone over at vdr-portal with a 7-line display already asked about this, this will (probably) get a configurable option.

(2012-10-30 22:32)cfetzer Wrote:  My LCD.xml was lacking the pvrtv and pvrradio tags which caused a crash when starting live tv (index out of range).
Thanks for reporting this. fa5e5f6 (master) and 7c4f02a (imonmdm) will resolve this Wink

(2012-10-30 23:44)sphere Wrote:  They are listed here: http://wiki.xbmc.org/index.php?title=Window_IDs
Ok, so they should be defined/usable inside python. Thank you, will play with this!

Greetings,
Daniel
find quote
herrnst Offline
Team-Kodi Member
Posts: 185
Joined: Feb 2012
Reputation: 4
Location: Germany
Post: #9
(2012-10-31 00:02)herrnst Wrote:  
(2012-10-30 22:32)cfetzer Wrote:  The xbmc intern code allows having empty lines (with [CR]). Could you maybe add this?
I have another 4 line display where I had the last line always showing the weather and the time.
Yeah, someone over at vdr-portal with a 7-line display already asked about this, this will (probably) get a configurable option.
Following up on this: Latest GIT commits add an LCD.xml configurable to allow empty lines. You can put
Code:
<allowemptylines>on</allowemptylines>
into your LCD.xml, and empty lines should be possible.

Will add documentation on this to the wiki page tomorrow Smile

G'night,
Daniel
(This post was last modified: 2012-10-31 01:47 by herrnst.)
find quote
cfetzer Offline
Fan
Posts: 307
Joined: Jul 2011
Reputation: 16
Post: #10
That was fast! Works great now and the configuration option is much better than having [CR]. Smile

I have two other ideas about improving the addon:

The imon lcd is just 16 lines wide, unfortunately that's not enough to display
$INFO[Player.Time]/$INFO[Player.Duration] for movies. (17 chars in the format 00:00:00/00:00:00).
So in that case, couldn't the display just show the hour and the minute and make it 00:00/00:00?
What do you think?

The second idea concerns menus. Right now as far as I see you can only get the current menu entry.
Do you know if xbmc supports also the previous/next menu entries on the same level?
I always wanted to create a menu like this:
Pictures
>Movies
Music
But i fear that this information isn't provided by xbmc.

Cheers,
Christian

MythTV PVR addon - Wiki - Development
find quote
herrnst Offline
Team-Kodi Member
Posts: 185
Joined: Feb 2012
Reputation: 4
Location: Germany
Post: #11
(2012-10-31 21:17)cfetzer Wrote:  That was fast! Works great now and the configuration option is much better than having [CR]. Smile
Nice Smile Wiki documentation is updated, btw Cool

(2012-10-31 21:17)cfetzer Wrote:  I have two other ideas about improving the addon:

The imon lcd is just 16 lines wide, unfortunately that's not enough to display
$INFO[Player.Time]/$INFO[Player.Duration] for movies. (17 chars in the format 00:00:00/00:00:00).
So in that case, couldn't the display just show the hour and the minute and make it 00:00/00:00?
What do you think?
Quickly reading through GUIInfoManager.cpp, you should be able to achieve this by specifying a time format as option to Player.Time, e.g.
Code:
$INFO[Player.Time(hh:mm)]/$INFO[Player.Duration(hh:mm)]
... with the InfoLabel IMHO being the right place to accomplish this. I think the input shouldn't be filtered by the addon besides the LCD(proc)-specific labels.

Personally, I'm quite happy with the possibility of the iMON to display the progress by it's extra bars. For videos I have
Code:
<extrabar1>progress</extrabar1>
   <video>
      <line>$INFO[LCD.PlayIcon] $INFO[Player.Time]</line>
      <line>$INFO[VideoPlayer.Title]</line>
   </video>
giving a nice indication on how long until being freed from the current crap movie Wink

(2012-10-31 21:17)cfetzer Wrote:  The second idea concerns menus. Right now as far as I see you can only get the current menu entry.
Do you know if xbmc supports also the previous/next menu entries on the same level?
I always wanted to create a menu like this:
Pictures
>Movies
Music
But i fear that this information isn't provided by xbmc.
That'd be hard to implement especially with the line-based concept. Also, the addon needs to know how the options are ordered with the current skin (e.g. Aeon Nox is ordered differently - and on top of that user-sortable - than Confluence). So if there isn't a way to retrieve this from XBMC, this seems impossible.

Greetings,
Daniel

For script.xbmc.lcdproc support, check this forum-thread!
Gotham+VDPAU+HD-Audio+LCDproc addon driving a SoundGraph iMON LCD, TVHeadend-master/DVB-C+HTS addon on Ubuntu 12.04 (amd64)
find quote
cfetzer Offline
Fan
Posts: 307
Joined: Jul 2011
Reputation: 16
Post: #12
(2012-10-31 21:37)herrnst Wrote:  
(2012-10-31 21:17)cfetzer Wrote:  I have two other ideas about improving the addon:

The imon lcd is just 16 lines wide, unfortunately that's not enough to display
$INFO[Player.Time]/$INFO[Player.Duration] for movies. (17 chars in the format 00:00:00/00:00:00).
So in that case, couldn't the display just show the hour and the minute and make it 00:00/00:00?
What do you think?
Quickly reading through GUIInfoManager.cpp, you should be able to achieve this by specifying a time format as option to Player.Time, e.g.
Code:
$INFO[Player.Time(hh:mm)]/$INFO[Player.Duration(hh:mm)]
... with the InfoLabel IMHO being the right place to accomplish this. I think the input shouldn't be filtered by the addon besides the LCD(proc)-specific labels.

Didn't know about the format options. That did the trick. Thanks.

MythTV PVR addon - Wiki - Development
find quote
jardes69 Offline
Junior Member
Posts: 21
Joined: Jan 2012
Reputation: 0
Post: #13
Hi, thanks for an excellent addon. It solved my problems with play icons, the big clock and it does excellent timing calibration.
Everything works well apart of that when XBMC goes to suspend mode, LCD keeps backlight on. I am using Eden + lcdproc with sureelec driver. When I use the native XBMC control it does dimming properly.

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
Team-Kodi Member
Posts: 185
Joined: Feb 2012
Reputation: 4
Location: Germany
Post: #14
(2012-11-01 18:43)jardes69 Wrote:  Hi, thanks for an excellent addon. It solved my problems with play icons, the big clock and it does excellent timing calibration.
Everything works well apart of that when XBMC goes to suspend mode, LCD keeps backlight on. I am using Eden + lcdproc with sureelec driver. When I use the native XBMC control it does dimming properly.
Thanks for the feedback Wink

Are you running an up-to-date version? That issue should theoretically be resolved since 377b7d5...
@All,

the currently used code has been branched as release/1.1.0 and will receive bugfixes only. The "imonmdm" branch has been merged to master, so master now contains additional functionality to drive extra stuff if provided by the display (namely special icons, progress bars). Currently implemented is support for the SoundGraph iMON LCD and Futaba/Targa mdm166a VFD devices. Please check if this causes any harm or instability for you, or if problems occur with this.

Initial post and GIT wiki has been updated accordingly.

Thanks,
Daniel

For script.xbmc.lcdproc support, check this forum-thread!
Gotham+VDPAU+HD-Audio+LCDproc addon driving a SoundGraph iMON LCD, TVHeadend-master/DVB-C+HTS addon on Ubuntu 12.04 (amd64)
(This post was last modified: 2012-11-01 19:23 by herrnst.)
find quote
jardes69 Offline
Junior Member
Posts: 21
Joined: Jan 2012
Reputation: 0
Post: #15
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


Acer Aspire Revo 3600 1Gb RAM + Antec Fusion 350 + Sure Electronics 20*4 LCD + Chinavision IR Receiver + Logitech Harmony 525 + XBMCbuntu Eden
find quote
Post Reply