NextPVR Forums
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Hardware v
« Previous 1 … 3 4 5 6 7 … 261 Next »
Improve reliability of STB channel changing?

 
  • 0 Vote(s) - 0 Average
Improve reliability of STB channel changing?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 102,400
Threads: 741
Joined: Nov 2003
#11
2019-03-12, 12:46 AM
jksmurf Wrote:Seems like most of the hundreds of hours are by users...
I suspect you're right Big Grin
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#12
2019-03-15, 09:16 AM
sub Wrote:You might be able to look at running a batch file for your blaster, and starting the blaster from there with high priority.

Right after several more (hundreds of Big Grin) hours of testing, and asking on stackoverflow about batch files and priorities, I have a batch file which appears to work (reasonably well) from the command line, but alas, not in NextPVR. Still occasionally misses a number but at least it does priority; I hope.

GXPC4312H_StarterUUTX.bat calls GXPC4312H_UUTX.bat
GXPC4312H_StarterUUTX.bat sets the priority for GXPC4312H_UUTX.bat

As I said it works from the command line but it doesn't do anything in NextPVR? Seems odd?

Executable: C:\Users\Public\NPVR\ChanChg\GXPC4312H_StarterUUTX.bat
Arguments {channel}

GXPC4312H_StarterUUTX.bat
Code:
REM
SET command=GXPC4312H_UUTX.bat
start "" /REALTIME /B %command% %*
REM

GXPC4312H_UUTX.bat
Code:
@echo off
REM
REM Devcon.exe restart USB\VID_0403*
cd C:\users\public\NPVR\ChanChg\
set "channel=%1"
set "num=-1"
REM by KM
REM timeout 1
REM
:loop
set /a num=num+1
call set "name2=%%channel:~%num%,1%%"
if defined name2 (
REM ORIG SETTINGS uutx.exe -r3 -s500 -fGXPC4312H.ir %name2%
uutx.exe -r3 -s10 -fGXPC4312H.ir %name2%
echo %name2%
goto :loop
)
REM timeout 2
REM
REM This is supposed to make the guide go away but I turned it off on NowTV
REM
REM uutx.exe -r3 -s50 -fGXPC4312H_JP_Remote.ir BACK
REM
REM

Anything noticeable in the logs?

btw I also for the Pronto and irsend Codes for my Global Cache blaster but the GC people don't really have a blaster exectuable (too low tech for that device) as they rely on many other vendors to write horribly complex software for it. After some pestering they provided me an exe that will send codes via the IP Address of the GC but I would have to write ANOTHER batch file to send the codes seperately as their executable doesn't "do" {Channel_d1} or read off an IR Def as arguments.

They gave me this as a starter ...

Code:
@echo off

set ip="192.168.0.203"

:loop
if "%1"=="" goto :done

if "%1"=="1" goto :IR1
if "%1"=="2" goto :IR2
if "%1"=="2" goto :IR3
:: Continue if statements for as many digits/commands as necessary

:return
shift
goto :loop

::Make function for each IRn if statement above
:IR1
::Hard code IR code for 'IR1' case
.\main.exe %ip% 4998 sendir,1:1,1,38000,1,1,500,500
goto :return

:IR2
::Hard code IR code for 'IR2' case
.\main.exe %ip% 4998 sendir,1:1,1,38000,1,1,250,500
goto :return

:IR3
::Hard code IR code for 'IR3' case
.\main.exe %ip% 4998 sendir,1:1,1,38000,1,1,250,500
goto :return

:done
echo Complete

REM This will loop through the arguments and if they're a match to one of the predefined values it'll send the code in the matching "IRn" function. Then you would just call the batch file like this myBatch.bat 1 2 1 or with as many parameters as needed. Note: the batch file would need to be in the same directory as main.exe

I have also been experimenting with TST10.exe to do a similar thing... don't change that dial...

Meanwhile, on the plus side, I'm not actually watching any TV at all, as all my evenings are spent chasing blaster commands....

k.
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
Graham
Offline

Posting Freak

UK
Posts: 4,060
Threads: 102
Joined: Dec 2005
#13
2019-03-15, 11:23 AM
Does something a bit more simple help ...

bat1.cmd
Quote:set channel=%1
start /realtime /b c:\foldera\folderb\bat2.cmd

bat2.cmd

Quote:c:\folderx\folderz\uutx.exe blah blah %channel% blah

