SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Github Development

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 03-07-2017, 12:05 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,056
Quote:
Originally Posted by panteragstk View Post
Yup. Restarted sage. It still gives an error, but the recording doesn't die like it did. It will eventually continue.

I'll restart the encoding server and re-test and attach the logs.
Hmm. Maybe there's another bug behind the one just fixed. If turning fast switch off works you at least have a solution but if you're willing to keep debugging, so am I. The larger SageTV community thanks you.
Reply With Quote
  #42  
Old 03-07-2017, 12:18 PM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,311
Quote:
Originally Posted by wnjj View Post
Hmm. Maybe there's another bug behind the one just fixed. If turning fast switch off works you at least have a solution but if you're willing to keep debugging, so am I. The larger SageTV community thanks you.
Never stopped me before. Since I've used SageTV I've come across many a strange bug so this isn't new. It's just been a very long time since I've had any issues and I've gotten used to it just working without any interaction from me.
__________________
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
  #43  
Old 03-07-2017, 02:17 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,301
KarlyFStein,

Are you sure you downloaded the latest code from GitHub before you built the AX file?

And if you did...can you build the Debug version of it and post that one instead? Then he can register that one, go to HKLM\Software\Microsoft\DirectShow\Debug\MPEG2Dump.ax (or something like that for the last part) and set the LogToFile value to be a log file. There may be other values to set there....I don't remember...it's been a long time...but then the filter can do its own logging and we will be able to find more specific details.

And of course I'd like to see the log files from using the newly built filter...because maybe there is also another problem and the issue with the DirectShow filter isn't a problem anymore.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #44  
Old 03-07-2017, 02:36 PM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Quote:
Originally Posted by Narflex View Post
KarlyFStein,

Are you sure you downloaded the latest code from GitHub before you built the AX file?

And if you did...can you build the Debug version of it and post that one instead? Then he can register that one, go to HKLM\Software\Microsoft\DirectShow\Debug\MPEG2Dump.ax (or something like that for the last part) and set the LogToFile value to be a log file. There may be other values to set there....I don't remember...it's been a long time...but then the filter can do its own logging and we will be able to find more specific details.

And of course I'd like to see the log files from using the newly built filter...because maybe there is also another problem and the issue with the DirectShow filter isn't a problem anymore.
Yes, I did a sync and checked the source file before building:

Code:
//
// CloseFile
// Closes any dump file we have opened
//
HRESULT CMPEG2Dump::CloseFile( BOOL bAsync )
{
	CAutoLock lock(&m_fileLock);
	if (m_bRemoteFile)
	{
		CloseConnection();
	    m_hFile = INVALID_HANDLE_VALUE;
		return NOERROR;
	}
    if (m_hFile == INVALID_HANDLE_VALUE) {
        return NOERROR;
    }

	if ( !bAsync )
		CloseHandle(m_hFile);
	else
		AsyncCloseFile( );

    m_hFile = INVALID_HANDLE_VALUE;
    return NOERROR;

} // Open
The debug version is attached.
Attached Files
File Type: zip MPEG2Dump_Debug.zip (518.0 KB, 19 views)
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #45  
Old 03-07-2017, 04:10 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,056
Quote:
Originally Posted by Narflex View Post
KarlyFStein,

Are you sure you downloaded the latest code from GitHub before you built the AX file?

And if you did...can you build the Debug version of it and post that one instead? Then he can register that one, go to HKLM\Software\Microsoft\DirectShow\Debug\MPEG2Dump.ax (or something like that for the last part) and set the LogToFile value to be a log file. There may be other values to set there....I don't remember...it's been a long time...but then the filter can do its own logging and we will be able to find more specific details.

And of course I'd like to see the log files from using the newly built filter...because maybe there is also another problem and the issue with the DirectShow filter isn't a problem anymore.

It looks like maybe you can enable logging on the release version by creating a file called "MPEG2Dump_LOG.ENABLE" or does the registry key you mentioned still need to be there?


Code:
static void _flog_check()
{
	FILE* fp = fopen( "MPEG2Dump_LOG.ENABLE", "r" );
	if ( fp != NULL )
	{
		flog_enabled = true;
		fclose( fp );
	}
}
Reply With Quote
  #46  
Old 03-07-2017, 04:32 PM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,311
Quote:
Originally Posted by KarylFStein View Post
Yes, I did a sync and checked the source file before building:

Code:
//
// CloseFile
// Closes any dump file we have opened
//
HRESULT CMPEG2Dump::CloseFile( BOOL bAsync )
{
	CAutoLock lock(&m_fileLock);
	if (m_bRemoteFile)
	{
		CloseConnection();
	    m_hFile = INVALID_HANDLE_VALUE;
		return NOERROR;
	}
    if (m_hFile == INVALID_HANDLE_VALUE) {
        return NOERROR;
    }

	if ( !bAsync )
		CloseHandle(m_hFile);
	else
		AsyncCloseFile( );

    m_hFile = INVALID_HANDLE_VALUE;
    return NOERROR;

} // Open
The debug version is attached.
Would not let me register the debug version. Got an error. The previously attached version will register without issue.
__________________
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
  #47  
