philippe44 / AirConnect

Use AirPlay to stream to UPnP/Sonos & Chromecast devices
Other
3.52k stars 217 forks source link

Cannot find any chromecast device? #480

Closed room-homage closed 1 year ago

room-homage commented 1 year ago

Where do I start to debug such issue?

philippe44 commented 1 year ago

it's usually because AirConnect is not on the same network/subnet as your CCs

squallstar commented 1 year ago

@philippe44 I have the same issue with a Apple Macbook Pro M2 Pro on Sonoma 14.0 (public beta).

I've got plenty of Chromecast compatible devices in my network and this is the only output I get from the script:

./airupnp-macos-arm64-static -d all=sdebug
[13:52:28.065201] main:1367 Starting airupnp version: v1.1.7 (May 20 2023 @ 06:12:13)
[13:52:28.065857] main:1374 no config file, using defaults
[13:52:28.066437] Start:1086 Binding to iface en0@192.168.1.202:0
[13:52:28.066553] bind_socket:636 socket binding 7 on port 52001
[13:52:28.066574] Start:1125 Starting pico HTTP server on port 52001
[13:52:58.004950] MasterHandler:560 event: 7 [UPNP_DISCOVERY_SEARCH_TIMEOUT] [0x0] (recurse 0)
[13:52:58.005058] UpdateThread:695 Presence checking
[13:53:28.004205] MasterHandler:560 event: 7 [UPNP_DISCOVERY_SEARCH_TIMEOUT] [0x0] (recurse 0)
[13:53:28.004258] UpdateThread:695 Presence checking
[13:53:35.493502] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.493925] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.494707] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.495503] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.496904] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.497688] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.498597] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.499280] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.501615] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.596054] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.698320] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.698746] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.700179] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.700975] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.701706] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.702487] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.703350] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.704020] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.706367] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:35.800941] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:53:58.004958] MasterHandler:560 event: 7 [UPNP_DISCOVERY_SEARCH_TIMEOUT] [0x0] (recurse 0)
[13:53:58.005090] UpdateThread:695 Presence checking
[13:54:16.965701] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:54:16.965701] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:54:16.966157] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:54:16.966757] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:54:16.967388] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:54:17.078196] MasterHandler:560 event: 4 [UPNP_DISCOVERY_ADVERTISEMENT_ALIVE] [0x0] (recurse 0)
[13:54:28.004921] MasterHandler:560 event: 7 [UPNP_DISCOVERY_SEARCH_TIMEOUT] [0x0] (recurse 0)
[13:54:28.005019] UpdateThread:695 Presence checking
philippe44 commented 1 year ago

Old GenX speaking here 😄, it's not a script but a plain C/C++ compiled application. More seriously, you're using the version for UPnP devices, not the one for CC players.

squallstar commented 1 year ago

@philippe44 thanks, sorry about that I tried with the CC version and it's correctly discovering compatible devices now. However, a few seconds after I cast audio to any of the devices I get this error and the application exits:

aircast-macos-arm64-static(42412,0x170e93000) malloc: Heap corruption detected, free list is damaged at 0x600001698f50
*** Incorrect guard value: 0
aircast-macos-arm64-static(42412,0x170e93000) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      ./aircast-macos-arm64-static

Full output:

[18:04:31.818006] main:914 Starting aircast version: v1.1.7 (May 20 2023 @ 06:21:57)
[18:04:31.818606] main:921 no config file, using defaults
[18:04:31.818658] Start:681 Binding to 192.168.1.203
[18:04:31.842054] Start:706 Starting pico HTTP server on port 57740
[18:04:32.154048] AddCastDevice:646 [0x15002ba20]: adding renderer (Ufficio) with mac CCCCB805D848
[18:04:32.154690] AddCastDevice:632 [0x15002c3d0]: creating MAC
[18:04:32.366100] AddCastDevice:646 [0x15002e0e0]: adding renderer (Display ufficio) with mac CCCCBCE89646
[18:04:34.906490] rtsp_thread:338 got RTSP connection 19
[18:04:34.919047] handle_rtsp:379 [0x13d004960]: received ANNOUNCE
[18:04:34.919345] handle_rtsp:385 [0x13d004960]: challenge iJzC3TxGZVgcp/Wi5mf/ug
[18:04:34.926809] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Apple-Response: ZEE1zgHV4bykES2O7UVEdZVQA5iXk01xrbxvpBhmzMk7ThlggVEXZ2bAWX8lWySr3I1o+zLlB1Ld6t3K4+C5L6IQ95uaaOpcZhfDsQkBMlqyIeMOEbzCJowI6MvSfNvmy69S//j6mvYblHWeY0yQ+TrnH4a1RW7yFX/pFMD1nQXAiRiquzH+IwQsx5LPlwjhyeu1KPeW6Bkg/5EC8N1sVL0lFDpS0yyEatJ/BbirZnyUMfM+3p5CmWE8bMPXWXqvC9kqEiy4E29rxQzfR3ygoMK8xWUgRTO83YdaASZBw76zcfjwob8A33kATem1TtcvhSbm6gwhYdnLJlVfH4xpZA
Audio-Jack-Status: connected; type=analog
CSeq: 1

[18:04:34.927710] handle_rtsp:379 [0x13d004960]: received SETUP
[18:04:34.927960] raopst_init:378 [0x130008000]: UDP port-0 53075
[18:04:34.927988] raopst_init:378 [0x130008000]: UDP port-1 58540
[18:04:34.927998] raopst_init:378 [0x130008000]: UDP port-2 65270
[18:04:34.928010] raopst_init:396 [0x130008000]: HTTP listening port 57754
[18:04:34.928081] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Transport: RTP/AVP/UDP;unicast;mode=record;control_port=58540;timing_port=65270;server_port=53075
Session: DEADBEEF
Audio-Jack-Status: connected; type=analog
CSeq: 2

[18:04:34.929307] handle_rtsp:379 [0x13d004960]: received RECORD
[18:04:34.929316] raopst_record:502 [0x130008000]: record 28989 3000901730
[18:04:34.929319] raop_cb:182 [0x15002e0e0]: Stream
[18:04:34.929331] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 3

[18:04:34.930047] handle_rtsp:379 [0x13d004960]: received SET_PARAMETER
[18:04:34.930054] handle_rtsp:546 [0x13d004960]: SET PARAMETER volume -21.837528
[18:04:34.930057] CastSetDeviceVolume:375 [0x15002e0e0]: Queuing SET_VOLUME
[18:04:34.930059] raop_cb:232 [0x15002e0e0]: Volume[0..1] 0.2721
[18:04:34.930069] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 4

[18:04:34.930334] rtp_thread_func:738 [0x130008000]: 1st sync packet received
[18:04:34.930378] rtp_thread_func:711 [0x130008000]: 1st audio packet received
[18:04:34.930556] handle_rtsp:379 [0x13d004960]: received SET_PARAMETER
[18:04:34.930561] handle_rtsp:546 [0x13d004960]: SET PARAMETER volume -21.837528
[18:04:34.930566] CastSetDeviceVolume:375 [0x15002e0e0]: Queuing SET_VOLUME
[18:04:34.930567] raop_cb:232 [0x15002e0e0]: Volume[0..1] 0.2721
[18:04:34.930586] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 5