Plus NextPVR is able to provide the three digits as separate values. This would allow you to run uutx three times and send one digit each time that you run uutx. Might be more reliable.
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#14
2019-03-15, 12:23 PM
Cheers Graham will give it a whirl tomorrow probably.

I thought the {channel_d1}, {channel_d2}... {channel_d4} arguments were exclusive to usbuirtsend?
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 102,400
Threads: 741
Joined: Nov 2003
#15
2019-03-15, 03:43 PM
jksmurf Wrote:Meanwhile, on the plus side, I'm not actually watching any TV at all, as all my evenings are spent chasing blaster commands....
lol Big Grin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 102,400
Threads: 741
Joined: Nov 2003
#16
2019-03-15, 03:47 PM
jksmurf Wrote:I thought the {channel_d1}, {channel_d2}... {channel_d4} arguments were exclusive to usbuirtsend?
No.

When you setup a blaster in NextPVR you can specify the executable to run and any command line parameters to pass to the executable. You can make that command line anything you need to. Before running the executable though, NextPVR replace {channel} in the parameters with the channel number, and it'll replace {channel_d1}, {channel_d2}... {channel_d4} with a digit. The executable never actually sees these {token} type parameters, they are replaced by numbers prior to the executable being run.
BrettB
Offline

Posting Freak

Saint Paul, MN, USA
Posts: 2,521
Threads: 166
Joined: Jun 2007
#17
2019-03-16, 01:54 PM
jksmurf Wrote:GXPC4312H_StarterUUTX.bat
Code:
REM
SET command=GXPC4312H_UUTX.bat
start "" /REALTIME /B %command% %*
REM
I'd say make sure to use a the full path to GXPC4312H_UUTX.bat in the SET command line. When the batch file is run from NextPVR, the current directory is typically different from what it is when run from a command prompt.
jksmurf
Offline

Posting Freak

HK (DMBTH)
Posts: 3,590
Threads: 410
Joined: Jul 2005
#18
2019-03-17, 07:27 AM
Graham Wrote:Does something a bit more simple help ...

bat1.cmd

bat2.cmd

Plus NextPVR is able to provide the three digits as separate values. This would allow you to run uutx three times and send one digit each time that you run uutx. Might be more reliable.

Hiya,

It seems I'm terrible with batch files. This is what I am trying but it does not quite work.
The echo is just so I can see what is going on.

Bat1.bat
Code:
REM
echo %1
echo %2
echo %3
SET ChDigit1=%1
SET ChDigit2=%2
SET ChDigit3=%3
echo %ChDigit1%
echo %ChDigit2%
echo %ChDigit3%
REM
start "" /REALTIME /B C:\Users\Public\NPVR\ChanChg\GXPC4312H_UUTX.bat %ChDigit1% %ChDigit2% %ChDigit3%
REM

Bat2.bat
Code:
@echo on
REM
echo %ChDigit1%
echo %ChDigit2%
echo %ChDigit3%
C:\Users\Public\NPVR\ChanChg\uutx.exe -r3 -s50 -fGXPC4312H.ir %ChDigit1%
C:\Users\Public\NPVR\ChanChg\uutx.exe -r3 -s50 -fGXPC4312H.ir %ChDigit2%
C:\Users\Public\NPVR\ChanChg\uutx.exe -r3 -s50 -fGXPC4312H.ir %ChDigit3%
@echo off
REM

If I run the batch from the command line with GXPC4312H_StarterUUTX 325 it just says (3 times)

Code:
Error: missing IRCodeName.

UUTX Usage:
        uutx [-r<repeatCount> ] [-d<deviceNumber> ] [-s<sleepms>] "<IRCode>"
                -or-
        uutx [-r<repeatCount> ] [-d<deviceNumber> ] [-s<sleepms>] -f<fileName> <IRCodeName>

However if I run it from the command line with GXPC4312H_StarterUUTX 3 2 5 it works (i.e. with spaces between the numbers). It works but sometimes misses digits, although that is a separate problem. It also spawns a new command window each time i.e. it doesn't go away?

So I thought OK I will now try incorporating {channel_d1}{channel_d2}{channel_d3} in the calling batch In NextPVR) as the channel arguments. That doesn't work for me, no numbers come up at all.

