SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #41  
Old 09-13-2016, 03:37 PM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,312
Quote:
Originally Posted by stuckless View Post
What was the permission issue? The whole container runs as "nobody" and the permissions are set to nobody when the container starts. Just wondering what your specific issue was... maybe I need to tweak something there.
You are correct. Everything was running as nobody. For some reason when I let root read the gentuner file it started working.
__________________
SageTV Server: unRAID Docker v9, S2600CPJ, Norco 24 hot swap bay case, 2x Xeon 2670, 64 GB DDR3, 3x Colossus for DirecTV, HDHR for OTA
Living room: nVidia Shield TV, Sage Mini Client, 65" Panasonic VT60
Bedroom: Xiomi Mi Box, Sage Mini Client, 42" Panasonic PZ800u
Theater: nVidia Shield TV, mini client, Plex for movies, 120" screen. Mitsubishi HC4000. Denon X4300H. 7.4.4 speaker setup.
Reply With Quote
  #42  
Old 08-12-2018, 08:26 PM
turak's Avatar
turak turak is offline
Sage Expert
 
Join Date: Sep 2003
Location: Miami
Posts: 560
My Linux box took a dump. I'm switching my server back to windows for now. Is there an externaltunerplugin type thing for windows? Something where I can run a script to change channels on my DirecTV boxes over the network?
Reply With Quote
  #43  
Old 08-13-2018, 07:26 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I think this is what you are looking for:
https://forums.sagetv.com/forums/sho...=exemultituner
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA
Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA
Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server
Reply With Quote
  #44  
Old 08-16-2018, 03:00 PM
turak's Avatar
turak turak is offline
Sage Expert
 
Join Date: Sep 2003
Location: Miami
Posts: 560
That is exactly what I'm looking for, but it appears that it does not work with SageTV V9.
Reply With Quote
  #45  
Old 08-17-2018, 01:40 AM
turak's Avatar
turak turak is offline
Sage Expert
 
Join Date: Sep 2003
Location: Miami
Posts: 560
It does work. You just have to use a different registry key:

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Frey Technologies\Common\EXEMultiTunerPlugin
Reply With Quote
  #46  
Old 08-17-2018, 03:45 PM
turak's Avatar
turak turak is offline
Sage Expert
 
Join Date: Sep 2003
Location: Miami
Posts: 560
I updated my gentuner script from the first page of this thread to support Genie mini clients. It works well with EXEMultitunerPlugin. I updated the code block on the first page, but I'll also leave a copy here in case anybody wants to use it.

tune.pl.txt
  • I installed strawberry perl on my windows box.
  • I made a batch file called tune_it.bat to call my perl script. This may not be needed, but I was troubleshooting the issue of having the wrong registry key and this works. The batch file simply contains: C:\Strawberry\perl\bin\perl.exe C:\TuneChannel\tune.pl TUNE %*
  • My registry key is:
    Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Frey Technologies\Common\EXEMultiTunerPlugin
    command REG_SZ c:\TuneChannel\tune_it.bat %DEVICE% %CHANNEL%
Reply With Quote
  #47  
Old 10-14-2019, 08:20 PM
jchiso jchiso is offline
Sage Expert
 
Join Date: Nov 2003
Location: Columbus, OH
Posts: 674
I'm back to trying (and failing) to get gentuner working on a v9 Linux server. My source lists as a 'Generic Stub Device', and when I try to change the Tuning Device from the list, there are no devices that show up.

In the old 32-bit version of the tuner there was a remotes config file in which the devices were defined. Apparently gentuner does not recognize the config file. How are the sources enumerated such that they appear in the pick list? Is there specific syntax or location for these data?
Reply With Quote
  #48  
Old 10-14-2019, 08:31 PM
jpwegas jpwegas is offline
Sage Expert
 
Join Date: May 2007
Posts: 502
Quote:
Originally Posted by jchiso View Post
I'm back to trying (and failing) to get gentuner working on a v9 Linux server. My source lists as a 'Generic Stub Device', and when I try to change the Tuning Device from the list, there are no devices that show up.

