catalinii / minisatip

minisatip is an SATIP server for linux using local DVB-S2, DVB-C, DVB-T or ATSC cards
https://minisatip.org
327 stars 81 forks source link

Fritzbox response quirk broken due, response code parsed incorrectly #1164

Closed retrofan1979 closed 2 months ago

retrofan1979 commented 3 months ago

Hello,

I noticed when I try to do a channelscan with DVBViewer Pro and TransEdit with minisatip as SAT>IP server, it rejects the connection. However, when I play an SAT>IP URL it streams just fine. Also when analyzing a mux with TransEdit it works fine. Only a channelscan fails. Hope you can fix it. I'm using a Fritz!Box 6690 cable. See logfile attached.

retrofan1979 commented 3 months ago

Schermafbeelding 2024-07-17 175358 minisatip.log

xxj737 commented 2 months ago

pid=all
Not Supported

retrofan1979 commented 2 months ago

Thanks, but with TransEdit I can scan a mux with over a 100 pids, so no problems here. When I want to do a normal channelscan I get this error.

xxj737 commented 2 months ago

for example 微信截图_20240727145624

retrofan1979 commented 2 months ago

with SAT>IP server (DVB-C) of Fritz!Box 6690 Cable I have no problems at all, but with minisatip the channelscan fails, so it seems a bug in minisatip? Hope you can fix it.

retrofan1979 commented 2 months ago

Fritzbox:

fritzbox 1

fritzbox 2

retrofan1979 commented 2 months ago

minisatip:

minisatip 1

minisatip 2

retrofan1979 commented 2 months ago

I found out when selecting option "Open whole transponder" in TransEdit it will scan one mux at the time. With Fritzbox this option isn't needed. When trying to scan all muxes with minisatip, it shows the error again. Channelscan in DVBViewer still fails.

retrofan1979 commented 2 months ago

minisatip 4

Jalle19 commented 2 months ago

Have you tried running minisatip with -k?

  • -k Emulate pids=all when the hardware does not support it, on enigma boxes is enabled by default
retrofan1979 commented 2 months ago

Thanks for the suggestion, I tried it now, but still no luck.

retrofan1979 commented 2 months ago

No other suggestions? Maybe someone else with Fritzbox can try? @lars18th or @9000h perhaps?

catalinii commented 2 months ago

Can you add -l satipc to the command oine and upload a poad again?

retrofan1979 commented 2 months ago

Can you add -l satipc to the command oine and upload a poad again?

Hi @catalinii : thanks, yes, ofcourse, here it is :-)

service.log

Jalle19 commented 2 months ago
[05/08 08:43:30.814 AD0]: satipc_reply (adapter 0, state 3): receiving from handle 10, sock 13, code 1434
[05/08 08:43:30.815 AD0]: satipc: Received signal status from the server for adapter 0, stength=113 status=0 quality=0
[05/08 08:43:30.815 AD0]: marking device 0 as error, rc = 1434
retrofan1979 commented 2 months ago
[05/08 08:43:30.814 AD0]: satipc_reply (adapter 0, state 3): receiving from handle 10, sock 13, code 1434
[05/08 08:43:30.815 AD0]: satipc: Received signal status from the server for adapter 0, stength=113 status=0 quality=0
[05/08 08:43:30.815 AD0]: marking device 0 as error, rc = 1434

Thanks, but what does it mean and more importantly: how can we fix it? When I stop the stream and restart it again it works fine. Maybe it needs an extra teardown?

Jalle19 commented 2 months ago

I don't exactly know what it means, I just pointed it out since it looks suspicious. Maybe @lars18th or @catalinii knows?

9000h commented 2 months ago

Fritz!Box is some kind of sat>ip compatible but not certificated, and some workarounds still needed (for QAM64 channels for example

catalinii commented 2 months ago

Let’S try -v satipc

to identify why is the server erroring out

retrofan1979 commented 2 months ago

Let’S try -v satipc

to identify why is the server erroring out

Here it is. service.log

retrofan1979 commented 2 months ago

and another logfile, the same as the previous one, but also added with DVBViewer playback via HTTP SAT>IP URLS port 8080.

service.log

retrofan1979 commented 2 months ago

@catalinii : did you investigate the logs already? What to do next?

Jalle19 commented 2 months ago

Seems like the server sends invalid RTSP responses with two empty lines between the headers and the body, leading to the packet being processed as two separate packets:

[08/08 16:53:45.417 AD0]: MSG process << server :
RTSP/1.0 200 OK
Content-Base: rtsp://192.168.178.1:554/stream=1918
Content-Length: 205
Content-Type: application/sdp
CSeq: 10
Session: 1931

[08/08 16:53:45.417 AD0]: satipc_reply (adapter 0, state 3): receiving from handle 7, sock 8, code 200
[08/08 16:53:45.417 AD0]: satipc 0, expect_reply 0, want_tune 0 want commit 1
[08/08 16:53:45.417 AD0]: satipc: request for adapter 0, state 3, freq 498000, pids to add 0, pids to delete 0, expect_reply 0, want_tune 0, sent_transport 1, closed_rtsp 0
[08/08 16:53:45.417 AD0]: adapter 0: Nothing to commit
[08/08 16:53:45.461 AD0]: MSG process << server :
v=0
o=- 1931 1 IN IP4 192.168.178.1
s=SatIPServer:1 0,0,4
t=0 0
m=video 0 RTP/AVP 33
c=In IP4 0.0.0.0
a=control:stream=1918
a=fmtp:33 ver=1.2;src=1;tuner=1,113,0,0,498.00,8,dvbc,256qam,6900,,,,
a=sendonly

[08/08 16:53:45.461 AD0]: satipc_reply (adapter 0, state 3): receiving from handle 7, sock 8, code 1931

Since the logic for determining the status code is fairly naive, it ends up thinking that the 1931 from o=- 1931 1 IN IP4 192.168.178.1 is the status code.

Jalle19 commented 2 months ago

~The logging mechanism is also broken, LOGM in satipc_reply works, but not in satipc_tcp_read. Probably due to all the various #undef going on.~ Edit: nevermind, TCP is not used here

Jalle19 commented 2 months ago

Seems our old friend https://github.com/catalinii/minisatip/issues/508#issue-388111162 has resurfaced

Jalle19 commented 2 months ago

Fixing the return code algorithm to return 0 if a valid return code is not found will fix this

Jalle19 commented 2 months ago

A better solution would be to parse the device information like tvheadend does (https://github.com/tvheadend/tvheadend/blob/49ac9387186d32b55a399a04155e835eac22c6c1/src/input/mpegts/satip/satip_frontend.c#L2264) and apply quirks based on device, not return code. Could also be useful to show in the web interface instead of just the IP address.

retrofan1979 commented 2 months ago

@Jalle19 thanks for investigating, much appreciated! So, probably it can be fixed :-)

catalinii commented 2 months ago

I think we should force satipc_tcp_read to wait for the payload. The content-length indicates there is a statically sized payload