Notes |
(0000744)
schmirl
11-12-08 13:12
|
Problem could be that PMT must be broadcasted before actual stream data.
patpmt_first.diff is a crude hack to accomplish this. First packet will be the PAT. The patch doesn't guarantee that the PMT will be the second packet. The first PMT could even get filtered. A clean solution would send the PMT from within cStreamdevPatFilter::Process(). This however requires repacking and I don't want to do this without the ability to test if the packet is ok afterwards (I can't test ATM). Maybe someone can contribute a patch here.
If the PMT is filtered, try modifying
bool Syncing() const { return seen != (SI_PMT | SI_PAT); }
into
bool Syncing() const { return (seen & SI_PAT) == 0; }
So we only wait for the PAT to occur, PMT will not be the first packet, but it should show up earlier as without patch. |
| |
(0000747)
schmirl
11-12-08 15:34
edited on: 11-12-08 15:35
|
Refined patch patpmt_first_v2.diff guarantees that first packet is PAT, second is PMT. Untested!
|
| |
(0000748)
schmirl
11-13-08 09:51
|
Previous patches didn't work. Patpmt_first_v3.diff hopefully fixes the problem (Untested!) |
| |
(0000750)
schmirl
11-14-08 14:02
|
patpmt_first_v4 fixes PMT generator
Minor fixes for PAT generator (reserved bits must be '1') |
| |
(0000751)
schmirl
11-18-08 08:43
|
Success with the following modifications on top of v4 patch:
*** Retransmit PAT (will give an other continuity error)
Two modifications in livestreamer.c: Around line 214, change
if (Tid == 0x00 && !pmtPid) {
into
if (Tid == 0x00) {
int pmtPidBak = pmtPid;
And around line 275 change
m_Streamer->SetPids(pmtPid);
Add(pmtPid, 0x02);
pmtVersion = -1;
into
if (pmtPid != pmtPidBak) {
m_Streamer->SetPids(pmtPid);
Add(pmtPid, 0x02);
pmtVersion = -1;
} |
| |
(0000752)
rofafor
11-18-08 11:24
|
The pat repacker should utilize correct version number instead of zero:
--- livestreamer.c.orig 2008-11-18 12:23:51.000000000 +0200
+++ livestreamer.c 2008-11-18 12:26:24.000000000 +0200
@@ -250,7 +250,7 @@
tspat_buf[7] = 12 + 1; // Section length (12 bit): PAT_TABLE_LEN + 1
tspat_buf[8] = (ts_id >> 8); // Transport stream ID (bits 8-15)
tspat_buf[9] = (ts_id & 0xff); // Transport stream ID (bits 0-7)
- tspat_buf[10] = 0xc1; // Version number 0, Current next indicator bit set
+ tspat_buf[10] = ((pat.getVersionNumber() << 1) & 0x3e) | 0xc1; // Version number, Current next indicator bit set
tspat_buf[11] = 0x0; // Section number
tspat_buf[12] = 0x0; // Last section number
tspat_buf[13] = (pmtSid >> 8); // Program number (bits 8-15) |
| |
(0000753)
schmirl
11-18-08 11:39
|
Perfect - thanks. We should probably copy the current next indicator as well:
- tspat_buf[10] = 0xc1; // Version number 0, Current next indicator bit set
+ tspat_buf[10] = ((pat.getVersionNumber() << 1) & 0x3e) | pat.getCurrentNextIndicator() | 0xc0; // Version number, Current next indicator |
| |
(0000754)
rofafor
11-18-08 14:26
|
Ack for current next indicator modification, but I would move the "seen |= SI_PMT;" statement into inside of "if" block. |
| |
(0000755)
schmirl
11-18-08 14:34
|
That whole "seen" stuff was just a dirty hack to find out if PCH requires PAT/PMT at the very beginning of the stream. Odds are that this isn't necessary at all. Jori will test this tonight. |
| |
(0000756)
schmirl
11-21-08 09:19
|
Added patch v5 which contains the minimum changes I expect to be necessary (no feedback from Jori yet). With this patch the stream will no longer start with PAT and PMT. Basically all it does is send out a repacked PAT everytime one is received (plus some minor PAT fixups).
Added TS continuity counter to TS PAT packets:
+ static uint8_t ccounter = 0;
+ ccounter = (ccounter + 1) % 16;
...
+ tspat_buf[3] = 0x10 | ccounter; // Set payload flag, Continuity counter |
| |
(0000758)
schmirl
11-24-08 13:12
|
Commited |
| |