In the old 32-bit version of the tuner there was a remotes config file in which the devices were defined. Apparently gentuner does not recognize the config file. How are the sources enumerated such that they appear in the pick list? Is there specific syntax or location for these data?
The devices are defined in the gentuner script itself, which you have to customize for your own setup depending on how you are tuning. I don't remember seeing a gentuner example that reads from the remotes file, although of course someone could have created one. The docs are here: https://github.com/jwittkoski/Generi...ster/README.md and there are some example gentuner files in that repo as well.

Can you describe what types of tuners you are using?

--John
Reply With Quote
  #49  
Old 10-14-2019, 08:43 PM
jpwegas jpwegas is offline
Sage Expert
 
Join Date: May 2007
Posts: 502
You can test gentuner by running the gentuner script directly. I recommend testing it this way before trying to configure anything from within Sage.

For example:

Code:
$ cd /opt/sagetv/server/
$ ./gentuner REMOTES
FiOS-TV-1
FiOS-TV-2
FiOS-TV-3
$ ./gentuner TUNE FiOS-TV-1 504
$
--John
Reply With Quote
  #50  
Old 10-14-2019, 09:49 PM
jchiso jchiso is offline
Sage Expert
 
Join Date: Nov 2003
Location: Columbus, OH
Posts: 674
Quote:
Originally Posted by jpwegas View Post
You can test gentuner by running the gentuner script directly. I recommend testing it this way before trying to configure anything from within Sage.

For example:

Code:
$ cd /opt/sagetv/server/
$ ./gentuner REMOTES
FiOS-TV-1
FiOS-TV-2
FiOS-TV-3
$ ./gentuner TUNE FiOS-TV-1 504
$
--John
Here is my confusion on these examples:
  • I understand that "gentuner" is the tuning script; which HAS to be named "gentuner"
  • I don't know what 'REMOTES' means in this context; is it an argument of the gentuner command?
  • I assume the 'FIOS-TV-#' are devices, but are there supposed to be files with corresponding names?
  • What is the 'TUNE' term? Is it a command, an argument, a filename? is it required?
My script just passes two arguments (channel number, tuning device) to a simple wget command. In the old (32-bit) tuning command it read the Tuning Devices list from a separate configuration file, but once those were defined all of the commands were controlled by the script.

I'm just having trouble trying to understand the structure and requirements of this version of the tuner ...

Edit: I also should have mentioned that when I tried to run the gentuner from a command line I get a 'permission denied' warning.

Last edited by jchiso; 10-14-2019 at 09:59 PM. Reason: Permissions problem
Reply With Quote
  #51  
Old 10-15-2019, 04:57 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I'd recommend that you read the README the jpwegas linked to, since, I think it covers all your questions, and, it's there to help understand the requirements of gentuner.

I'd also look at some of the example scripts, like this one...
https://github.com/jwittkoski/Generi...gentuner.IPSTB

since they pretty show how it all works (but read the README first).

On unix systems, scripts will need the execute bit set in order to be run.

chmod +x gentuner



Quote:
Originally Posted by jchiso View Post
Here is my confusion on these examples:
  • I understand that "gentuner" is the tuning script; which HAS to be named "gentuner"
  • I don't know what 'REMOTES' means in this context; is it an argument of the gentuner command?
  • I assume the 'FIOS-TV-#' are devices, but are there supposed to be files with corresponding names?
  • What is the 'TUNE' term? Is it a command, an argument, a filename? is it required?
My script just passes two arguments (channel number, tuning device) to a simple wget command. In the old (32-bit) tuning command it read the Tuning Devices list from a separate configuration file, but once those were defined all of the commands were controlled by the script.

I'm just having trouble trying to understand the structure and requirements of this version of the tuner ...

Edit: I also should have mentioned that when I tried to run the gentuner from a command line I get a 'permission denied' warning.
Reply With Quote
  #52  
Old 10-15-2019, 07:57 AM
jchiso jchiso is offline
Sage Expert
 
Join Date: Nov 2003
Location: Columbus, OH
Posts: 674
I've seen the README file(s) and examples, but the issues I mentioned are not addressed in those documents.

