SageTV Community  

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

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #21  
Old 02-07-2019, 04:40 PM
will will is offline
Sage Fanatic
 
Join Date: Jul 2009
Location: New York
Posts: 798
Quote:
Originally Posted by graywolf View Post
Thoughts on what i might be missing?
So EXEMultiTunerPlugin should be a key and the key should have a string called command. I put the batch script in the SageTV folder, the same folder with the SageTV.exe.

I've attached a screenshot of how my registry looks.

I hope this helps.
Attached Images
File Type: png Screen Shot 2019-02-07 at 17.35.21 PM.png (38.1 KB, 265 views)
__________________
Will

OS: Windows 7
Hardware: Intel Core i7-920 with 12GB RAM & an Adaptec 5805 with a Chenbro 36-port SAS Expander
Case: Antec 1200 with 4 iStarUSA trayless hot-swap cages (20 drives max)
Drives: 8 Toshiba/Hitachi 2TB drives in a RAID 6 & 7 Toshiba 3TB drives in a RAID 6
Capture Cards: HDHomeRun Connect Quatro 4, Hauppauge 60 HD-PVR
Players: 5 HD300s, 2 HD200s
Reply With Quote
  #22  
Old 02-09-2019, 10:47 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Here is the current setup and test.
If my hair was long enough to grab, I'd be pulling the little enough that I have out.

Video Source Setup:
Code:
Hauppauge WinTV 418 Video Capture #2 S-Video   (this is a HVR-1600 card)
Functioning: true
Network Encoder: false
Currently Being Used for Live TV: false
Input Type: S-Video
RF Channel: N/A
EPG Lineup: Hauppauge WinTV 418 Video Capture #2 S-Video
Tuner Control: EXEMultiTunerPlugin 2
Registry entry:
Code:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Frey Technologies\Common\EXEMultiTunerPlugin
Name = command
Type = REG_SZ
Data = "C:\SageTV\SageTV\RokuMultiChannelChg.bat %DEVICE% %CHANNEL%"
I have tried with and without quotes for the Data.
I have tried with and without the full path


2.ir is located at C:\SageTV\Common\RemoteCodes\EXEMultiTunerPlugin
and contains:
Code:
2 38000 400 3
Also tried it with the IP instead of 2 for the first value in the .ir file

EXEMultiTunerPlugin.dll is located at C:\SageTV\Common

RokuMultiChannelChg.bat is located at C:\SageTV\SageTV
it contains at the top of the script:
Code:
echo on
setlocal
echo "Start RokuMultiChannelChg script " >> C:\SageTV\SageTV\logs\Roku.logs
If the bat file is ran from dos prompt, it changes the Live TV channel in SageTV and writes to a log file. Does not write to the log file if select the channel thru Sage

Example contents of the log file when ran from dos.
c:\SageTV\SageTV>RokuMultiChannelChg.bat 2 901
Code:
"Start RokuMultiChannelChg script " 
"CURDEVICE=2" 
"Sat 02/09/2019 11:33:06.12 CHANRAW=901" 
"Sat 02/09/2019 11:33:06.21 Inside if FOXNEWS"
Attached is a sagetv_0.txt file for the testing thru sagetv

SageTV is creating the MPG files, of course they don't contain the actual show since EXEMultiTunerPlugin isn't changing the channels
Attached Files
File Type: txt sagetv_0 - Copy.txt (13.0 KB, 190 views)
Reply With Quote
  #23  
Old 02-09-2019, 11:47 AM
wnjj wnjj is offline
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
When I get some time, I can build you a jar and/or DLL with better logging in it. I see the place where it’s calling the tuning in the log file but after that it starts calling into the DLL to check the registry, etc. and there’s no more logging in that code but plenty of things to fail.
Reply With Quote
  #24  
Old 02-09-2019, 01:53 PM
JustFred JustFred is offline
Sage Expert
 
Join Date: May 2015
Location: Sunnyvale, Ca
Posts: 572
The Sage source code calls CreateProcessW(). As it is, a batch file can't be launched directly. So the EXEMultiTunerPlugin key needs to point to an .exe file. There are utilities that'll create an .exe from your .bat file.

Beware: running Sage as a service will add another dimension to the problem, because the .exe will run in the same security context (user id) as the service. I found it easier to debug this by launching the non-service version of Sage.

https://docs.microsoft.com/en-us/win...createprocessw

