2014-01-28, 22:39
I've been trying to figure out how to have XBMC switch hdmi ports on my RPi on video stop. I found an add-on that allows me to run a script on a number of different XBMC events, one being player stop. The problem I'm having now is getting the actual script written and working. Through my research I've found 2 utilities that appear to allow control of the CEC adapter. One is CEC-CLIENT and the other (which I stumbled upon last night), is TVSERVICE (an OpenElec tool?). From what I can see TVSERVICE allows certain things (I was able to power on and power off the TV) but not switch HDMI ports. I'm guessing that it sends CEC commands? The other is CEC-CLIENT which allows me to switch the port but executing it from a SSH prompt basically reinitializes the CEC Adapter as CEC-TESTER and takes control away from XBMC until I reboot the RPi. So I was thinking:
1. If possible recompile the TVSERVICE and add hdmi switching capability. (not a big programmer, so not sure if this can be done, or done easily) Wouldn't mind making a mini project and learning my way around some source code and compiling. It's been ages, but always up for a challenge.
2. Use CEC-CLIENT (which the pulse-eight people tell me is a "tool"), but after submitting the command to switch hdmi ports, then reinitialize the CEC adapter in the same fashion as when XBMC starts up. I've yet to find the file that contains that information.
Then hope and pray that this add-on I have will do as it says and run the script on player stop. I tried this last night making a file called cec.sh and putting the following commands:
#!/bin/bash
echo "tx 4F 82 10 00" | cec-client -s
I put the file in the "emulators" directory, so maybe my problem lies there?
I chmod'd it to 775 and then told the add-on to run on video stop and nothing happened. I even tried navigating to it in XBMC file manager and clicking on it and nothing happened. Again, not being a Linux wiz, I'm sure I'm not doing something right. Need some direction.
Am I on the right path here, or is this hopeless. This would be a big feature for me as all of my GUI navigation is done on a iPad (XBMC Touch) so basically making XBMC act more like a HDMI-Passthrough device (only switching to the RPi HDMI port when actually playing a video) and then switching back to my cable box would make this much more usable for my family. Otherwise, it's grab a remote and manually flip through 6 different HDMI inputs (all cryptic) back to the STB.
I appreciate any help you can provide. Thanks.
Roveer
1. If possible recompile the TVSERVICE and add hdmi switching capability. (not a big programmer, so not sure if this can be done, or done easily) Wouldn't mind making a mini project and learning my way around some source code and compiling. It's been ages, but always up for a challenge.
2. Use CEC-CLIENT (which the pulse-eight people tell me is a "tool"), but after submitting the command to switch hdmi ports, then reinitialize the CEC adapter in the same fashion as when XBMC starts up. I've yet to find the file that contains that information.
Then hope and pray that this add-on I have will do as it says and run the script on player stop. I tried this last night making a file called cec.sh and putting the following commands:
#!/bin/bash
echo "tx 4F 82 10 00" | cec-client -s
I put the file in the "emulators" directory, so maybe my problem lies there?
I chmod'd it to 775 and then told the add-on to run on video stop and nothing happened. I even tried navigating to it in XBMC file manager and clicking on it and nothing happened. Again, not being a Linux wiz, I'm sure I'm not doing something right. Need some direction.
Am I on the right path here, or is this hopeless. This would be a big feature for me as all of my GUI navigation is done on a iPad (XBMC Touch) so basically making XBMC act more like a HDMI-Passthrough device (only switching to the RPi HDMI port when actually playing a video) and then switching back to my cable box would make this much more usable for my family. Otherwise, it's grab a remote and manually flip through 6 different HDMI inputs (all cryptic) back to the STB.
I appreciate any help you can provide. Thanks.
Roveer