I have the gentuner script set as executable; it's was executable in its prior incarnation in v7 32-bit. I can run it from a command line (albeit only preceded by 'sudo') and it executes the channel change. The issue I have is in getting a list of Tuning Devices into the Sage sources setup dialog. I am stuck at a "Generic Stub Device", with no other Tuning Device options ...
Reply With Quote
  #53  
Old 10-15-2019, 09:55 AM
jpwegas jpwegas is offline
Sage Expert
 
Join Date: May 2007
Posts: 502
Quote:
Originally Posted by jchiso View Post
Here is my confusion on these examples:
  • I understand that "gentuner" is the tuning script; which HAS to be named "gentuner"
  • I don't know what 'REMOTES' means in this context; is it an argument of the gentuner command?
  • I assume the 'FIOS-TV-#' are devices, but are there supposed to be files with corresponding names?
  • What is the 'TUNE' term? Is it a command, an argument, a filename? is it required?
Quote:
Originally Posted by jchiso View Post
I've seen the README file(s) and examples, but the issues I mentioned are not addressed in those documents.
To summarize the README for your questions:
  • If gentuner gets a REMOTES argument, it should return the names of the "remotes" you want to expose.
  • The device names are specified in gentuner itself. There is no need to read anything from a file (unless you want to modify your customer gentuner to do that, which seems overkill).
  • If gentuner gets a TUNE argument, it should tune the channel specified using the remote name specified.

The gentuner.IPSTB is a very simple example of a working script for a single remote. It only needs to do 3 things:
  • Return "OK" when it sees the "CAN_TUNE" argument
  • Return a list of remotes when it sees the "REMOTE" argument
  • Tune the channel when it sees the "TUNE" argument

To test your script:
  • When you run "./gentuner CAN_TUNE" it should print "OK".
  • When you run "./gentuner REMOTES" it should list your remotes(s).
  • When you run "./gentuner TUNE STB1 504" it should tune device STB1 to channel 504 (assuming in this example you have changed gentuner so that your remote is named "STB1")

From your description, it sounds like those commands work as expected, so the fact that you have to run it using 'sudo' makes me suspect that your problem is the user that is running the SageTV process cannot run the gentuner script.

Who is Sage running as? What are the permissions for the gentuner script? Can you post the gentuner script you are using?

--John
Reply With Quote
  #54  
Old 10-15-2019, 09:58 AM
jpwegas jpwegas is offline
Sage Expert
 
Join Date: May 2007
Posts: 502
Quote:
Originally Posted by jchiso View Post
The issue I have is in getting a list of Tuning Devices into the Sage sources setup dialog.
Just to be clear, SageTV uses the output of "./gentuner REMOTES" to populate the tuning devices within Sage. If it can't run the gentuner script it will not be able to create the list. That's why I suspect it is a permission issue.

--John

Last edited by jpwegas; 10-15-2019 at 09:59 AM. Reason: spelling
Reply With Quote
  #55  
Old 10-15-2019, 12:51 PM
jchiso jchiso is offline
Sage Expert
 
Join Date: Nov 2003
Location: Columbus, OH
Posts: 674
Quote:
Originally Posted by jpwegas View Post
To summarize the README for your questions:[LIST][*]If gentuner gets a REMOTES argument, it should return the names of the "remotes" you want to expose.[*]The device names are specified in gentuner itself.
How are the device names specified in gentuner? Is there a "REMOTES" clause or identifier? The posted examples don't show lists of defined Tuner Devices. The "./gentuner REMOTES" command does not return anything, because the Tuning Devices are not defined anywhere. That is my major issue. The script is really simple, just two (SageTV-defined) arguments of Tuning Device and Channel. If I enter "[sudo]./gentuner DSS6 340" it tunes channel 340 on the device I have defined in the script as the active Tuning Device.

The problem is my not knowing how to populate the Tuning Device options within Sage ...
Reply With Quote
  #56  
Old 10-15-2019, 01:04 PM
jpwegas jpwegas is offline
Sage Expert
 
Join Date: May 2007
Posts: 502
Quote:
Originally Posted by jchiso View Post
How are the device names specified in gentuner? Is there a "REMOTES" clause or identifier? The posted examples don't show lists of defined Tuner Devices. The "./gentuner REMOTES" command does not return anything, because the Tuning Devices are not defined anywhere. That is my major issue. The script is really simple, just two (SageTV-defined) arguments of Tuning Device and Channel. If I enter "[sudo]./gentuner DSS6 340" it tunes channel 340 on the device I have defined in the script as the active Tuning Device.

