SageTV Community  

Go Back   SageTV Community > SageTV Products > SageTV Linux
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-15-2008, 07:28 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
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.

Last edited by stuckless; 05-17-2009 at 08:53 PM.
Reply With Quote
  #2  
Old 06-15-2008, 08:12 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
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..
B
__________________
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.
Reply With Quote
  #3  
Old 06-15-2008, 09:36 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
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
Then your config...
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.

Last edited by stuckless; 06-15-2008 at 09:40 AM.
Reply With Quote
  #4  
Old 07-13-2008, 07:04 AM
TravisTodd TravisTodd is offline
New Member
 
Join Date: Feb 2005
Posts: 1
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)
Attached Files
File Type: zip ExternalCommandTunerPlugin.zip (21.7 KB, 420 views)

Last edited by TravisTodd; 07-13-2008 at 07:14 AM. Reason: needed to add note on limitations.
Reply With Quote
  #5  
Old 07-13-2008, 01:06 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
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.
Reply With Quote
  #6  
Old 07-21-2008, 11:13 AM
jvbunte jvbunte is offline
Sage User
 
Join Date: Jun 2008
Posts: 5
Thanks for the update, I had to hack up a script to achieve that, this helps a bunch.
Reply With Quote
  #7  
Old 05-17-2009, 08:53 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
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.
Reply With Quote
  #8  
Old 05-18-2009, 03:51 AM
bcjenkins bcjenkins is offline
SageTVaholic
 
Join Date: Jan 2006
Posts: 3,764
Will this work for raw codes as well?

B
__________________
Running SageTV on unRAID via Docker
Tuning handled by HDHR3-6CC-3X2 using OpenDCT
Reply With Quote
  #9  
Old 05-18-2009, 04:44 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
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
...
But because i was lazy and simply copied my lirc remote file as my key file, then mine also contains remote codes as well. But the plugin will only take the first field int the "keys" file and store it; any data after for the key name is discarded.
Reply With Quote
  #10  
Old 10-30-2009, 03:21 PM
loonsailor loonsailor is offline
Sage Advanced User
 
Join Date: Jul 2009
Location: Berkeley, CA, USA
Posts: 176
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
and, here is the .cfg file, with the comments removed:

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
USB-UIRT and Firewire_DTC6200 are no longer in use, and I should probably
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.
Reply With Quote
  #11  
Old 10-30-2009, 07:20 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
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.
Reply With Quote
  #12  
Old 10-30-2009, 09:59 PM
loonsailor loonsailor is offline
Sage Advanced User
 
Join Date: Jul 2009
Location: Berkeley, CA, USA
Posts: 176
I might take a crack at it. Where is the source code?
Reply With Quote
  #13  
Old 10-31-2009, 05:46 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by loonsailor View Post
I might take a crack at it. Where is the source code?
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.
Reply With Quote
  #14  
Old 10-31-2009, 01:58 PM
jpwegas jpwegas is offline
Sage Expert
 
Join Date: May 2007
Posts: 502
Quote:
Originally Posted by stuckless View Post
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.
loonsailor,
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
Reply With Quote
  #15  
Old 10-31-2009, 04:40 PM
loonsailor loonsailor is offline
Sage Advanced User
 
Join Date: Jul 2009
Location: Berkeley, CA, USA
Posts: 176
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.
Reply With Quote
  #16  
Old 10-31-2009, 06:29 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by loonsailor View Post
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.
If you are looking at the code and you want clarification about he API.. then feel free to ask me (PM if you like).

@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.
Reply With Quote
  #17  
Old 11-02-2009, 03:37 PM
SuiDog's Avatar
SuiDog SuiDog is offline
Sage User
 
Join Date: Feb 2009
Posts: 57
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
Reply With Quote
  #18  
Old 11-17-2009, 11:11 PM
tpboyce tpboyce is offline
Sage User
 
Join Date: Dec 2007
Posts: 58
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.
Reply With Quote
  #19  
Old 11-18-2009, 06:39 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by tpboyce View Post
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.
Unfortunately, there isn't really any documentation other than this thread. I wrote the tuner plugic based on the lirc plugin that narflex provided.

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.
Reply With Quote
  #20  
Old 11-18-2009, 09:36 AM
loonsailor loonsailor is offline
Sage Advanced User
 
Join Date: Jul 2009
Location: Berkeley, CA, USA
Posts: 176
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.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
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


All times are GMT -6. The time now is 12:30 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.