NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Linux v
1 2 3 4 5 … 34 Next »
HDMI nwk encoder as a tuner

 
  • 0 Vote(s) - 0 Average
HDMI nwk encoder as a tuner
tsv
Offline

Junior Member

United States
Posts: 6
Threads: 1
Joined: Feb 2025
#1
2025-02-20, 10:37 PM (This post was last modified: 2025-02-20, 10:43 PM by tsv.)
Hello,

I am having issues getting hdmi encoder to work with NextPVR on Ubuntu 24.04 server. Below are
the steps I have taken. I can't use m3u route, adding as IPTV source, because I need
to execute a channel changing script when the channel is selected.

0.NextPVR version 7.9.1.241229
1. create extras device in /var/opt/nextpvr/extras-c84.xml
2. webui - devices>extra recorder(extras-c84.xml)>scan channels>save
3. not remapping at this time, but would remap channels to SD source for epg
4. test play - channels>1-CHAN1 - no tuner was available for the requested channel.

This is extras xml, both entries are for testing purposes, one direct, one with future
channel tunning script.
extras-c84.xml:
<extras>
  <channel name="CHAN">
    <command> curl </command>
    <args> "-s http://192.168.15.184/0.ts " </args>
  </channel>
  <channel name="CHAN">
    <command> bash </command>
    <args>-c /var/opt/nextpvr/scripts/c84_e.sh </args>
  </channel>
</extras>

This is future tuning script:
/var/opt/nextpvr/scripts/c84_e.sh:

# tuning code
curl -s http://192.168.15.184/0.ts

