albfan / miraclecast

Connect external monitors to your system via Wifi-Display specification also known as Miracast
Other
3.81k stars 411 forks source link

ERROR: supplicant: HUP on supplicant socket of wlan0 (supplicant_global_fn() in /home/pi/miraclecast/src/wifi/wifid-supplicant.c:2181) #466

Closed YuanPeir-Chen closed 1 year ago

YuanPeir-Chen commented 1 year ago

Objective Mirror Windows 10 screen to Raspberry pi 3B+ device

My Raspbian OS:

pi@raspberrypi:/home/pi/miraclecast/build $ uname -a
Linux raspberrypi 5.10.103-v7+ #1529 SMP Tue Mar 8 12:21:37 GMT 2022 armv7l GNU/Linux

pi@raspberrypi:/home/pi/miraclecast/build $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster

Is my device supported?

pi@raspberrypi:~/Joe/miraclecast/res $ ./test-hardware-capabilities.sh 
wlan0 supports P2P

pi@raspberrypi:~/miraclecast/res $ ./test-viewer.sh
testing plugins required:

test udpsrc... (passed)
test rtpjitterbuffer... (passed)
test rtpmp2tdepay... (passed)
test tsdemux... (passed)
test h264parse... (passed)
test avdec_h264... (passed)
test autovideosink... (passed)

everything installed

After install miraclecast, I tried to execute script as below to connect with Win10

systemctl stop NetworkManager.service
systemctl stop wpa_supplicant.service
/home/pi/miraclecast/res/kill-wpa.sh
#miracle-wifid &
#miracle-sinkctl

and got below almost same as #347 , #350

ERROR: supplicant: HUP on supplicant socket of wlan0 (supplicant_global_fn() in /home/pi/miraclecast/src/wifi/wifid-supplicant.c:2181)

Here is log asking for support Many thanks in advance!

log.zip

albfan commented 1 year ago

log-date-time pays off.

[11/25/22 - 10:21:56.025.723] ERROR: supplicant: HUP on supplicant socket of wlan0 (supplicant_global_fn() in /home/pi/miraclecast/src/wifi/wifid-supplicant.c:2181)
Nov 25 10:21:57 raspberrypi miracle-wifid-wlan0-3[1306]: supp-global-ctrl-iface-init(/run/miracle/wifi/wlan0-3.global) (will try fixup): bind(PF_UNIX): Address already in use
Nov 25 10:21:57 raspberrypi miracle-wifid-wlan0-3[1306]: ctrl_iface exists and seems to be in use - cannot override it
Nov 25 10:21:57 raspberrypi miracle-wifid-wlan0-3[1306]: Delete '/run/miracle/wifi/wlan0-3.global' manually if it is not used anymore
Nov 25 10:21:57 raspberrypi miracle-wifid-wlan0-3[1306]: Failed to initialize wpa_supplicant
Nov 25 10:21:57 raspberrypi miracle-wifid-wlan0-3[1307]: supp-global-ctrl-iface-init(/run/miracle/wifi/wlan0-3.global) (will try fixup): bind(PF_UNIX): Address already in use
Nov 25 10:21:57 raspberrypi miracle-wifid-wlan0-3[1307]: ctrl_iface exists and seems to be in use - cannot override it
Nov 25 10:21:57 raspberrypi miracle-wifid-wlan0-3[1307]: Delete '/run/miracle/wifi/wlan0-3.global' manually if it is not used anymore
Nov 25 10:21:57 raspberrypi miracle-wifid-wlan0-3[1307]: Failed to initialize wpa_supplicant

looks something is not correctly cleaned on your system.

Delete '/run/miracle/wifi/wlan0-3.global' manually if it is not used anymore

YuanPeir-Chen commented 1 year ago

HI @albfan

After manually deleting '/run/miracle/wifi/wlan0-3.global', windows 10 PC seems pair successful,

and I execute the ./miracle-vlc -p 7236 or ./miracle-vlc -p 1991

but VLC cant's cast any video or audio

Do you have any suggestions? log.zip

albfan commented 1 year ago

pair is only one step, you need to interchange streaming config.

a message like:

DEBUG: OUTGOING: RTSP/1.0 200 OK

will be logged at that moment.

I suggest to start with a simple screen sharing with an android phone, to see a successful session.

See if you use microsoft device, it comes with a protocol extension, so your source is waiting on responses for all the paremeter requested

wfd_video_formats
wfd_audio_codecs
wfd_client_rtp_ports
wfd_display_edid
wfd_connector_type
wfd_uibc_capability
wfd2_rotation_capability
wfd2_video_formats
wfd2_audio_codecs
wfd2_video_stream_control
wfd_content_protection
wfd_idr_request_capability
intel_friendly_name
intel_sink_manufacturer_name
intel_sink_model_name
intel_sink_version
intel_sink_device_URL
microsoft_latency_management_capability
microsoft_format_change_capability
microsoft_diagnostics_capability
microsoft_cursor
microsoft_rtcp_capability
microsoft_video_formats
microsoft_max_bitrate
microsoft_multiscreen_projection
microsoft_audio_mute
microsoft_color_space_conversion

You can see more details on how to deal with this in wiki: https://github.com/albfan/miraclecast/wiki/miracle-sinkctl#extend-request-protocol, where an example is documented

https://github.com/albfan/miraclecast/blob/master/res/sinkctl.protocol-extension.example

some parameters needs to be collected from your system, but you can hardcode until that is ready