MediaPortal Version: 1.2.2
MediaPortal Skin: StreamedMP
Windows Version: Windows 7 Ultimate 32-bit SP1
CPU Type: Intel Core i5 2500K
HDD: 2x WD WD3200YS, 320 GB
Memory: 2x 2048 MB
Motherboard: Gigabyte GA-H61M-USB3-B3
Video Card: Intel HD Graphics 3000
Video Card Driver: 8.15.10.2559
Sound Card: Realtek, HDA
Sound Card AC3:
Sound Card Driver: 6.1.7600.16385, Microsoft
1. TV Card:
1. TV Card Type: DVB-IP
1. TV Card Driver:
2. TV Card:
2. TV Card Type:
2. TV Card Driver:
3. TV Card:
3. TV Card Type:
3. TV Card Driver:
4. TV Card:
4. TV Card Type:
4. TV Card Driver:
MPEG2 Video Codec: LAV Video Decoder
MPEG2 Audio Codec: ffdshow Audio Decoder
h.264 Video Codec: ffdshow DXVA Video Decoder
Satelite/CableTV Provider:
HTPC Case:
Cooling:
Power Supply:
Remote:
TV:
TV - HTPC Connection:
Hi,
I found serious bug in TV server which cause MP and TV server freeze, so both must be killed in Task Manager. This bug happend during channel change (or similar action like starting playing, starting recording, etc.). The logs are attached, problem happend at 2012-01-22 12:13:03.
I investigate the problem and probably found its cause. The problem is classic deadlock between channel (TvDvbChannel.cs) and TsWriter. Look at the end of tv server log file:
The important line is this with 'CA found after 0 seconds'. It means that tv server code is in 'SendPmtToCam' method. Because in relevant part of log file is no line similar to 'subch:0 SendPmt:1 1 FFFFFFFF A', it means that tv server code is before line (in another case we would find another message in log)
I think that only line which can cause freeze between messages mentioned above is
If you look on shown part of log you can see that OnPMTReceived() is called twice. From TsWriter log we found
that new PMT arrived, so TsWriter called callback and TsWriter is in critical section while calling callback. Because PmtGetPMTData() calls CPmtGrabber::GetPMTData() method, which tries to enter to critical section, we got classic deadlock. In attachements is sample TS file which demonstrate problem.
I prepared patch, but I'm not sure if I solved problem correctly (at least for me worked). The main idea of patch is to remove signaling of requested PMT from OnPMTReceived() callback to WaitForPMT() method (in this case the meaning of _pmtRequested variable is that WaitForPMT() method finished processing PMT). Possible problem with this patch is that any update of PMT will be stored into database, but tv server code may ignore update of PMT.
P.S. While investigating problem I also found that _eventCA event is never reset (that's why CA is found after 0 seconds).
MediaPortal Skin: StreamedMP
Windows Version: Windows 7 Ultimate 32-bit SP1
CPU Type: Intel Core i5 2500K
HDD: 2x WD WD3200YS, 320 GB
Memory: 2x 2048 MB
Motherboard: Gigabyte GA-H61M-USB3-B3
Video Card: Intel HD Graphics 3000
Video Card Driver: 8.15.10.2559
Sound Card: Realtek, HDA
Sound Card AC3:
Sound Card Driver: 6.1.7600.16385, Microsoft
1. TV Card:
1. TV Card Type: DVB-IP
1. TV Card Driver:
2. TV Card:
2. TV Card Type:
2. TV Card Driver:
3. TV Card:
3. TV Card Type:
3. TV Card Driver:
4. TV Card:
4. TV Card Type:
4. TV Card Driver:
MPEG2 Video Codec: LAV Video Decoder
MPEG2 Audio Codec: ffdshow Audio Decoder
h.264 Video Codec: ffdshow DXVA Video Decoder
Satelite/CableTV Provider:
HTPC Case:
Cooling:
Power Supply:
Remote:
TV:
TV - HTPC Connection:
Hi,
I found serious bug in TV server which cause MP and TV server freeze, so both must be killed in Task Manager. This bug happend during channel change (or similar action like starting playing, starting recording, etc.). The logs are attached, problem happend at 2012-01-22 12:13:03.
I investigate the problem and probably found its cause. The problem is classic deadlock between channel (TvDvbChannel.cs) and TsWriter. Look at the end of tv server log file:
Code:
2012-01-22 12:13:03.321396 [(21)]: WaitForPMT: Waiting for PMT 20
2012-01-22 12:13:03.521407 [(9)]: subch:0 OnPMTReceived() pmt:20 ran:True dynamic:False
2012-01-22 12:13:03.523408 [(21)]: WaitForPMT: Found PMT after 0,2050117 seconds.
2012-01-22 12:13:03.525408 [(21)]: subch:0 SendPmt:CA found after 0 seconds
2012-01-22 12:13:03.528408 [(9)]: subch:OnCaReceived()
2012-01-22 12:13:03.542409 [(9)]: subch:0 OnPMTReceived() pmt:20 ran:True dynamic:True
Code:
Log.Log.Info("subch:{0} SendPmt:{1:X} {2:X} {3:X} {4:X}", _subChannelId, pmtProgramNumber, channel.ServiceId, _pmtVersion, version);
Code:
_pmtLength = _tsFilterInterface.PmtGetPMTData(_subChannelIndex, pmtMem);
If you look on shown part of log you can see that OnPMTReceived() is called twice. From TsWriter log we found
Code:
22-01-2012 12:13:03.539 pmtgrabber: got new pmt version:6 a, service_id:1
22-01-2012 12:13:03.540 pmtgrabber: do callback pid 20
I prepared patch, but I'm not sure if I solved problem correctly (at least for me worked). The main idea of patch is to remove signaling of requested PMT from OnPMTReceived() callback to WaitForPMT() method (in this case the meaning of _pmtRequested variable is that WaitForPMT() method finished processing PMT). Possible problem with this patch is that any update of PMT will be stored into database, but tv server code may ignore update of PMT.
P.S. While investigating problem I also found that _eventCA event is never reset (that's why CA is found after 0 seconds).