Looking at the logs, this looks to be the error:
2025-02-20 16:19:26.028 [DEBUG][124] live tv is possible
2025-02-20 16:19:26.028 [DEBUG][124] Running:  curl  "-s http://192.168.15.184/0.ts "
2025-02-20 16:19:26.028 [ERROR][124] Unexpected error calling StartStream(): System.ComponentModel.Win32Exception (2): An error occurred trying to start process ' curl ' with working directory '/opt/nextpvr/system'. No such file or directory
  at System.Diagnostics.Process.ForkAndExecProcess(ProcessStartInfo startInfo, String resolvedFilename, String[] argv, String[] envp, String cwd, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
  at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
  at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
  at NShared.ExtrasRecorder.StartStream(ChannelMapping channelMapping, String target, String& reason)
  at NShared.RecordingService.StartStream(Int32 channelOID, String target, Int32 previousHandle, ChannelMapping& returnMapping, String& reason)
  at NShared.RecordingServiceProxy.StartStream(Int32 channelOID, String target, Int32 previousHandle, ChannelMapping& channelMapping, String& reason)
2025-02-20 16:19:26.028 [DEBUG][124] StartStream(7160:ESPNHD, LIVE&/home/recordings/live-ESPNHD-889-5.ts) allocated handle: 0
2025-02-20 16:19:26.028 [DEBUG][124] Handle: 0
2025-02-20 16:19:26.028 [DEBUG][124] Failed to start stream. Handle 0.
2025-02-20 16:19:26.029 [DEBUG][124] [FFMPEG]: [http @ 0x5ae99049e680] HTTP error 404 Not Found
2025-02-20 16:19:26.029 [DEBUG][124] [FFMPEG]: [in#0 @ 0x5ae99049de00] Error opening input: Server returned 404 Not Found
2025-02-20 16:19:26.029 [DEBUG][124] [FFMPEG]: Error opening input file http://127.0.0.1:8866/live?channeloid=71...467b38f3db.
2025-02-20 16:19:26.029 [DEBUG][124] [FFMPEG]: Error opening input files: Server returned 404 Not Found
2025-02-20 16:19:26.991 [DEBUG][118] {"stat":"Failed","code":11,"msg":"No tuner was available for the requested channel."}

it complains about "/opt/nextpvr/system" but the directory does exist... curl is installed.

Any suggestions? What am I missing? If there is a better route to implement
hdmi encoder as a tuner, I am open to suggestions. From searching the forums,
"extras" appears to be the correct way.

Thank you.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,184
Threads: 958
Joined: May 2006
#2
2025-02-20, 10:52 PM (This post was last modified: 2025-02-21, 12:01 AM by mvallevand.)
Why are you using quotes, you should run what works at the command line. I way to test the command line would be to turn off silent mode and see if it streams.

Code:
curl http://192.168.15.184/0.ts | cat - >/dev/null

Also it appears you have spaces around curl, if so remove them.

Martin
tsv
Offline

Junior Member

United States
Posts: 6
Threads: 1
Joined: Feb 2025
#3
2025-02-20, 11:59 PM
(2025-02-20, 10:52 PM)mvallevand Wrote: Why are you using quotes, you should run what works at the command line  Also do you have space around curl if so remove them.

Martin

Hi Martin,
That is just something I saw in other threads on this forum.

Thank you! Cleaning it up per your suggestions got the stream to appear.
tsv
Offline

Junior Member

United States
Posts: 6
Threads: 1
Joined: Feb 2025
#4
2025-02-21, 01:38 AM
(2025-02-20, 10:52 PM)mvallevand Wrote: Why are you using quotes, you should run what works at the command line.  I way to test the command line would be to turn off silent mode and see if it streams.

Code:
curl http://192.168.15.184/0.ts | cat - >/dev/null

Also it appears you have spaces around curl, if so remove them.

Martin

Hi Martin,
I have a couple of more dumb questions - 
My script in /var/opt/nextpvr/scripts/ gets invoked, but in it is just a basic execution of another powershell script, and it does not execute properly. There is nothing in the logs past the script invokation:
2025-02-20 18:22:00.347 [DEBUG][139] Running: bash -c /var/opt/nextpvr/scripts/c84_219e.sh

The script itself:
cd /usr/local/bin/adb_tuner
pwsh /usr/local/bin/adb_tuner/c84_219.ps1
curl -s http://192.168.15.184/0.ts

Are there any other logs in NextPVR that I can check for errors? Are there any tricks to executing the powershell? (it is installed and functioning properly when script is manually executed.

Also, Where can I clear the logs? In "About" section, I only see download option.

Thank you.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,184
Threads: 958
Joined: May 2006
#5
2025-02-21, 03:00 AM
Did you chmod +x the script and test that it works outside the extra

Martin
tsv
Offline

Junior Member

United States
Posts: 6
Threads: 1
Joined: Feb 2025
#6
2025-02-21, 03:59 AM
(2025-02-21, 03:00 AM)mvallevand Wrote: Did you chmod +x the script and test that it works outside the extra

Martin

Hi Martin,
tes, permissions are properly set, and it does function properly from the CLI.

Thank you.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,184
Threads: 958
Joined: May 2006
#7
2025-02-21, 04:13 AM
Sorry I don't no anything about running powershell on Linux. If you aren't getting the curl output maybe there is an issue with stdout

The zipped logs are downloaded on the main settings screen

Martinn
tsv
Offline

Junior Member

United States
Posts: 6
Threads: 1
Joined: Feb 2025
#8
2025-02-22, 07:15 PM
(2025-02-21, 04:13 AM)mvallevand Wrote: Sorry I don't no anything about running powershell on Linux.  If you aren't getting the curl output maybe there is an issue with stdout

The zipped logs are downloaded on the main settings screen

Martinn

Hi Martin,
I got it to work, no idea why, but it kept refusing to execute pwsh part, so I gave up on it, and re-wrote in bash. Also, since the script is time-consuming, it had another issue timing out before hitting the curl stream code. I ended up running tuning script in the background, but am curious of how long is the timeout of receiving the stream? and where can it be set? (if it can be).

Thank you.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,184
Threads: 958
Joined: May 2006
#9
2025-02-23, 02:52 PM
I think the timeout can be quite long. I have one HDPVR that takes 15 seconds (Linux AC-3 requirement) or so and it is OK. Sub would need to tell you if the normal lease is started before or after the extra is called.

Martin
tsv
Offline

Junior Member

United States
Posts: 6
Threads: 1
Joined: Feb 2025
#10
2025-05-22, 09:56 PM
Hi Martin,
I had some odd behavior with the execution of the tuning script. I was able to narrow it down to nextpvr not invoking it from extras xml unless the script was executed from outside nextpvr at least once. workaround that works well is using crontab. here's the summary of the concoction for the reference:
crontab:
@reboot /usr/local/bin/prime_tuner80.sh&

/usr/local/bin/prime_tuner80.sh:
sleep 60
bash -c "/usr/local/bin/tuner80.sh 0"

-tsv
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Can't record 1 subchannel and watch another w single tuner WagMan 2 642 2023-12-24, 05:18 PM
Last Post: WagMan
  One tuner gets fewer channels, will it get used first? WagMan 3 776 2023-12-09, 11:15 PM
Last Post: mvallevand
  Different Errors depending on channel (no tuner found/transcoding Error) idefixrc 3 908 2023-11-21, 12:45 PM
Last Post: mvallevand
  WinTV Dual HD tuner not detecting through NextPVR on RPI joshdee 11 2,054 2023-09-11, 09:39 PM
Last Post: LynnO
  No Dual tuner tvviewer 7 1,261 2023-08-21, 07:28 AM
Last Post: JamesAllen
  HDhomerun tuner lock collision JoeBob 3 920 2022-12-09, 03:31 PM
Last Post: mvallevand
  Current extras tuner process not stopped when recording on another channel is schedul greatwhitenorth 4 1,161 2022-12-04, 09:37 PM
Last Post: greatwhitenorth
  Fresh Xubuntu Install with Tuner Issues (or permissions issues?) larrybari 13 3,144 2022-11-16, 04:27 AM
Last Post: larrybari
  Sometimes pi unresponsive, tuner locked, still recording? TheRealRoland 4 1,390 2022-08-02, 07:19 PM
Last Post: TheRealRoland
  multi-tuner error spagio 7 1,543 2022-06-09, 12:07 AM
Last Post: mvallevand

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

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

Linear Mode
Threaded Mode