[18:04:34.930826] flac_init:195 [0x130008000]: Using FLAC-0 (0x6000026a00c0)
[18:04:34.930881] buffer_put_packet:620 [0x130008000]: fill [level:1] [W:28989 R:28989]
[18:04:34.930921] raop_cb:205 [0x15002e0e0]: Play
[18:04:34.931271] handle_rtsp:379 [0x13d004960]: received SET_PARAMETER
[18:04:34.968416] search_remote_cb:637 [0x13d004960]: found ActiveRemote for 2852C603DBF56987 at 192.168.1.203:57636
[18:04:35.015323] CastConnect:239 [0x15002e0e0]: SSL connection opened [0x13d80ac00]
[18:04:35.015945] CastLoad:177 [0x15002e0e0]: Queuing LOAD
[18:04:35.015968] CastPlay:264 [0x15002e0e0]: Queuing PLAY
[18:04:35.015978] CastSetDeviceVolume:375 [0x15002e0e0]: Queuing SET_VOLUME
[18:04:35.016013] CastPlay:264 [0x15002e0e0]: Queuing PLAY
[18:04:35.016071] CastPlay:264 [0x15002e0e0]: Queuing PLAY
[18:04:35.016298] handle_rtsp:565 [0x13d004960]: received metadata
    artist: Maurizio Pollini
    album:  Chopin: Études
    title:  12 Études, Op. 10: No. 1 in C Major
[18:04:35.016380] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 6

[18:04:35.018433] handle_rtsp:379 [0x13d004960]: received SET_PARAMETER
[18:04:35.018538] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 7

[18:04:35.020222] handle_rtsp:379 [0x13d004960]: received SET_PARAMETER
[18:04:35.020303] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 8

[18:04:35.548046] handle_rtsp:379 [0x13d004960]: received SET_PARAMETER
[18:04:35.548210] CastPlay:264 [0x15002e0e0]: Queuing PLAY
[18:04:35.548223] handle_rtsp:565 [0x13d004960]: received metadata
    artist: Maurizio Pollini
    album:  Chopin: Études
    title:  12 Études, Op. 10: No. 1 in C Major
[18:04:35.548301] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 9

[18:04:35.550930] handle_rtsp:379 [0x13d004960]: received SET_PARAMETER
[18:04:35.551024] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 10

[18:04:35.553267] handle_rtsp:379 [0x13d004960]: received SET_PARAMETER
[18:04:35.553346] handle_rtsp:592 [0x13d004960]: responding:
RTSP/1.0 200 OK
Audio-Jack-Status: connected; type=analog
CSeq: 11