The problem is my not knowing how to populate the Tuning Device options within Sage ...
You must modify the gentuner script to return the names you want to appear in SageTV. They can be whatever you want.

For example, in gentuner.IPSTB, it's this line:

https://github.com/jwittkoski/Generi...uner.IPSTB#L23

SageTV uses the output of "./gentuner REMOTES" to populate the tuning devices within Sage.

Can you post your version of gentuner?

--John
Reply With Quote
  #57  
Old 10-15-2019, 06:05 PM
jchiso jchiso is offline
Sage Expert
 
Join Date: Nov 2003
Location: Columbus, OH
Posts: 674
Quote:
Originally Posted by jpwegas View Post
Who is Sage running as? What are the permissions for the gentuner script? Can you post the gentuner script you are using?
Near as I can tell, the Sage server is running as "user #2000". I have no idea what that means. The gentuner script is running as "root".

This is running under Ubuntu 18.04, so I don't know how or why these permissions were set, or what they should be. I may just have to scrub this Sage install and start from scratch ...
Reply With Quote
  #58  
Old 10-16-2019, 08:56 PM
jpwegas jpwegas is offline
Sage Expert
 
Join Date: May 2007
Posts: 502
Quote:
Originally Posted by jchiso View Post
Near as I can tell, the Sage server is running as "user #2000". I have no idea what that means. The gentuner script is running as "root".

This is running under Ubuntu 18.04, so I don't know how or why these permissions were set, or what they should be. I may just have to scrub this Sage install and start from scratch ...
The owner of the gentuner executable on disk doesn't have to be the same as the one running it. When SageTV runs it, it will run as the user that SageTV is running as.

To check on the user the SageTV process is running as, you can:

Code:
ps -ef | grep -v grep | grep sage.Sage | cut -d" " -f1
In my case the user is 'sagetv', but it may be something different on your box.

To test the gentuner script as the user that SageTV runs as, run this, replacing USER with the user SageTV is running as from the above command:
Code:
su - USER -c "/opt/sagetv/server/gentuner REMOTES"
Can you post the output of the above command and also post the output of:
Code:
ls -la /opt/sagetv/server/gentuner
--John
Reply With Quote
  #59  
Old 10-16-2019, 09:28 PM
wnjj wnjj is offline
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
If it’s not running as the same user who owns the file, it needs to have execute permissions for all users:

chmod a+x gentuner
Reply With Quote
  #60  
Old 10-17-2019, 04:53 PM
jchiso jchiso is offline
Sage Expert
 
Join Date: Nov 2003
Location: Columbus, OH
Posts: 674
Quote:
Originally Posted by jpwegas View Post
Code:
ps -ef | grep -v grep | grep sage.Sage | cut -d" " -f1
It's running as 'root'
Quote:
Originally Posted by jpwegas View Post
To test the gentuner script as the user that SageTV runs as, run this, replacing USER with the user SageTV is running as from the above command:
Code:
su - USER -c "/opt/sagetv/server/gentuner REMOTES"
It's gives me an 'Authentication Failure' message, even after entering the password.
Quote:
Originally Posted by jpwegas View Post
Can you post the output of the above command and also post the output of:
Code:
ls -la /opt/sagetv/server/gentuner
  • -rwx--x--x 1 root root 959 Oct 17 01:24 /opt/sagetv/server/gentuner
--John
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
External Command Tuner Plugin for Linux stuckless SageTV Linux 36 05-16-2017 03:11 PM
Plugin Request: Run external command on error tedson SageTV v7 Customizations 10 06-14-2010 07:32 PM
Adding custom command for launching external program dinki SageMC Custom Interface 14 01-22-2010 08:16 AM
Getting the status after running an external command pedz25 SageMC Custom Interface 0 04-05-2009 06:55 AM
Fail to launch PowerDVD Ultra as external command basset SageTV Customizations 4 12-20-2007 11:59 AM


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


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