GerryDazoo / Slinger

Reuse SlingBox hardware without SlingBox Servers
170 stars 34 forks source link

Older slingbox connected but no audio #78

Closed idenny1 closed 1 year ago

idenny1 commented 1 year ago

Hi, Thankyou for your work. I have a older slingbox model SB240-100 connected video is working but no sound. I am going start looking at your code slingbox_server.py probably something in the audio header when I have time. Any ideas what to start looking at?

Thanks

Config: [SLINGBOX] sbtype="Solo/Pro/ProHD" password=xxxx ipaddress=15.0.0.254 port=5001

[SERVER] ; local port number for the server to listen on for connections port=8080 maxstreams=10 enableremote=yes Log: Streamer: Waiting for first stream, flushing any IR requests that arrive while not connected to slingbox 09/17/2022, 13:37:07 Streaming connection from ('15.0.0.232', 49980) Slinginfo "Solo/Pro/ProHD" xxxx 12 30 15.0.0.254 5001 3000 Starting Stream for 15.0.0.232:49980 Connecting... ('15.0.0.254', 5001) Control VideoParameters: Resolution= 12 FrameRate= 30 VideoBandwidth= 2000 VideoSmoothness= 63 IframeRate= 5 AudioBitRate= 64 cmd: 0xb5 err: 0x26 0 Connecting... ('15.0.0.254', 5001) Stream0 Stream started at 09/17/2022, 13:37:08 557 0

GerryDazoo commented 1 year ago

You can try the 350/500 slingbox type. If you want to there's some parsing of the Solo header to hack some audio stuff but I just cloned some existing code and not really sure what it does,except it works.

Line 446 if Solo: tbd = 0 audio_header = b'\x91\x07\xDC\xB7\xB7\xA9\xCF\x11\x8E\xE6\x00\xC0\x0C\x20\x53\x65\x72' audio_header_pos = first_buffer.find( audio_header ) + 0x60 # find audio hdr first_buffer[audio_header_pos:audio_header_pos+10] = pack("H 8x", 0x9012)

idenny1 commented 1 year ago

Thanks for the quick reply. I changed the following:

config.ini: sbtype=Solo

slingbox_server.py:

changed line 448 audio_header = b'\x91\x07\xDC\xB7\xB7\xA9\xCF\x11\x8E\xE6\x00\xC0\x0C\x20\x53\x65\x72'

to 448 audio_header = b'\xA1\xDC\xAB\x8C\x47\xA9\xCF\x11\x8E\xE6\x00\xC0\x0C\x20\x53\x65\x68'

Now audio is working. Not really sure what the change does other than tells the code where the audio stream starts I guess.

I am not a python coder but if we add and sbtype for "SB240-100" and another "if SB240-100:" with the different audio_header.

Thanks

GerryDazoo commented 1 year ago

Will do. Many thanks. It will be in the 3.08 release coming soon.

GerryDazoo commented 1 year ago

A quick question, how did you come up with that magic string?

idenny1 commented 1 year ago

I uncommented line 442 442 # print( 'FIRST', type(first_buffer), pbuf(first_buffer)) Which displayed hexcode

idenny1 commented 1 year ago

FIRST <class 'bytearray'> 000000 30 26 b2 75 8e 66 cf 11 a6 d9 00 aa 00 62 ce 6c 000016 fb 01 00 00 00 00 00 00 05 00 00 00 01 02 a1 dc 000032 ab 8c 47 a9 cf 11 8e e4 00 c0 0c 20 53 65 68 00 000048 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 000064 00 00 00 00 00 00 2d 02 00 00 00 00 00 00 00 00 000080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 80 c3 000096 c9 01 00 00 00 00 00 00 00 00 00 00 00 00 b8 0b 000112 00 00 00 00 00 00 01 00 00 00 b8 0b 00 00 b8 0b 000128 00 00 00 bd 1f 00 b5 03 bf 5f 2e a9 cf 11 8e e3 000144 00 c0 0c 20 53 65 2e 00 00 00 00 00 00 00 11 d2 000160 d3 ab ba a9 cf 11 8e e6 00 c0 0c 20 53 65 06 00 000176 00 00 00 00 33 26 b2 75 8e 66 cf 11 a6 d9 00 aa 000192 00 62 ce 6c 50 00 00 00 00 00 00 00 12 00 18 00 000208 00 00 04 00 00 00 53 00 6c 00 69 00 6e 00 67 00 000224 62 00 6f 00 78 00 00 00 53 00 6c 00 69 00 6e 00 000240 67 00 20 00 4d 00 65 00 64 00 69 00 61 00 00 00 000256 31 00 00 00 91 07 dc b7 b7 a9 cf 11 8e e6 00 c0 000272 0c 20 53 65 85 00 00 00 00 00 00 00 c0 ef 19 bc 000288 4d 5b cf 11 a8 fd 00 80 5f 5c 44 2b 00 57 fb 20 000304 55 5b cf 11 a8 fd 00 80 5f 5c 44 2b 00 00 00 00 000320 00 00 00 00 37 00 00 00 00 00 00 00 02 00 00 00 000336 00 00 40 01 00 00 f0 00 00 00 02 2c 00 2c 00 00 000352 00 40 01 00 00 f0 00 00 00 01 00 18 00 57 4d 56 000368 33 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 000384 00 00 00 00 00 4f f9 c0 89 91 07 dc b7 b7 a9 cf 000400 11 8e e6 00 c0 0c 20 53 65 72 00 00 00 00 00 00 000416 00 40 9e 69 f8 4d 5b cf 11 a8 fd 00 80 5f 5c 44 000432 2b 50 cd c3 bf 8f 61 cf 11 8b b2 00 aa 00 b4 e2 000448 20 00 00 00 00 00 00 00 00 1c 00 00 00 08 00 00 000464 00 01 00 00 00 00 00 61 01 02 00 00 7d 00 00 a0 000480 0f 00 00 00 06 10 00 0a 00 00 90 00 00 17 00 00 000496 06 00 00 01 00 06 00 06 01 00 00 36 26 b2 75 8e 000512 66 cf 11 a6 d9 00 aa 00 62 ce 6c 32 00 00 00 00 000528 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 000544 00 00 00 00 00 00 00 00 00 00 00 01 01

GerryDazoo commented 1 year ago

thx, Code is in next version 3.08 coming soon