[18:04:36.647641] CastSocketThread:631 [0x15002e0e0]: Launching receiver 1
[18:04:36.658943] CastSocketThread:659 [0x15002e0e0]: Receiver launched
[18:04:36.659115] ProcessQueue:448 [0x15002e0e0]: Processing VOLUME (id:3)
[18:04:37.677759] ProcessQueue:448 [0x15002e0e0]: Processing VOLUME (id:5)
[18:04:38.789536] ProcessQueue:485 [0x15002e0e0]: Processing LOAD (id:6)
[18:04:39.002195] http_thread_func:1060 [0x130008000]: got HTTP connection 26 (silent frames 0)
[18:04:39.010344] buffer_put_packet:620 [0x130008000]: fill [level:513] [W:29501 R:28989]
[18:04:39.221834] handle_http:1236 [0x130008000]: received GET HTTP/1.1
Host: 192.168.1.203:57754
Connection: keep-alive
User-Agent: Mozilla/5.0 (Fuchsia) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 CrKey/1.56.500000
Accept-Encoding: identity;q=1, *;q=0
Accept: */*
CAST-DEVICE-CAPABILITIES: {"bluetooth_supported":true,"display_supported":true,"hi_res_audio_supported":false,"remote_control_input_supported":false,"touch_input_supported":true}
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Range: bytes=0-

[18:04:39.222173] handle_http:1281 [0x130008000]: responding: HTTP/1.0 200 OK
Server: HairTunes
Content-Type: audio/flac
Connection: close

[18:04:39.222190] _buffer_get_frame:961 [0x130008000]: drain [level:538 gap:-2300] [W:29527 R:28989] [R:0 S:0 F:0]
[18:04:39.339697] http_thread_func:1196 [0x130008000]: spent 68 ms in send for 1895 bytes (sent 1895)!
[18:04:39.343259] CastSocketThread:673 [0x15002e0e0]: Media session id 3
[18:04:39.419792] http_thread_func:1196 [0x130008000]: spent 72 ms in send for 1919 bytes (sent 1919)!
[18:04:39.487001] _buffer_get_frame:961 [0x130008000]: drain [level:59 gap:1520] [W:29560 R:29501] [R:0 S:0 F:0]
[18:04:39.507649] ProcessQueue:455 [0x15002e0e0]: Processing PLAY (id:8)
[18:04:39.542549] http_thread_func:1196 [0x130008000]: spent 55 ms in send for 1812 bytes (sent 1812)!
[18:04:39.690669] ProcessQueue:448 [0x15002e0e0]: Processing VOLUME (id:10)
[18:04:39.690759] MRThread:292 [0x15002e0e0]: Cast playing
[18:04:40.761177] ProcessQueue:455 [0x15002e0e0]: Processing PLAY (id:12)
[18:04:40.858589] ProcessQueue:455 [0x15002e0e0]: Processing PLAY (id:13)
[18:04:40.960696] ProcessQueue:455 [0x15002e0e0]: Processing PLAY (id:14)
aircast-macos-arm64(43752,0x16f203000) malloc: *** error for object 0x600000784780: pointer being freed was not allocated
aircast-macos-arm64(43752,0x16f203000) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      /Users/nicholas/Downloads/aircast-macos-arm64
philippe44 commented 1 year ago

Ah, this one ... I've never been able to figure out. It only happens on Mac and arm64 so I can't investigate. I think the x86 version works fine with Rosetta

squallstar commented 1 year ago

@philippe44 the issue is replicable with the x86 version as well on macOS Sonoma, see:

Host: 192.168.1.203:57829
Connection: keep-alive
User-Agent: Mozilla/5.0 (Fuchsia) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36 CrKey/1.56.500000
Accept-Encoding: identity;q=1, *;q=0
Accept: */*
CAST-DEVICE-CAPABILITIES: {"bluetooth_supported":true,"display_supported":true,"hi_res_audio_supported":false,"remote_control_input_supported":false,"touch_input_supported":true}
Accept-Language: en-GB,en-US;q=0.9,en;q=0.8
Range: bytes=0-

[18:09:57.341480] handle_http:1281 [0x7f8248020000]: responding: HTTP/1.0 200 OK
Server: HairTunes
Content-Type: audio/flac
Connection: close

[18:09:57.341521] _buffer_get_frame:959 [0x7f8248020000]: drain [level:347 gap:-779] [W:47664 R:47317] [R:0 S:0 F:0]
[18:09:57.455597] CastSocketThread:673 [0x7f824800ea90]: Media session id 5
[18:09:57.504381] ProcessQueue:455 [0x7f824800ea90]: Processing PLAY (id:8)
[18:09:57.677835] ProcessQueue:448 [0x7f824800ea90]: Processing VOLUME (id:10)
[18:09:57.677930] MRThread:292 [0x7f824800ea90]: Cast playing
[18:09:58.650473] buffer_put_packet:620 [0x7f8248020000]: fill [level:1] [W:47829 R:47829]
[18:09:58.668410] _buffer_get_frame:959 [0x7f8248020000]: drain [level:2 gap:1980] [W:47831 R:47829] [R:0 S:0 F:0]
[18:09:58.717983] ProcessQueue:455 [0x7f824800ea90]: Processing PLAY (id:12)
aircast-macos-x86_64-static(44990,0x30b071000) malloc: Heap corruption detected, free list is damaged at 0x6000037485f0
*** Incorrect guard value: 105553174233928
aircast-macos-x86_64-static(44990,0x30b071000) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      ./aircast-macos-x86_64-static
philippe44 commented 1 year ago

Should be fixed in 1.1.8

philippe44 commented 1 year ago

Closed for inactivity