Here is my latest patch with changes from here:
http://www.streamboard.tv/oscam/ticket/4436
http://www.streamboard.tv/oscam/ticket/4437
Not sure that it will not break something else, so please test with other encryptions also... :)
Here is a basic diff of the patches (11209 -> 11212)
Code
< --- module-dvbapi.c (revision 11209)
---
> --- module-dvbapi.c (revision 11212)
3050c3050
< @@ -1440,7 +1440,15 @@
---
> @@ -1439,7 +1439,15 @@
3067c3067
< @@ -1459,7 +1467,14 @@
---
> @@ -1458,7 +1466,14 @@
3083c3083
< @@ -1560,7 +1575,7 @@
---
> @@ -1559,7 +1574,7 @@
3092c3092
< @@ -3038,7 +3053,7 @@
---
> @@ -3026,7 +3041,7 @@
3101c3101
< @@ -4287,6 +4302,7 @@
---
> @@ -4273,6 +4288,7 @@
3109c3109
< @@ -4313,9 +4329,24 @@
---
> @@ -4299,9 +4315,24 @@
3136c3136,3145
< @@ -6088,6 +6119,7 @@
---
> @@ -5677,7 +5708,7 @@
> cs_hexdump(0, demux[demux_id].lastcw[n], 8, lastcw, sizeof(lastcw));
> cs_hexdump(0, cw + (n * 8), 8, newcw, sizeof(newcw));
>
> - if((memcmp(cw + (n * 8), demux[demux_id].lastcw[n], 8) != 0 || cwEmpty)
> + if((memcmp(cw + (n * 8), demux[demux_id].lastcw[n], 8) != 0 || cwEmpty || stream_id > 1)
> && memcmp(cw + (n * 8), nullcw, 8) != 0) // check if already delivered and new cw part is valid!
> {
> ca_index_t idx = dvbapi_ca_setpid(demux_id, pid, stream_id, (algo == CA_ALGO_DES)); // prepare ca
> @@ -6074,6 +6105,7 @@
3143a3153,3162
> @@ -6119,7 +6151,8 @@
> cw = er->cw;
> }
> // Audio
> - else if(stream_type == 0x03 || stream_type == 0x04 || stream_type == 0x0F || stream_type == 0x11
> + else if(stream_type == 0x03 || stream_type == 0x04 || stream_type == 0x06
> + || stream_type == 0x0F || stream_type == 0x11
> || stream_type == 0x81 || (stream_type >= 0x83 && stream_type <= 0x87) || stream_type == 0x8A)
> {
> cw = er->cw_ex.audio[key_pos_a]
Display More
Also some fixes for stream relay connection error detection.
(also updated on my osemu github)
module-emulator-stream.c
Code
780c780
< if(streamStatus == -1)
---
> if(streamStatus == 0) // socket closed
782c782,784
< streamDataErrorCount++;
---
> cs_log("[Emu] warning: stream client %i - stream source closed connection", conndata->connid);
> streamConnectErrorCount++;
> cs_sleepms(100);
786c788
< if(streamStatus == 0)
---
> if(streamStatus < 0) // error
788,789c790,797
< cs_log("[Emu] warning: stream client %i no data from stream source", conndata->connid);
< streamDataErrorCount++; // 2 sec timeout * 15 = 30 seconds no data -> close
---
> if ((errno == EWOULDBLOCK) | (errno == EAGAIN)) {
> cs_log("[Emu] warning: stream client %i no data from stream source", conndata->connid);
> streamDataErrorCount++; // 2 sec timeout * 15 = 30 seconds no data -> close
> cs_sleepms(100);
> continue;
> }
> cs_log("[Emu] warning: stream client %i error receiving data from stream source", conndata->connid);
> streamConnectErrorCount++;
791c799
< continue;
---
> break;
793c801
<
---
>
807a816,817
> streamDataErrorCount++;
> cs_sleepms(100);
809a820,823
> else
> {
> streamDataErrorCount = 0;
> }
812d825
< streamDataErrorCount = 0;
Display More
Note: I do not have a dreambox to test with, so can someone please confirm it is working?