Code:
019-03-17 15:09:02.602    [INFO][40]    Running blaster: C:\Users\Public\NPVR\ChanChg\GXPC4312H_StarterUUTX.bat 0 5 2
2019-03-17 15:09:02.676    [DEBUG][40]    About to tune graph to:
<tuning>
  <type>HDPVR</type>
  <locator>
    <channel>523</channel>
    <input>3</input>
    <audio_input>HDMI Audio Input</audio_input>
    <blaster_executable>C:\Users\Public\NPVR\ChanChg\GXPC4312H_StarterUUTX.bat</blaster_executable>
    <blaster_args>{channel_d1} {channel_d2} {channel_d3}</blaster_args>
  </locator>
</tuning>
2019-03-17 15:09:02.676    [DEBUG][40]    About to switch HDPVR/Colossus to target:
LIVE&D:\GBPVRLiveTVBuffer\live-FOXCRIME-31669.ts
2019-03-17 15:09:02.698    [INFO][40]    HDPVRRecorder.StartStream() allocated handle: 0x3E
2019-03-17 15:09:02.698    [DEBUG][40]    stopping previous handle
2019-03-17 15:09:02.698    [INFO][40]    HDPVRRecorder.StopStream(61)
2019-03-17 15:09:04.838    [INFO][40]    HDPVRRecorder.StopStream(62)
2019-03-17 15:09:04.847    [INFO][40]    No more streams active. Stopping device.
2019-03-17 15:09:04.848    [DEBUG][40]    Graph stopping...

If I just have ONE argument {channel} that does not work either.

Any other suggestions please?

k.
ASUS STRIX X470-F AMD 2700x 4GHz | Win10Prox64 | 32GB | NVIDIA GEforce GT1030 Fanless | WinTV DMB-TH | WinTV HVR-1280 | Hauppauge Colossus | AC86U/AC68U | USB-UIRT | RPi4 Libreelec | Sony Bravia LCD X9000F Android TV |
Graham
Offline

Posting Freak

UK
Posts: 4,060
Threads: 102
Joined: Dec 2005
#19
2019-03-17, 12:15 PM (This post was last modified: 2019-03-17, 12:21 PM by Graham.)
jksmurf Wrote:This is what I am trying but it does not quite work.

I'm not sure what you are doing with batch file names ... You give examples of files called bat1.bat and bat2.bat but the batch file "start"ed by bat1.bat is called GXPC4312H_UUTX.bat

You can put an EXIT command at the end of a batch file to force the batch file to end.

There is a SLEEP N command that cause a batch file to wait for N seconds ... This might help if you pause for a second between each of the three executions of uutx.

Also, I would experiment with and without the /B in the START command.

Also, I would try the three digit version without the bat1 and bat2 malarkey ... Set NextPVR to run the three digit version (with three executes of uutx) ... If it misses digits, try adding a SLEEP 1 between each execute.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 45,335
Threads: 866
Joined: May 2006
#20
2019-03-17, 01:14 PM
Since -f means filename and you don't change directories in your batch file you would need to add the path before the filename when you call this

-fGXPC4312H.ir

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (4): « Previous 1 2 3 4 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Add Colossus as a Single Channel source txinga 4 908 2022-01-04, 08:51 PM
Last Post: txinga
  Global Cache Channel Changer (IR Blaster) Executable jksmurf 0 1,686 2019-03-18, 08:07 AM
Last Post: jksmurf
  Channel export/import with capture device change ga_mueller 9 3,457 2016-10-24, 01:07 AM
Last Post: sub
  Channel changing a UK SKY HD+ (sky make) via hauppauge colossus 2 IR Blaster TheWiFiWizard 13 6,713 2016-09-13, 09:06 AM
Last Post: martint123
  AutoIt3 program to change channel with WinLIRC drake3 0 1,925 2016-03-02, 03:47 AM
Last Post: drake3
  Copy-Once and Copy-Freely by stream/program or channel? Lone_Stranger 10 5,346 2015-09-13, 12:15 AM
Last Post: sub
  HDPVR cannot change channel adc 8 4,123 2014-07-27, 02:40 AM
Last Post: sub
  Direct TV & IP Channel Changing smajor 2 1,543 2013-11-13, 03:12 PM
Last Post: smajor
  Channel changer? (which are good and small). SFX Group 2 1,460 2012-06-13, 11:06 PM
Last Post: JonnyCam
  Changing channels on a Motorola box via serial ls2 45 12,702 2012-03-29, 07:56 PM
Last Post: Jie

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode