SageTV Community

SageTV Community (http://forums.sagetv.com/forums/index.php)
-   SageTV Github Development (http://forums.sagetv.com/forums/forumdisplay.php?f=53)
-   -   Encoder Initialization Bug? (http://forums.sagetv.com/forums/showthread.php?t=66807)

Evil_Attorney 10-18-2021 09:44 AM

Encoder Initialization Bug?
 
I am cross posting a thread I created here because I suspect it might be a bug with Sage and would like to get some different eyes on this for suggestions.

I have two HDPVR2s that work well about 80% of the time but the other 20% have problems initializing a recording. It gives the error:
Code:

[MainMsg@9c4132] Built:sage.EncodingException: ERROR (-6,0x80004005): There was a problem setting up hardware video compression. Please be sure you have the latest drivers installed for your capture device, and that they are installed correctly.
Mon 10/11 22:00:10.493 [DistributeHookNetClients@1d1d849] Sending hook to client for MediaPlayerError args=[Capture, ERROR (-6,0x80004005): There was a problem setting up hardware video compression. Please be sure you have the latest drivers installed for your capture device, and that they are installed correctly.]
Mon 10/11 22:00:10.494 [DistributeHookNetClients@180da3a] Sending hook to client for SystemStatusChanged args=[]

What makes me think this is a Sage issue/bug is that when I notice the error occurring with live TV, BOTH HDPVR2s will result in this error. Physically rebooting the HDPVRs does not fix the issue. Only restarting Sage will fix the issue. Also, when I know the issue is occurring, I am able to use the Hauppauge capture software with the HDPVRs.

In short, only Sage has occasional problems starting the HDPVRs, always both HDPVRs at the same time have issues, and only restarting Sage fixes the issue.

What's more annoying is that when Sage has this problem when recording a favorite, it simply records a blank file instead of trying to restart or canceling the recording and trying later. So, I need to delete these "blank" files that otherwise look like they recorded properly.

Does anyone have any idea what could be causing this or how I could troubleshoot to find any more info on it?

KryptoNyte 10-18-2021 05:27 PM

What are your video sources? I have noticed that the HDPVR2's really stumble when the source changes, or goes to sleep even. I have not seen this problem with Sage 64bit on Win 7 64 bit (2500k CPU, 16gb memory).

I'm also using (2) HDPVR2's, can I get you a log file of mine to use for comparison? I'm not great perusing the log files.

Evil_Attorney 10-19-2021 10:19 AM

I am using two Directv receivers set to native resolution, so there is switching there, but I haven not been able to correlate that to the problem and even tried a 12 second wait to tune time. That also wouldn't account for both HDPVRs being always out of commission at the same time.

But your resolution comment got me thinking so compared my current log files to my log files from a few years ago with my original HDPVR 1212s. With all tuners, appears that Sage initially tries to record at 720x480, 30fps. In my older logs, there would be an entry after that that says the signal was detected and that the input resolution was either 720 or 1080, like the below entries. None of my current recordings, good or bad, have that entry with the HDPVR2. I'm not sure if that means anything or Sage no longer explicitly creates those entries.

In any case, the fact that both HDPVRs always have problems at the same time and only restarting Sage fixes them still makes me think there is a bug in Sage somewhere causing this. I guess my next approach is to migrate over to the 64bit version with a fresh install and see if that fixes everything.


Code:

Sun 6/4 1:00:06.523 [MainMsg@629cbc] Signal detected!
Sun 6/4 1:00:06.550 [MainMsg@629cbc] Detected capture input resolution lines=720


Evil_Attorney 10-20-2021 09:42 AM

KryptoNyte, thanks for PM'ing me your log file. Your entries look completely different than mine. For example, I have much more info on the different encoding processes. Does Sage have a verbose logging mode that I somehow forgot about? If not, perhaps I just need to do a clean install with the 64 bit version.

Code:

Wed 9/29 6:39:51.231 [PooledThread@12ca9f] Playing IR tune command of 4
Wed 9/29 6:40:00.943 [MainMsg@26c17e] setEncodingProperties0 1177554952 HDPVRCustomMax
Wed 9/29 6:40:00.944 [MainMsg@26c17e] Set encoding property audiooutputmode to 0
Wed 9/29 6:40:00.944 [MainMsg@26c17e] Set encoding property audiocrc to 0
Wed 9/29 6:40:00.944 [MainMsg@26c17e] Set encoding property gopsize to 15
Wed 9/29 6:40:00.944 [MainMsg@26c17e] Set encoding property videobitrate to 8000000
Wed 9/29 6:40:00.944 [MainMsg@26c17e] Set encoding property peakvideobitrate to 13000000
Wed 9/29 6:40:00.944 [MainMsg@26c17e] Set encoding property inversetelecine to 0
Wed 9/29 6:40:00.944 [MainMsg@26c17e] Set encoding property closedgop to 0
Wed 9/29 6:40:00.945 [MainMsg@26c17e] Set encoding property vbr to 1
Wed 9/29 6:40:00.945 [MainMsg@26c17e] Set encoding property outputstreamtype to 1
Wed 9/29 6:40:00.945 [MainMsg@26c17e] Set encoding property width to 720
Wed 9/29 6:40:00.945 [MainMsg@26c17e] Set encoding property height to 480
Wed 9/29 6:40:00.945 [MainMsg@26c17e] Set encoding property audiobitrate to 384
Wed 9/29 6:40:00.945 [MainMsg@26c17e] Set encoding property audiosampling to 48000
Wed 9/29 6:40:00.945 [MainMsg@26c17e] Set encoding property disablefilter to 1
Wed 9/29 6:40:00.945 [MainMsg@26c17e] Set encoding property medianfilter to 3
Wed 9/29 6:40:00.946 [MainMsg@26c17e] Set encoding property fps to 30
Wed 9/29 6:40:00.946 [MainMsg@26c17e] Set encoding property ipb to 0
Wed 9/29 6:40:00.946 [MainMsg@26c17e] Set encoding property deinterlace to 0
Wed 9/29 6:40:00.946 [MainMsg@26c17e] Set encoding property aspectratio to 1
Wed 9/29 6:40:00.946 [MainMsg@26c17e] setupEncoding0 called for 1177554952 'Hauppauge Siena Video Capture-0' (ver 1.0)
Wed 9/29 6:40:00.946 [MainMsg@26c17e] setupEncoding0 Trace1
Wed 9/29 6:40:00.949 [MainMsg@26c17e] setupEncoding0 Trace2
Wed 9/29 6:40:00.949 [MainMsg@26c17e] setupEncoding0 Trace3
Wed 9/29 6:40:00.972 [MainMsg@26c17e] setupEncoding0 Trace4
Wed 9/29 6:40:00.973 [MainMsg@26c17e] setupEncoding0 Trace6
Wed 9/29 6:40:00.973 [MainMsg@26c17e] setupEncoding0 Trace6-1
Wed 9/29 6:40:00.973 [MainMsg@26c17e] setupEncoding0 Trace7
Wed 9/29 6:40:00.973 [MainMsg@26c17e] setupEncoding0 Trace7-3
Wed 9/29 6:40:00.973 [MainMsg@26c17e] setupEncoding0 Trace8
Wed 9/29 6:40:00.973 [MainMsg@26c17e] Exception from line: 866
Wed 9/29 6:40:00.973 [MainMsg@26c17e] Built:sage.EncodingException: ERROR (-6,0x80004005): There was a problem setting up hardware video compression. Please be sure you have the latest drivers installed for your capture device, and that they are installed correctly.
Wed 9/29 6:40:00.974 [DistributeHookNetClients@e96050] Sending hook to client for MediaPlayerError args=[Capture, ERROR (-6,0x80004005): There was a problem setting up hardware video compression. Please be sure you have the latest drivers installed for your capture device, and that they are installed correctly.]
Wed 9/29 6:40:00.974 [DistributeHookNetClients@12ca9f] Sending hook to client for SystemStatusChanged args=[]


KryptoNyte 10-21-2021 04:50 PM

If anyone knows of a way to increase the logging detail in Sage, please let me know and I'll crank it up for a more detailed log file.

If you currently have the 32 bit version of SageTV installed, it's quite safe to install the 64 bit version as a test and you can switch back and forth as you wish. The 64bit install is to a completely different folder. I just made sure that the 32 bit and 64 bit version services were not running at the same time.

wnjj 10-21-2021 06:01 PM

Quote:

Originally Posted by KryptoNyte (Post 631417)
If anyone knows of a way to increase the logging detail in Sage, please let me know and I'll crank it up for a more detailed log file.

If you currently have the 32 bit version of SageTV installed, it's quite safe to install the 64 bit version as a test and you can switch back and forth as you wish. The 64bit install is to a completely different folder. I just made sure that the 32 bit and 64 bit version services were not running at the same time.

Try creating a file in your main SageTV directory called "NATIVE_LOG.ENABLE". It can be empty as long as the file exists.

KryptoNyte 10-21-2021 06:05 PM

Got it. Thank you.

Evil_Attorney 10-22-2021 09:03 AM

I plan to install the 64bit version this weekend and will test.

I hadn't had the native log option turned on but have now done so. The logs are much larger, but I am not sure it is giving me much more info on my issue.

One thing I noticed was an exception in the log. Is there a way to determine which line "866" is?

Code:

Thu 10/21 18:39:38.640 [MainMsg@18537d5] Exception from line: 866

wnjj 10-22-2021 09:28 AM

Quote:

Originally Posted by Evil_Attorney (Post 631426)
I plan to install the 64bit version this weekend and will test.

I hadn't had the native log option turned on but have now done so. The logs are much larger, but I am not sure it is giving me much more info on my issue.

One thing I noticed was an exception in the log. Is there a way to determine which line "866" is?

Code:

Thu 10/21 18:39:38.640 [MainMsg@18537d5] Exception from line: 866

It’s in the native encoder code: https://github.com/google/sagetv/blo...coder.cpp#L866

You can tell by all of the “setupEncoding0 Trace” comments and searching on GitHub.

Also I don’t remember but native logging may output to a different file. Check your SageTV directory.

Evil_Attorney 10-22-2021 10:13 AM

Thank you wnjj. Based on the line error, it looks like Sage isn't finding the right encoding pin for some reason.

Evil_Attorney 10-24-2021 12:13 PM

After some difficulties setting up the 64bit version, I was able to reproduce the same failure to start encoding issues as the 32bit. This time in my testing, I noticed that only one tuner locked up and only on 720p channels. The same "locked up" tuner was able to record 1080i channels. In other words, only recording in 720p "locked" but 1080i, at least at that moment, did not. I don't remember that being the case previously, but maybe there is a bit more variability to this issue.

I have had failures on 1080i recordings in the past and thought I did enough testing to show that it wasn't the resolution switching that was causing issues. However, I have once again switched to 1080i only on both receivers and will see how that goes. My old H21 receivers do a very bad job transcoding/upscaling 720p channels to 1080i, so if this ends up being the only fix, I may just move back to the older HDPVR 1212 models.

KryptoNyte 10-24-2021 01:11 PM

Quote:

Originally Posted by wnjj (Post 631419)
Try creating a file in your main SageTV directory called "NATIVE_LOG.ENABLE". It can be empty as long as the file exists.

I did this. What logfile(s) exactly can I grab from my Sage server that will be most helpful to the OP? My HDPVR2's have been a little flaky once in a great while, but they've been far more reliable than other DVR software out there, so if you can tell me how to help the OP, I'll do it.

I'm just grasping at straws here, but do you have the HDPVR2's connected via USB 2.0 ports on your server's motherboard? Have you tried different USB ports on the server?

wnjj 10-24-2021 02:13 PM

Quote:

Originally Posted by KryptoNyte (Post 631457)
I did this. What logfile(s) exactly can I grab from my Sage server that will be most helpful to the OP? My HDPVR2's have been a little flaky once in a great while, but they've been far more reliable than other DVR software out there, so if you can tell me how to help the OP, I'll do it.

I'm just grasping at straws here, but do you have the HDPVR2's connected via USB 2.0 ports on your server's motherboard? Have you tried different USB ports on the server?

That should create a new log file called ďNative.logĒ. It may grow large with time so I wouldnít leave that setting turned on. Iíve read that you need to restart SageTV after creating that enable file.

Evil_Attorney 10-24-2021 03:07 PM

Quote:

Originally Posted by KryptoNyte (Post 631457)
I did this. What logfile(s) exactly can I grab from my Sage server that will be most helpful to the OP? My HDPVR2's have been a little flaky once in a great while, but they've been far more reliable than other DVR software out there, so if you can tell me how to help the OP, I'll do it.

I'm just grasping at straws here, but do you have the HDPVR2's connected via USB 2.0 ports on your server's motherboard? Have you tried different USB ports on the server?

From what I am seeing in the logs, Sage is getting ďpinsĒ wrong sometimes. I donít exactly know what that means, but either Sage isnít connecting to the HDPRV2 sometimes, or the driver blocks out connections to the device in some situations. Letís see how the resolution lock works. That might help narrow things down.

Evil_Attorney 10-25-2021 10:20 AM

Locking the resolution of the DirecTV tuners to 1080i didn't help. Locked up when I tried this morning at 1080i. Setting back to native resolution. Either Sage is sometimes getting the "pins" wrong or the driver is sometimes acting weird for some reason.

Another wild guess, but, KryptoNyte, when did you buy your HDPVR2's? The original HDPVR 1212's had several versions. Perhaps that is the case here. Looks like I ordered mine at the start of 2013.

wnjj 10-25-2021 01:35 PM

Quote:

Originally Posted by Evil_Attorney (Post 631466)
Locking the resolution of the DirecTV tuners to 1080i didn't help. Locked up when I tried this morning at 1080i. Setting back to native resolution. Either Sage is sometimes getting the "pins" wrong or the driver is sometimes acting weird for some reason.

Another wild guess, but, KryptoNyte, when did you buy your HDPVR2's? The original HDPVR 1212's had several versions. Perhaps that is the case here. Looks like I ordered mine at the start of 2013.

Pins are basically ports in or out of the various components (DirectShow filters) in an A/V stream process. What SageTV does is ask the capture device driver for an output pin that is one of the MPEG types. If it doesnít find one, the upstream filter isnít configured properly or at least not yet. Perhaps there is some kind of reset or prep that SageTV could do but isnít? Maybe restarting SageTV causes that to happen when the filter is reloaded fresh?

KryptoNyte 10-25-2021 06:18 PM

Yeah, there are quite a few different revisions of the HDPVR2. I believe I have one of the 1512 models, which was originally sold as the "HD video recorder" model. I also have one of the later Gaming models the GE PLUS (gaming edition plus) I believe because it was the only "GAMING" model that had optical audio (SPDIF) input in that series because I wanted 5.1 channel digital audio, and the SPDIF was the only reliable way to get it. I was never able to reliably get 5.1 channel audio via HDMI alone. I always made sure to purchase the Xbox360 slim 4gb model with the optical output.

I'll go see if I can find that logfile ...

KryptoNyte 10-25-2021 06:30 PM

Given the flaky power supplies on the HDPVR's, have you replaced at least one of the power supplies on your HDPVR2's? What about pulling one of them to test on a second PC, to see if you can replicate the problem?

KryptoNyte 10-25-2021 06:37 PM

Logs sent, see PM's.

Evil_Attorney 10-26-2021 09:49 AM

Thanks for the log file. I will look it over and compare with mine to see if I notice anything. I just ordered a new power supply for one of the HDPVR2s, so I can potentially eliminate that as an issue. Swapping over to another PC will be challenging since I don't have an extra available. Might be easier to do a complete reinstall of Windows.

I also uninstalled the Hauppauge capture program and device central program to see if that changes anything.


All times are GMT -6. The time now is 07:53 AM.

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