|
SageTV Linux Discussion related to the SageTV Media Center for Linux. Questions, issues, problems, suggestions, etc. relating to the SageTV Linux should be posted here. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
GenericTunerPlugin 1.0 Released
The Generic Tuner Plugin is a new tuning plugin for SageTV.
It was created to move the complexities of tuning your myriad of recording devices from a poorly understood C library to the language of your choice. The plugin acts as a passthru to a script or program called gentuner. gentuner can be written in whatever language you desire. It needs to accept several simple arguments on the command line and return results on stdout. gentuner is responsible for handing off the actual tuning work to the appropriate software (LIRC, 6200ch, panelctl, etc). It can support multiple recording devices each with it's own independent tuning mechanism. For example, if you have four recording devices, two could be tuned using LIRC, one could use FireWire tuning, and one could send a command over the serial port to a robotic arm to poke a trained hamster to punch the keys on your favorite remote. Several example scripts are included in the distribution (sorry, hamster poking script not included). Currently it has only been tested on Linux (since I don't own the server version for Windows or Mac), but may work on those platforms with modifications. Wiki with configuration and install documentation: http://code.google.com/p/customsaget...ricTunerPlugin Download: http://code.google.com/p/customsaget...Plugin-1.0.zip GenericTunerPlugin is based on the ExternalCommandTunerPlugin and LIRCTuner, which are both derived from MultiDCTTunerDLL. Thanks to Sean for letting me host everything on the customsagetv googlecode project page with his other excellent projects. --John |
#2
|
||||
|
||||
Nice going John. I know I'll be giving this a try when I hook my receiver again.
I think that if anyone is using my original external tuner plugin, then you can probably switch to this one, which offers more flexibility over the tuning and the # of tuners.
__________________
Batch Metadata Tools (User Guides) - SageTV App (Android) - SageTV Plex Channel - My Other Android Apps - sagex-api wrappers - Google+ - Phoenix Renamer Downloads SageTV V9 | Android MiniClient |
#3
|
|||
|
|||
This is a great plugin! Thanks for pushing this out. Now that the USB port on my H21-200 box is dead, I'll be using this approach.
I wanted to make a few comments: NB: I am using the Sage 7 beta -- perhaps the behavior is different on 6.x The path to gentuner is hard coded to /opt/sagetv/server, obviously this can change per install (especially mine I was able to figure this out quickly and confirmed it by reading the source code. You may want to consider pulling the path / script from an environment variable set in the sage start script. Or maybe through the sage api but I am not sure what the api exposes. The directions to update the sage properties file, do not completely work as stated. I used this technique but it did not work as expected. It took me a while to figure out that the REMOTES / KEYS APIs are called during the tuning setup; but by following the doc procedure to update the properties file, sage was passing in empty string for the pszPathName in LoadRemotes so that code was not working as expected. Then I went down the remove tuner process path and everything worked as expected.
__________________
[size=1]-MrD ============= Linux Server 7.1.9 (1)HD300 (1) HD200 (1) HD100 (2) PC Clients Intel Xeon L? 32Gb CetonTV cable card /FIOS |
#4
|
|||
|
|||
Thanks for posting that, MrD. I've been holding off on updating to the v7 beta because I rely on this plugin for tuning my two STBs via firewire, and wasn't sure it would work. Sounds like I should go ahead and take the plunge.
|
#5
|
|||
|
|||
I can confirm it works as well.
B
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT |
#6
|
|||
|
|||
Quote:
Quote:
Not having the gentuner path hardcoded in the plugin (by either inferring the location from Sage itself or having it defined in the Sage.properties file) is on my list of things to improve. Quote:
Ideally Sage would allow you to select the tuning plugin after a tuner is set up but there isn't a way to do that. Instead, I was hoping to be able to just change the plugin defined in the properties file so that people didn't have to recreate the tuner, but for some reason that doesn't work as I expected. I will do some more testing on this the next time I dig into the code. Meanwhile, I will update the instructions on the wiki. Thanks for the feedback! --John |
#7
|
|||
|
|||
Thanks!!!
Awesome plugin. Not only did you build on the old LIRCTuner, but you pretty much made it able to work with any external program and customized easily.
However, I am having problems getting SageTV to "blast" my commands. I can get everything working from the script in my terminal, and verify the results through the TV (bypassing SageTV). SageTV responds to the remote as well, but channels never change. SageTV even goes through the motions of re-tuning, but I only ever see what's playing on Channel 2. I am using Sage 7 Beta, Hauppauge PVR 1600 MCE. Since this is the newer USB one, I am using LIRC for my remote/blaster...(and the reason why your plugin was needed so badly by me). I am not using any other special plugins or extras for SageTV - a basic config. I am using the Composite input on the card, but had the same problem when trying to use the Analog tuner. I followed all your steps and used the default paths for the plugin. Permissions on /opt/sagetv/server/gentuner are as follows: -rwxr-xr-x (755) Ownership of file is root:root Obviously, my powers of deduction tell me that somehow, the script is never actually getting run. My gentuner.log looks something like this: 2010-06-11 14:28 INFO: Generic Tuner, Version 1.1, Revision 287 2010-06-11 14:28 DEBUG: OpenDevice: 0 ...followed by a whole bunch of entries like this... 2010-06-11 14:29 DEBUG: LoadRemotes: Remote: StubDevice 2010-06-11 14:29 DEBUG: LoadRemotes: Using command: /opt/sagetv/server/gentuner REMOTES and eventually, a whole bunch of these... 2010-06-11 16:40 DEBUG: LoadRemotes: Found Remote: DCT2000 2010-06-11 16:40 DEBUG: CreateRemote: Remote: DCT2000 2010-06-11 16:40 DEBUG: LoadRemoteKeys: Using command: /opt/sagetv/server/gentuner KEYS DCT2000 At some point I get this... 2010-06-11 16:40 DEBUG: LoadRemotes: Found Remote: mceusb 2010-06-11 16:40 DEBUG: CreateRemote: Remote: mceusb 2010-06-11 16:40 DEBUG: LoadRemoteKeys: Using command: /opt/sagetv/server/gentuner KEYS mceusb For one, I'm not sure what OpenDevice: 0 refers to. Does that mean it's trying to use lirc0? Because lirc1 is my blaster. Anyway, it seems to me that SageTV is not even using the right commands. It just keeps getting a key list but I never see any SEND commands. Am I simply just missing something silly? |
#8
|
|||
|
|||
Two things:
Did you select the remote in the tuner settings? StubDevice is the default remote. Can you post the gentuner script you're using? I am inserting mine here Code:
#!/bin/bash # # gentuner.LIRC # GenericTunerPlugin to LIRC Connector # # See gentuner.README for details on gentuner # # This script proxies commands from the Generic Tuner Plugin # to LIRC. If the remote name defined in the lircd.conf file # ends in "-N" (where N is 1, 2, 3 or 4), it will also # use SET_TRANSMITTERS to restrict which emitters LIRC uses. # Your LIRC hardware must support this feature. # CMD=$1 REMOTE=$2 KEY=$3 CHANNEL=$3 DELAY=.8 LOCKFILE=/tmp/lirclock REMOTE_OVERRIDE=directtv LIRC_ENTERCMD=enter TRANS_REMOTE=CommandIR TRANS_REMOTE_CMD="settransmitters-" case "$CMD" in REMOTES) /usr/bin/irsend LIST "" "" 2>&1 | cut -d" " -f2 ;; KEYS) if [ ! $REMOTE ]; then echo "Usage: $0 KEYS REMOTE" echo "To see a list of remotes execute: $0 REMOTES" else /usr/bin/irsend LIST "$REMOTE" "" 2>&1 | cut -d" " -f3 fi ;; SEND) while [ -f $LOCKFILE ] do #echo "Waiting for lock" sleep $DELAY done touch $LOCKFILE POST=${REMOTE:(-2)} TRANSMITTER_NUM=${REMOTE:(-1)} if [ $REMOTE_OVERRIDE ]; then REMOTE=$REMOTE_OVERRIDE; fi if [[ ! $2 || ! $3 ]]; then echo "Usage: $0 SEND REMOTE KEY" echo "To see a list of remotes execute: $0 REMOTES" echo "To see a list of supported keys execute: $0 KEYS REMOTE" else if [[ ${POST/-[1-9]/OK} = "OK" ]]; then /usr/bin/irsend SET_TRANSMITTERS $TRANSMITTER_NUM sleep $DELAY else /usr/bin/irsend SET_TRANSMITTERS 1 2 3 4 sleep $DELAY fi /usr/bin/irsend SEND_ONCE $REMOTE $KEY sleep $DELAY fi rm $LOCKFILE ;; TUNE) while [ -f $LOCKFILE ] do #echo "Waiting for lock" sleep $DELAY done touch $LOCKFILE POST=${REMOTE:(-2)} TRANSMITTER_NUM=${REMOTE:(-1)} if [ $REMOTE_OVERRIDE ]; then REMOTE=$REMOTE_OVERRIDE; fi if [[ ! $2 || ! $3 ]]; then echo "Usage: $0 TUNE REMOTE KEY" echo "To see a list of remotes execute: $0 REMOTES" echo "To see a list of supported keys execute: $0 KEYS REMOTE" else if [[ ${POST/-[1-9]/OK} = "OK" ]]; then if [ $TRANS_REMOTE ]; then /usr/bin/irsend send_once ${TRANS_REMOTE} ${TRANS_REMOTE_CMD}${TRANSMITTER_NUM} else /usr/bin/irsend SET_TRANSMITTERS ${TRANSMITTER_NUM} sleep $DELAY fi else /usr/bin/irsend SET_TRANSMITTERS 1 2 3 4 sleep $DELAY fi sleep $DELAY /usr/bin/irsend send_once $REMOTE $LIRC_ENTERCMD sleep $DELAY for (( x = 0 ; x < ${#CHANNEL} ; x++ )); do irsend send_once $REMOTE "${CHANNEL:$x:1}" sleep $DELAY done /usr/bin/irsend send_once $REMOTE $LIRC_ENTERCMD fi rm $LOCKFILE ;; CAN_TUNE) echo "OK" ;; *) echo $"Usage: $0 {REMOTES|KEYS|SEND|TUNE|CAN_TUNE}" exit 1
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT |
#9
|
|||
|
|||
Quote:
Quote:
The "Found Remote" lines means that the gentuner script is being called and is returning values to the plugin for the REMOTES command. Both of bcjenkins' comments are spot on - basically either:
I suspect it's the first item since you mentioned you are using LIRC, and you shouldn't need to modify the sample gentuner.LIRC script at all. If those two things look ok, please attach or PM me the whole gentuner.log file (or the last 200 lines or so). --John |
#10
|
|||
|
|||
Working now!
Thanks guys for your quick responses. Indeed, that's all I needed to do. I didn't even realize you could configure stuff from the Source summary screen. Sure enough, though, I was able to change StubDevice to DCT2000 and all is well!!!
Just in time, too - tomorrow would have been day 30 since my Linux version purchase, so I was anxious to get things working 100%...I didn't want to have to try switch to Winbloze. Eventhough Sage doesn't officially support Linux well, it's good to see a reasonable core of 3rd party help. I really like this plugin alot. If I had more time, I would definitely configure some other scripts for it. But knowing it's just a bash script will make it easy for me to control my emulators, games and other programs as well. I can handle bash scripting! |
#11
|
|||
|
|||
Quote:
Quote:
Glad it's working for you! --John |
#12
|
||||
|
||||
Where would I get the updated panelctl that supports multiple STB's?
__________________
Server: i3 530 dual 2.93Ghz, 6GB mem, 2x 3TB 7200 rpm sata drives, Windows 7 ultimate 64-bit,Sagetv7.1.8 Beta Clients: 3x Hauppauge MediaMVP, 1x HD200, 1X HD300. TV provider: Comcast Digital, Up to 8 recordings at one time. Ceton 4 tuner cable card. 2x Dual Tuner HDHomeRun's (SageDCT 1.4 Ceton 1.0.6.1 |
#13
|
|||
|
|||
panelctl
Though I submitted the new panelctl to libavc1394 many months ago, it's still not in the released version. It is in the main development trunk, however. So, you get it by getting a copy of the development source and building and installing it.
>svn co https://libavc1394.svn.sourceforge.n...oot/libavc1394 libavc1394 >cd libavc1394/trunk/libavc1394 >autoreconf -f -i >./configure >make >sudo make install Check and make sure that panelctl is version .2 or greater (>panelctl -V). ">panelctl --help" gives you a list of commands. I e-mailed the head of the libavc1394 project today, and he told me that he'd do a new release soon, and move this into the current version. It's up to the distros, though, to decide when to make that new version be the default. |
#14
|
|||
|
|||
What steps to move to v7?
I use gentuner in Sage V6, and it works great. I'm going to go to the V7 beta soon. When I do, will the gentuner plugin be configured automatically, or do I need to do anything to make it work?
Thanks. |
#15
|
|||
|
|||
New panelctl is now in the default libavc1394 release
I just checked, and the updated panelctl, with flexible control of multible STBs by firewire, is now the default provided by the libavc1394 project. Unfortunately, it hasn't been picked up by any of the distro's yet, to my knowledge. You can get it from http://sourceforge.net/projects/libavc1394/. Just download the release (0.5.4 or higher) and install according to directions.
Hopefully, this will make it into ubuntu and other distros at some point. |
#16
|
|||
|
|||
It works fine in 7.0.
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT |
#17
|
|||
|
|||
I upgraded to v7, and the plugin works perfectly straight out of the gates. However, I don't see it in the plugin manager. Should I?
|
#18
|
|||
|
|||
No, just use it the same way as you did in 6. If jpwegas ever gets around to making it an official plugin, we might get that.
B
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT |
#19
|
|||
|
|||
Quote:
--John |
#20
|
|||
|
|||
Quote:
But currently in the case of this plugin there may also be some manual user customization required as well. I'll have to think about how to implement that for a few of the common cases to avoid the customization. --John |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SageTV V6.4 has been released! | Opus4 | Announcements | 0 | 08-18-2008 04:27 PM |
SageTV V6.2 has been released! | Narflex | Announcements | 0 | 09-17-2007 05:09 PM |
Now that Vista has been released | mightyt | General Discussion | 32 | 02-16-2007 05:17 AM |
Java 6.0 is released | nielm | General Discussion | 54 | 02-05-2007 09:27 PM |
SageTV V6.0.19 Released | Narflex | SageTV Software | 0 | 12-28-2006 01:17 PM |