Author Topic: Can VC tell if XBMC is playing media?  (Read 5398 times)

0 Members and 1 Guest are viewing this topic.

ih8gates

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 1
    • View Profile
Can VC tell if XBMC is playing media?
« on: April 13, 2014, 02:43:01 PM »
I'm a new VC user. I've got the VoxCommando tools XBMC plugin installed.

Is there a way to get an event in VC when XBMC starts or stops playback? I'd like to use this to disable some commands while, say, a TV show is playing, to avoid false positives.

If not, I guess this might be a feature request for the XBMC plugin...

EDIT: I have selected "subscribe to notifications from xbmc" in the XJSON plugin. Restarted both VC and XBMC. But I don't see notifications.
« Last Edit: April 13, 2014, 02:56:13 PM by ih8gates »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC tell if XBMC is playing media?
« Reply #1 on: April 13, 2014, 03:37:21 PM »
Please tell us what version of VoxCommando you are using, what configuration for VC you selected and what version of XBMC you are using.

It should be generating events by default.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #2 on: April 13, 2014, 03:37:54 PM »
Hi ih8gates and welcome to VoxCommando forum. You can select the the following command group code and drag and drop it in your VC command tree. I hope this is what you searching for. Let us know if it works  ;)
You can see the first command in this group is connect, do this first.
« Last Edit: April 13, 2014, 05:24:52 PM by jitterjames »
***********  get excited and make things  **********

ih8gates

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 1
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #3 on: April 13, 2014, 03:45:08 PM »
1.1.9.1 and the Frodo configuration. With Frodo 12.3

Is there a way to confirm that I chose the Frodo configuration? It's possible that I did something stupid, but I am getting a successful XJSON connect and VC is controlling XBMC correctly.


Kalle - I already have the JSON Events group in my VC tree. But I'm never seeing the XBMC events (like OnPlay) in my VC history panel.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2319
  • Karma: 47
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #4 on: April 13, 2014, 03:48:00 PM »
use the xjson.connect action first - I think this will solve it.
« Last Edit: April 13, 2014, 03:51:15 PM by jitterjames »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC tell if XBMC is playing media?
« Reply #5 on: April 13, 2014, 03:50:39 PM »
In the default configuration for Frodo, there is a command (which calls the connect action) which is triggered by the "focused.XBMC" event.  It won't work if XBMC is running on a different computer.  In that case you would need to call connect some other way.
« Last Edit: April 13, 2014, 03:54:06 PM by jitterjames »

ih8gates

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 1
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #6 on: April 13, 2014, 03:52:59 PM »
XJSON.Connect is firing every time I focus XBMC. If I hover over the history entry, it says "info: Connected"

I suspect that if it wasn't connecting properly, I wouldn't be getting control of XBMC by VC.

ih8gates

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 1
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #7 on: April 13, 2014, 03:54:42 PM »
I also checked to see that XBMC is allowed access through the firewall.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC tell if XBMC is playing media?
« Reply #8 on: April 13, 2014, 03:55:15 PM »
I suspect that if it wasn't connecting properly, I wouldn't be getting control of XBMC by VC.
Actually that is not really the case.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC tell if XBMC is playing media?
« Reply #9 on: April 13, 2014, 04:04:29 PM »
Based on what you have told us, I can't think of any reason why it would not be working.

Are you using the English Frodo configuration for VoxCommando?  (no there is no way to check which you chose, after the fact, except by looking at what commands are in your tree)

Is XBMC running on the same machine as VoxCommando?

What port are you using and does the port in VC match the port set in XBMC web server settings?

I think I will need to see a VoxCommando log and possibly an XBMC log too.


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC tell if XBMC is playing media?
« Reply #10 on: April 13, 2014, 04:07:00 PM »
On the main VC window, on the options drop-down menu, make sure that "show all events" is checked.  Normally it is checked by default.

ih8gates

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 1
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #11 on: April 13, 2014, 04:13:33 PM »
If I manually run the XJson Connect, I get the TTS speaking "connected", but I don't see any events.

I *do* have "show all events" enabled.

I'm using English Frodo. I'm using port 8111, which is set in XBMC, too. When I load the XJson plugin and test the connection, I get "success" and see the "pong" JSong block from XBMC.

ih8gates

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 1
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #12 on: April 13, 2014, 04:26:31 PM »
I turned on debug in XBMC and in VC. Started and stopped a TV show a couple of times. I've got the logs, but when I try to upload, I get an error that the upload directory is full. My XMBC log is 154k, Vox's is only 2k.

Should I post them into a message?

Other info that may help: I'm using an Android app called YATSE that controls XBMC. Could it be that YATSE is getting the Json notifications? Does XBMC allow multiple "listeners"?


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC tell if XBMC is playing media?
« Reply #14 on: April 13, 2014, 04:43:34 PM »
I think the problem is here:

Code: [Select]
<advancedsettings>
                                              <jsonrpc>
                                                <tcpport>9091</tcpport>
                                              </jsonrpc>

Is there a particular reason you are changing the default port?  VC uses the default of 9090 and I have not implemented any way for the user to select a different port because it has never come up before.

ih8gates

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 1
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #15 on: April 13, 2014, 04:48:32 PM »
I have a port conflict with another app that didn't allow me to change its port, so I changed XBMC's. It's an app that I still use, so I can't change back to 9090.

(PS: I'm really sorry I didn't think of that earlier! Sorry about the fire drill.)
« Last Edit: April 13, 2014, 04:54:37 PM by ih8gates »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC tell if XBMC is playing media?
« Reply #16 on: April 13, 2014, 05:17:20 PM »
No problem.  It would be an easy thing to forget, and I'm sure I would have done the same.  I'm just glad that I got lucky and noticed it. It somehow looked funny to me to see 9091!

Anyway, I'll see about making this an option in a future release (soon), but it will be for VC version 2 only.  I'm only doing critical bug fixes on version 1.

In the meantime if you could temporarily revert to 9090 just for the sake of testing that would be appreciated.
« Last Edit: April 13, 2014, 05:23:57 PM by jitterjames »

ih8gates

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 1
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #17 on: April 13, 2014, 05:46:11 PM »
I tried reverting (closing the conflicting app, updating XBMC's custom config and restarting XBMC), but then I started getting errors when Vox tried to connect to XBMC. There was probably something else grabbing the port.

I'll look into upgrading to 2. Are updates to that code fairly regular as you make changes?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Can VC tell if XBMC is playing media?
« Reply #18 on: April 13, 2014, 06:04:26 PM »
Yes usually.  It depends on what kind of changes I get myself wrapped up in and how hard they are to complete.

You can try this.  Replace your voxcommando\plugins\xjson\xJson.dll
with the attached dll.

This is for VC version 1.  I have hard-wired it to use port 9091, so no one else should use this.

repeat: THIS FILE IS ONLY FOR IH8TGATES (unless you also want to use port 9091 for json notifications)

In version two there will be a setting for the tcp port.

ih8gates

  • Jr. Member
  • **
  • Posts: 12
  • Karma: 1
    • View Profile
Re: Can VC tell if XBMC is playing media?
« Reply #19 on: April 13, 2014, 09:27:16 PM »
I appreciate this!

At first, I started getting a connect error, then realize that in my testing, I'd changed 127.0.0.1 to the machine's IP. But didn't have the "let remote machines control XBMC" flag set.

Everything's working correctly now with the updated dll.

Thanks!