EDIT:
Another solution here
__________________
System #1: Win7-64, I7-920, 8 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HDHR-US (1st gen white) tuners. HD-200.
System #2: Win7-64, I7-920, 8 GB mem, 4TB HD. Java 1.8.0_131. Sage v9.1.6.747. ClearQAM: 2x HDHR3-US tuners. HD-200.
System #3: Win7-64, I7-920, 12 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HVR2250; Spectrum Cable via HDPVR & USB-UIRT. 3x HD-200.

Last edited by JustFred; 02-17-2019 at 12:13 AM.
Reply With Quote
  #25  
Old 02-09-2019, 02:05 PM
wnjj wnjj is offline
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Quote:
Originally Posted by JustFred View Post
The Sage source code calls CreateProcessW(). Microsoft says you can't launch a batch file this way. So the EXEMultiTunerPlugin key needs to point to an .exe file. There are utilities that'll create an .exe from your .bat file.

Beware: running Sage as a service will add another dimension to the problem, because the .exe will run in the same security context (user id) as the service. I found it easier to debug this by launching the non-service version of Sage.

https://docs.microsoft.com/en-us/win...createprocessw
Then can’t you just call cmd.exe with the batch file behind it? Also, Bob said he’s using a batch file.

Last edited by wnjj; 02-09-2019 at 02:07 PM.
Reply With Quote
  #26  
Old 02-09-2019, 02:34 PM
JustFred JustFred is offline
Sage Expert
 
Join Date: May 2015
Location: Sunnyvale, Ca
Posts: 572
Quote:
Originally Posted by wnjj View Post
Then can’t you just call cmd.exe with the batch file behind it? Also, Bob said he’s using a batch file.
I thought of that too, and tried "cmd.exe /c c:\DoSomething.bat", but it didn't work.
__________________
System #1: Win7-64, I7-920, 8 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HDHR-US (1st gen white) tuners. HD-200.
System #2: Win7-64, I7-920, 8 GB mem, 4TB HD. Java 1.8.0_131. Sage v9.1.6.747. ClearQAM: 2x HDHR3-US tuners. HD-200.
System #3: Win7-64, I7-920, 12 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HVR2250; Spectrum Cable via HDPVR & USB-UIRT. 3x HD-200.
Reply With Quote
  #27  
Old 02-09-2019, 07:17 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Batch file works fine for me tuning a DirecTV STB. Actually it works on two different servers both recording from HD-PVRs. One of the servers has two HD-PVRs and the other has a single one.

Here is the registry entry on both 64 bit servers:
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Frey Technologies\Common\EXEMultiTunerPlugin]
"command"="DirecTVMultiChg.bat %DEVICE% %CHANNEL%"
The paths to the various files:
Code:
C:\Program Files\SageTV\SageTV\DirecTVMultiChg.bat
C:\Program Files\SageTV\SageTV\dtvTune.exe

C:\Program Files\SageTV\Common\EXEMultiTunerPlugin.dll

C:\Program Files\SageTV\Common\RemoteCodes\EXEMultiTunerPlugin\192.168.0.30.ir
C:\Program Files\SageTV\Common\RemoteCodes\EXEMultiTunerPlugin\192.168.0.32.ir
Code:
Inside 192.168.0.30.ir is "192.168.0.30 38000 400 3 "
Inside 192.168.0.32.ir is "192.168.0.32 38000 400 3 "

without the quotes
I also attached the bat file itself but it is just a slightly modified version of the original one in the thread I got it from renamed to .txt so that I can upload it.

I will try to change the name of the IR files tomorrow. I think the only thing the name is really good for is showing up in the GUI but I will do a little property file editing and rename the two ir files and report back.


The only real problem I have is one of the two boxes goes to sleep and I haven't had time to change the bat file to use something other than dtvTune to actually tune the box.
Attached Files
File Type: txt DirecTVMultiChg.bat.txt (1.6 KB, 186 views)
__________________
"Keep your goals away from the trolls"
Reply With Quote
  #28  
Old 02-09-2019, 07:47 PM
wnjj wnjj is offline
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Bob,

Good info there. According to the source code, the name of the .ir file is passed in as the %DEVICE% parameter in the registry call. I suspect yours will break if you rename an .ir file.
Reply With Quote
  #29  
Old 02-09-2019, 07:49 PM
JustFred JustFred is offline
Sage Expert
 