Old 03-07-2017, 05:09 PM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,311
See logs. Same issue.
__________________
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
  #48  
Old 03-08-2017, 11:53 AM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,301
The MPEG2Dump_LOG.ENABLE file only enables a certain type of logging...but that may actually be useful, so it's worth a shot. There's more extensive logging that's done with the DirectShow debug facility.

And there definitely is a change in the behavior now. When it switches to the new file...it is reporting an updated, smaller file size. However, that small size doesn't grow at all for whatever reason. I'll take another look at the code again and see what I find (I didn't dig beyond that first issue before because it was so clearly causing a major problem)...but if you can get that other log file as well that could likely help out even more.
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #49  
Old 03-08-2017, 12:38 PM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,311
Quote:
Originally Posted by Narflex View Post
The MPEG2Dump_LOG.ENABLE file only enables a certain type of logging...but that may actually be useful, so it's worth a shot. There's more extensive logging that's done with the DirectShow debug facility.

And there definitely is a change in the behavior now. When it switches to the new file...it is reporting an updated, smaller file size. However, that small size doesn't grow at all for whatever reason. I'll take another look at the code again and see what I find (I didn't dig beyond that first issue before because it was so clearly causing a major problem)...but if you can get that other log file as well that could likely help out even more.
I'll do that no problem, but the debug version wouldn't register so I guess something went wrong with it.
__________________
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
  #50  
Old 03-08-2017, 12:59 PM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Quote:
Originally Posted by panteragstk View Post
I'll do that no problem, but the debug version wouldn't register so I guess something went wrong with it.
I'm afraid that I'm no VS expert. In fact I've only used it a couple times for SageTV . What I did is select Debug instead of Release in the pull down and rebuilt the MPEG file, (which spit out two files: the .ax and a .pdb). If there's something else that I should have done let me know.
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #51  
Old 03-08-2017, 01:31 PM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,311
Quote:
Originally Posted by KarylFStein View Post
I'm afraid that I'm no VS expert. In fact I've only used it a couple times for SageTV . What I did is select Debug instead of Release in the pull down and rebuilt the MPEG file, (which spit out two files: the .ax and a .pdb). If there's something else that I should have done let me know.
Me neither. No clue what it is supposed to spit out.
__________________
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
  #52  
Old 03-08-2017, 03:17 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,056
Quote:
Originally Posted by KarylFStein View Post
I'm afraid that I'm no VS expert. In fact I've only used it a couple times for SageTV . What I did is select Debug instead of Release in the pull down and rebuilt the MPEG file, (which spit out two files: the .ax and a .pdb). If there's something else that I should have done let me know.
Normally that's all you need to do but I do see in the project file that the Debug and Release versions have different options set. You can find those in Project|Properties, then under Configuration Properties. For each section like C/C++ and Linker you can find an All Options section.

Likely one or more those those settings was changed in the Release version but not in Debug.

Then again, there may be a missing dependency like runtime Debug libraries that aren't included in the installer.
Reply With Quote
  #53  
Old 03-08-2017, 03:34 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,056
Quote:
Originally Posted by Narflex View Post
The MPEG2Dump_LOG.ENABLE file only enables a certain type of logging...but that may actually be useful, so it's worth a shot. There's more extensive logging that's done with the DirectShow debug facility.

And there definitely is a change in the behavior now. When it switches to the new file...it is reporting an updated, smaller file size. However, that small size doesn't grow at all for whatever reason. I'll take another look at the code again and see what I find (I didn't dig beyond that first issue before because it was so clearly causing a major problem)...but if you can get that other log file as well that could likely help out even more.
I noticed the change in behavior too. It's starting to make a little more sense. When the last GET_FILE_SIZE call for the previous show comes in after the SWITCH, it returns 0 because it's no longer in the captureMap. Therefore it falls into the java.io.File.Length() 'else' statement in EncodingServer.java which returns 0 because the filename includes "stv://" and therefore not valid locally.

Then the next GET_FILE_SIZE with the new file returns the size of the old file because the switchover hasn't yet happened inside the 5 second m_switchNotify wait for the transition point in MPEG2Dump.cpp.

Then, about 1 second later GET_FILE_SIZE for the new file returns a much smaller, non-zero number which I suspect is the size of the write after the transition that outputs the remaining buffer contents in MPEG2Dump.cpp:

Code:
return m_pDump->Write( pbData + tranny, currLen - tranny );

The fact that the old file size is no longer returned means the OpenFile function is now completing (which it didn't with the remotefile=false bug) and setting m_shareInfo.totalWrite back to 0. The only places that subsequently increment that file size variable are in the Write() and Seek() methods, one of which I believe is being called above right after the switchover OpenFile.

After the switch, subsequent writes come through the Receive() function eventually ending up at the bottom at this statement:

Code:
return m_pDump->Write( pbData, currLen );
It's obviously not getting there or the file size should be growing.

Is it somehow stuck repeatedly calling Seek() at setting the point/filesize to the same place? Actually, It doesn't look like Seek() is ever used in this mode.

Last edited by wnjj; 03-08-2017 at 03:54 PM.
Reply With Quote
  #54  
Old 03-08-2017, 05:01 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,056
Hey KarylFStein,

If you want to compile another option, I've attached a modified MPEG2Dump.cpp where I turned all of the dbglog (resistry-based logging) calls into the local ones and forced it on. This way everything will log into a local "MPEG2Dump.LOG" file.

You can compile it in Release mode and it should just drop in again. Note: I have not compiled it so hopefully didn't introduce any syntax errors.


Panteragstk,

This should not be used log term since it may produce a ton of data and there's no limit on the log file. Just run it long enough to capture another one of these failures. It should operate just like Jeff's fixed one, but with logging. Back up the previous one first.
Attached Files
File Type: zip MPEG2Dump.zip (12.9 KB, 17 views)
Reply With Quote
  #55  
Old 03-08-2017, 05:33 PM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,311
Quote:
Originally Posted by wnjj View Post
Hey KarylFStein,

If you want to compile another option, I've attached a modified MPEG2Dump.cpp where I turned all of the dbglog (resistry-based logging) calls into the local ones and forced it on. This way everything will log into a local "MPEG2Dump.LOG" file.

You can compile it in Release mode and it should just drop in again. Note: I have not compiled it so hopefully didn't introduce any syntax errors.


Panteragstk,

This should not be used log term since it may produce a ton of data and there's no limit on the log file. Just run it long enough to capture another one of these failures. It should operate just like Jeff's fixed one, but with logging. Back up the previous one first.
I will do that once it is compiled.
__________________
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
  #56  
Old 03-08-2017, 07:16 PM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Quote:
Originally Posted by wnjj View Post
Hey KarylFStein,

If you want to compile another option, I've attached a modified MPEG2Dump.cpp where I turned all of the dbglog (resistry-based logging) calls into the local ones and forced it on. This way everything will log into a local "MPEG2Dump.LOG" file.

You can compile it in Release mode and it should just drop in again. Note: I have not compiled it so hopefully didn't introduce any syntax errors.
Well, it sounds like you know what you're doing, have the environment and should be doing the compiles , but here you go.
Attached Files
File Type: zip MPEG2Dump.zip (55.3 KB, 14 views)
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #57  
Old 03-08-2017, 09:21 PM
wnjj wnjj is online now
Sage Icon
 
Join Date: Jan 2009
Posts: 1,056
Quote:
Originally Posted by KarylFStein View Post
Well, it sounds like you know what you're doing, have the environment and should be doing the compiles , but here you go.

I have a compiler but haven't compiled the project before. Plus I'm in an airport right now.

Thanks for the help.
Reply With Quote
  #58  
Old 03-09-2017, 11:34 AM
panteragstk's Avatar
panteragstk panteragstk is offline
SageTVaholic
 
Join Date: Oct 2008
Location: New Braunfels, TX
Posts: 3,311
Got the mpeg dump log. Let me know if anything else is needed.
__________________
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
  #59  
Old 03-09-2017, 01:10 PM
Narflex's Avatar
Narflex Narflex is offline
Sage
 
Join Date: Feb 2003
Location: Redondo Beach, CA
Posts: 6,301
OK, I think I found the next problem. Hopefully this should do it. Before I go committing this...can you build this one Karly and then post the new .ax file for panteragtsk to try?

Thanks for adding that extra logging...it gave me the info I needed to figure out the problem.

The new issue was that it was using the wrong filename for the remote upload. It was setting the nextFilename BEFORE it was stripping out the stv:// stuff from the URL when it was doing a switch so it was sending an stv:// URL to the MediaServer to open rather than a normal file path.
Attached Files
File Type: zip MPEG2Dump.zip (13.4 KB, 23 views)
__________________
Jeffrey Kardatzke
Google
Founder of SageTV
Reply With Quote
  #60  
Old 03-09-2017, 01:35 PM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Quote:
Originally Posted by Narflex View Post
OK, I think I found the next problem. Hopefully this should do it. Before I go committing this...can you build this one Karly and then post the new .ax file for panteragtsk to try?

Thanks for adding that extra logging...it gave me the info I needed to figure out the problem.

The new issue was that it was using the wrong filename for the remote upload. It was setting the nextFilename BEFORE it was stripping out the stv:// stuff from the URL when it was doing a switch so it was sending an stv:// URL to the MediaServer to open rather than a normal file path.
Sure, attached.

One small change on line 846:
Code:
- if (m_pFilename) {
+ if (m_pFileName) {
Attached Files
File Type: zip MPEG2Dump.zip (43.8 KB, 26 views)
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
SageTV as a network encoder / recording on network encoder works, not from server perfessor101 SageTV Software 0 06-21-2014 05:59 AM
Network Encoder Problem nox71 SageTV Beta Test Software 0 06-22-2010 07:23 PM
Weird Network Encoder Problem interloper SageTV Beta Test Software 0 04-09-2009 06:50 AM
HD-PVR as network encoder problem phelme Hardware Support 9 07-28-2008 12:38 AM
Problem setting up network encoder Alfiegerner SageTV Software 1 12-29-2006 11:30 PM


All times are GMT -6. The time now is 01:47 AM.


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