![]() |
|
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
|
||||
|
||||
External Command Tuner Plugin for Linux
Download | Installation
I've created a simple command based tuner plugin for sage, using the sage tuner apis. You can take a look at it here One note of caution.... I know that most people would prefer if the command was executed once for the entire channel #, but sage calls the PlayCommand() api for each digit. Given this, your command must accept a single ir command and blast it... not the entire channel number.
__________________
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 Last edited by stuckless; 05-17-2009 at 08:53 PM. |
#2
|
|||
|
|||
Would this work?
Code:
FiOS-TV-1, /usr/local/bin/irsend SET_TRANSMITTERS 1 && sleep .15 && irsend SEND_ONCE FiOS-TV %s FiOS-TV-2, /usr/local/bin/irsend SET_TRANSMITTERS 2 && sleep .15 && irsend SEND_ONCE FiOS-TV %s etc..
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT Last edited by bcjenkins; 06-15-2008 at 08:15 AM. |
#3
|
||||
|
||||
This might work... but I'm sure sure how the system() command would handle the &&... you could create a small bash script.. something like...
Code:
#/bin/bash TRANSMITTER=$1 IRCMD=$2 /usr/local/bin/irsend SET_TRANSMITTERS $TRANMITTER sleep .15 /usr/local/bin/irsend SEND_ONCE FiOS-TV $IRCMD Code:
FiOS-TV-1, /usr/local/bin/youscript 1 %s FiOS-TV-2, /usr/local/bin/youscript 2 %s Although... you can try your original commands and see if they work as is.... there is a 1024 byte buffer, so as long as your command doesn't exceed that, then you may be ok.... Also be sure to use the full path to all commands... One last note... A log file is created in the sage root dir, call ext-command-tuner.log. It shows the commands being executed with paramters, etc, and it shows if the commands were sucessful or not... so if things aren't working... check the log, it might show something.
__________________
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 Last edited by stuckless; 06-15-2008 at 09:40 AM. |
#4
|
|||
|
|||
Modified source for using entire channel number
I have modified your source to accept the entire channel number (using microtune function). I have a Dish receiver, timing on it is kinda picky, It just would not work a channel digit at a time very well.
buyer beware... Its a quick hack. and will only work with one defined tuner. It does what I need, but perhaps someone might want to look at makeing some updates to it to work with multiple defined tuners? (so far I have not had any problems) Last edited by TravisTodd; 07-13-2008 at 07:14 AM. Reason: needed to add note on limitations. |
#5
|
||||
|
||||
Thanks, I'll add the updates to the main program. I had no idea that MacroTune() was used to submit the entire the channel #
![]() Thanks for the update.
__________________
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 |
#6
|
|||
|
|||
Thanks for the update, I had to hack up a script to achieve that, this helps a bunch.
|
#7
|
||||
|
||||
I've built a new build of the External Command Tuner Plugin and I've updated the wiki to include some documentation for it.
This build incorporates the MacroTune feature that Travis provided as an optional setting. Macro Tune allows you to pass the entire channel to a script instead of a single digit at a time. Read the wiki for information on how to enable macro tuning.
__________________
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 |
#8
|
|||
|
|||
Will this work for raw codes as well?
B
__________________
Running SageTV on unRAID via Docker Tuning handled by HDHR3-6CC-3X2 using OpenDCT |
#9
|
||||
|
||||
The external command tuner doesn't actual deal with codes, it simply takes whatever "key" sage sends it and then passes it long to the script.
Perhaps you are are thinking because my sample key file contained codes, then the plugin will map, "home" to a some keycode "0x0000023", but that is not the case. The key file could have been something like, Code:
0 1 2 3 ... home select ...
__________________
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 |
#10
|
|||
|
|||
I just tried adding a second STB controlled by firewire, using this plugin,
and it doesn't work. Instead of tuning each STB as required, it always tunes the last one defined, even though the command is different. I'm suspicious about macrotuning, because the logfile says that "Macro Tune can only work when a Single Remote is defined." Is this true? Here is the log file: Code:
INFO: InitDevice Called INFO: CanMacroTune INFO: MacroTune: Handle: 1, Channel 757 INFO: Executed MacroTune Command without Error: /home/jerry/libavc1394-0.5.3/test/panelctl -g 0xfea9ce75 757 INFO: LoadRemote(Firewire_comcast0) INFO: Loading Remotes from ext-command-tuner-remotes.cfg INFO: Processing Set Command: set MacroTune true INFO: Processing Set Command: MacroTune: true INFO: MacroTune is Enabled. Macro Tune can only work when a Single Remote is defined. INFO: Creating/Adding Remote: USB_UIRT_DTC6200 INFO: Loading Keys DTC6200-remote-keys.txt for Remote USB_UIRT_DTC6200 INFO: Creating/Adding Remote: Firewire_DTC6200 INFO: Creating/Adding Remote: Firewire_comcast0 INFO: InitDevice Called INFO: CanMacroTune INFO: MacroTune: Handle: 1, Channel 756 INFO: Executed MacroTune Command without Error: /home/jerry/libavc1394-0.5.3/test/panelctl -g 0xfea9ce75 756 Code:
set MacroTune true USB_UIRT_DTC6200, /usr/bin/irsend send_once DTC6200 %s, DTC6200-remote-keys.txt #set MacroTuneSepChar Firewire_DTC6200, /usr/local/bin/6200ch %s Firewire_comcast0, /home/jerry/libavc1394-0.5.3/test/panelctl -g 0xfea9ce75 %s #Firewire_comcast1, /home/jerry/libavc1394-0.5.3/test/panelctl -g 0x11092b %s comment them out. The last two entries are the important ones. They call my modified panelctl program, which changes channels on an STB based on the guid, a unique firewire key. As you can see, comcast1 is commented out right now. When it was in, any tuning command to either comcast0 or comcast1 went to comcast1. Now that it's out (and the video device removed) comcast0 works properly. Is this a real limitation? If so, can it be worked around? These devices really should be macrotuned. If you send the codes separately, instead of tuning to channel 123 it will go first to 1, then to 2, then to 3. |
#11
|
||||
|
||||
Currently the Tuner Plugin ONLY can control a single device. This is a limitation in the code, and nothing to do with SageTV itself. I did write the configuration code with the intention that you could configure more than 1 remote, but I've never implemented the necessary code in the plugin to actually use that information. Today, no matter how many remotes you have configured, only the last one will ever get used
![]() Fixing this is on my list, since I will eventually have more than 1 STB as well... but today, I only have a single STB, so it's never been a priority for me. If someone wants to make the changes, then I'm ok with that, but my plate is a little full at the moment.
__________________
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 |
#12
|
|||
|
|||
I might take a crack at it. Where is the source code?
|
#13
|
||||
|
||||
It's in the google code project
http://code.google.com/p/customsagetv/source/checkout The tuner plugin is in a subproject: ExternalCommandTunerPlugin http://code.google.com/p/customsaget...andTunerPlugin There are no dependencies, and there is a simple make file for building, and there is an ant build.xml file for packaging.
__________________
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 |
#14
|
|||
|
|||
Quote:
I have a tuner plugin based on the same code as the ExternalCommandTunerPlugin which supports multiple STBs (currently I use it with 3). Since it's very similar, my intention last year had been to merge my code with stuckless's code but I never got around to completing it. I may have some time this weekend to get the bits together, and I'll post here when it's available. --John |
#15
|
|||
|
|||
Cool! I had started to look at modifying the source code to do it myself. Looks like it's not all that hard, but there are a few things I don't understand yet about the sage API. But, if you've already done it, I certainly don't want to reinvent the wheel.
If it's not yet ready for "publication", but you're willing to send it to me privately, I'd be glad to have a look and, if you like, help with the process. |
#16
|
||||
|
||||
Quote:
@jpwegas - if you want, you can contribute your code as a subproject of my customsagetv project (currently is where my tuner plugin is hosted, as well as bmt, and a few other projects that i've worked on). I can even deprecate my plugin, if needed.
__________________
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 |
#17
|
||||
|
||||
Just want to thank you for this plugin. I use it in conjunction with 6200ch and my 6412III Comcast box. It works like a champ. Thanks for all the hard work.
Sui
__________________
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 |
#18
|
|||
|
|||
Is there documentation on the header file for the API somewhere? I am interested in possibly combining the Firewire channel changing logic with the Tuner Plugin for a more direct route.
|
#19
|
||||
|
||||
Quote:
I think that jpwegas and loonsailer are both using firewire channel changers with this plugin (or a modified version). I think jpwegas enhancements are also commited to the source repository. But, if you have any specific question, then feel free to ask.
__________________
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 |
#20
|
|||
|
|||
I tried to write a new tuner plugin but got very frustrated by the interface, which seemed to be doing some weird things and is not documented. I had used stuckless's external tuner plugin with one firewire tuner. That worked fine (see tutorial at http://forums.sagetv.com/forums/down...do=file&id=333), but I couldn't get it to work with multiple tuners, because it is unable to macro-tune multiple tuners. So, I've switched to jpwegas' plugin, called Generic Tuner Plugin. It defines a simple interface, and then one adds a program using that interface to tune the devices you want. This program can be in perl, bash, C, whatever. I wrote one in perl that tunes an arbitrary number of firewire tuners, and it works great. The Generic Tuner Plugin hasn't been published yet, but I think it will be soon, and it will include my firewire stuff.
I've made some other changes as well, including using an updated version of panelctl instead of 6200ch. When jpwegas publishes, I'll do an update of the tutorial. |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any interest in a plugin to support/control the Sony XL1B firewire DVD changer? | TerryMathews | SageTV Customizations | 74 | 07-21-2011 02:24 PM |
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin | deria | SageTV Customizations | 447 | 12-11-2010 07:38 PM |
VMC's MyNetFlix Plugin in SageTV - WOOHOO! | osburnfamily | SageTV Customizations | 8 | 06-17-2008 11:54 PM |
STV Import: Weather Monitor | deria | SageTV Customizations | 35 | 08-23-2006 08:15 PM |
External tuner plugin and subchannel | jchiso | Hardware Support | 0 | 11-30-2005 10:35 PM |