Join Date: May 2015
Location: Sunnyvale, Ca
Posts: 572
Quote:
Originally Posted by BobPhoenix View Post
Batch file works fine for me tuning a DirecTV STB. Actually it works on two different servers both recording from HD-PVRs.
What OS is this on? Is Sage running as a service? Any possibility that you've used Control Panel to "Set Associations" to associate .bat with cmd.exe or some other executable?

I'm running Win7-x64. My EXEMultiTunerPlugin won't launch a bat file, but does launch an exe. I have a hunch that this plugin got it's name for a reason.
__________________
System #1: Win7-64, I7-920, 8 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HDHR-US (1st gen white) tuners. HD-200.
System #2: Win7-64, I7-920, 8 GB mem, 4TB HD. Java 1.8.0_131. Sage v9.1.6.747. ClearQAM: 2x HDHR3-US tuners. HD-200.
System #3: Win7-64, I7-920, 12 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HVR2250; Spectrum Cable via HDPVR & USB-UIRT. 3x HD-200.
Reply With Quote
  #30  
Old 02-09-2019, 07:49 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by wnjj View Post
Bob,

Good info there. According to the source code, the name of the .ir file is passed in as the %DEVICE% parameter in the registry call. I suspect yours will break if you rename an .ir file.
OK that is what I was going to test out. I prefer it with the IP address anyway so I wouldn't be leaving it that way in any case.
__________________
"Keep your goals away from the trolls"
Reply With Quote
  #31  
Old 02-11-2019, 09:02 AM
will will is offline
Sage Fanatic
 
Join Date: Jul 2009
Location: New York
Posts: 798
Quote:
Originally Posted by graywolf View Post
Registry entry:
Code:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Frey Technologies\Common\EXEMultiTunerPlugin
Name = command
Type = REG_SZ
Data = "C:\SageTV\SageTV\RokuMultiChannelChg.bat %DEVICE% %CHANNEL%"
I have tried with and without quotes for the Data.
I have tried with and without the full path
Have you tried it without putting the full path in the registry, e.g., not using C:\SageTV\SageTV\RokuMultiChannelChg.bat just RokuMultiChannelChg.bat (like I do)?
__________________
Will

OS: Windows 7
Hardware: Intel Core i7-920 with 12GB RAM & an Adaptec 5805 with a Chenbro 36-port SAS Expander
Case: Antec 1200 with 4 iStarUSA trayless hot-swap cages (20 drives max)
Drives: 8 Toshiba/Hitachi 2TB drives in a RAID 6 & 7 Toshiba 3TB drives in a RAID 6
Capture Cards: HDHomeRun Connect Quatro 4, Hauppauge 60 HD-PVR
Players: 5 HD300s, 2 HD200s
Reply With Quote
  #32  
Old 02-11-2019, 10:00 AM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by will View Post
Have you tried it without putting the full path in the registry, e.g., not using C:\SageTV\SageTV\RokuMultiChannelChg.bat just RokuMultiChannelChg.bat (like I do)?
Yes, tried all 4 combos
Full path with and without quotes
No path with and without quotes

I’m assuming that no recycle of sagetv service is needed after registry modifications

Last edited by graywolf; 02-11-2019 at 10:03 AM. Reason: Additional info
Reply With Quote
  #33  
Old 02-11-2019, 10:55 AM
wnjj wnjj is offline
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Looking at the code, it need full access (read/write) to the registry key (though it should be changed to not need write). Can you confirm all permissions are open? This is particularly important for service mode since it’s probably running as a different user than when you created the key.
Reply With Quote
  #34  
Old 02-11-2019, 12:50 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by wnjj View Post
Looking at the code, it need full access (read/write) to the registry key (though it should be changed to not need write). Can you confirm all permissions are open? This is particularly important for service mode since it’s probably running as a different user than when you created the key.
I’ll have to double check tonight but think I only have 1 userid defined
Reply With Quote
  #35  
Old 02-11-2019, 05:59 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by wnjj View Post
Looking at the code, it need full access (read/write) to the registry key (though it should be changed to not need write). Can you confirm all permissions are open? This is particularly important for service mode since it’s probably running as a different user than when you created the key.
Confirmed. Only 1 UserID (admin access) defined/used.
Reply With Quote
  #36  
Old 02-11-2019, 06:27 PM
wnjj wnjj is offline
Sage Icon
 
Join Date: Jan 2009
Posts: 1,514
Quote:
Originally Posted by graywolf View Post
Confirmed. Only 1 UserID (admin access) defined/used.
Also confirm if the registry permission are set to 'full control' for that user (or everyone). Look under the Edit|Permissions menu in regedit.
Reply With Quote
  #37  
Old 02-12-2019, 04:11 PM
graywolf's Avatar
graywolf graywolf is offline
Sage Icon
 
Join Date: Oct 2009
Location: NC
Posts: 1,389
Quote:
Originally Posted by wnjj View Post
Also confirm if the registry permission are set to 'full control' for that user (or everyone). Look under the Edit|Permissions menu in regedit.
EVERYONE = Full Control & Read have Checks
Reply With Quote
  #38  
Old 02-16-2019, 07:36 PM
JustFred JustFred is offline
Sage Expert
 
Join Date: May 2015
Location: Sunnyvale, Ca
Posts: 572
Quote:
Originally Posted by wnjj View Post
Then can’t you just call cmd.exe with the batch file behind it? Also, Bob said he’s using a batch file.
Quote:
Originally Posted by JustFred View Post
I thought of that too, and tried "cmd.exe /c c:\DoSomething.bat", but it didn't work.
I've discovered my error: incorrect use of quotes in the registry entry. There have been many postings showing the *entire* registry string is quoted, such as:

Code:
"C:\Channel Change.BAT %DEVICE% %CHANNEL%"
The above doesn't work, for two reasons:
1. The Sage source code uses CreateProcessW(). Microsoft says that cmd.exe is needed to launch a .bat file.
2. Placing quotes around the entire string makes it appear as a single argument.

The solution is:
Code:
cmd.exe /c "C:\Channel Change.BAT" %DEVICE% %CHANNEL%
Of note:
1. The quotes are needed when there are any spaces in the path or program name.

2. When the executable is launched, it runs in the security context (user id) of SageTv.exe. It runs with its current working directory (CWD) set to wherever SageTv.exe is that launched it. This means the registry entry can omit the bat file's path if it's located in the CWD; otherwise the full path to the .bat file must be specified.

3. If the .bat file itself references any file (such as logfile.txt), then that file must either exist in the CWD or be specified with its full path.

4. Sage re-reads the registry value each time a channel change is called for. It's ok to change that value while Sage is running.

5. The .ir file should contain an empty line at the end.
Attached Images
File Type: jpg Registry entry - right.jpg (31.0 KB, 206 views)
File Type: jpg Registry entry - wrong.jpg (34.4 KB, 197 views)
__________________
System #1: Win7-64, I7-920, 8 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HDHR-US (1st gen white) tuners. HD-200.
System #2: Win7-64, I7-920, 8 GB mem, 4TB HD. Java 1.8.0_131. Sage v9.1.6.747. ClearQAM: 2x HDHR3-US tuners. HD-200.
System #3: Win7-64, I7-920, 12 GB mem, 4TB HD. Java-64 1.8.0_141. Sage-64 v9.2.1 ATSC: 2x HVR2250; Spectrum Cable via HDPVR & USB-UIRT. 3x HD-200.

Last edited by JustFred; 02-17-2019 at 07:04 PM. Reason: better screen-grab of registry contents
Reply With Quote
  #39  
Old 06-13-2021, 10:42 PM
jchiso jchiso is offline
Sage Expert
 
Join Date: Nov 2003
Location: Columbus, OH
Posts: 674
Quote:
Originally Posted by wnjj View Post
Also confirm if the registry permission are set to 'full control' for that user (or everyone). Look under the Edit|Permissions menu in regedit.
Wow. This just eliminated a perfectly un-solvable problem that I've had for years, with 32-bit Win 8.1 ...
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
ExeMultiTuner thopkin1 SageTV v9 Customizations 85 11-24-2019 11:04 AM
exemultituner download? mrrrl SageTV Customizations 1 07-19-2008 09:24 PM
EXEMultiTuner.dll MrD Hardware Support 0 04-05-2008 11:58 PM
ExeMultiTuner Bug mike1961 Hardware Support 2 03-10-2008 09:20 PM
Where is exemultituner ? EricandLorrie Hardware Support 3 12-23-2006 01:00 PM


All times are GMT -6. The time now is 05:25 PM.


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