albfan / miraclecast

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

my phone can‘t find device when i run in VMware Ubuntu 16.04 #419

Closed zrzhuang closed 2 years ago

zrzhuang commented 2 years ago

I have done with the reference of readme,but i can't find out the miracle device by my phone,After i run the command sudo miracle-sinkctl in the Ubuntu16.04 in the VMware

Kernel Version:

System Version:

res/test-viewer.sh:

test-hardware-capabilities.sh

I have copy the file org.freedesktop.miracle.conf

make install
../configure --enable-rely-udev
sudo miracle-wifid &
sudo miracle-sinkctl -> set-managed x yes

still can’t find the device on my phone.

albfan commented 2 years ago

Just to mention: configure after install has no effect.

there was a change in systems on Ubuntu 19.

Anyway I'm unsure if miraclecast will run correctly on Ubuntu 16.04 (due to old systems version)

See branch systemd-219 for oldest compatibility version.

There will be no patches about that, upgrade your OS for support

zrzhuang commented 2 years ago

my systems version is 229,but i still can't find the device.

albfan commented 2 years ago

I suggest to upload logs for support as described on wiki

zrzhuang commented 2 years ago

sudo miracle-wifid --log-level trace gives the following result.

root@ubuntu:/home/user/zrzhuang/WifiDisplay/miraclecast-master/build# sudo miracle-wifid --log-level trace |& tee wifid.log INFO: miracle-wifid - revision 1.0 Oct 14 2021 14:50:43 DEBUG: friendly-name from local hostname: ubuntu (manager_read_name() in ../../../src/wifi/wifid.c:389) DEBUG: link: new link: wls35u1i2 (4) (link_new() in ../../../src/wifi/wifid-link.c:71) DEBUG: supplicant: new supplicant for wls35u1i2 (supplicant_new() in ../../../src/wifi/wifid-supplicant.c:2102) INFO: link: add link: wls35u1i2 DEBUG: ignored device: wls35u1i2 (manager_add_udev_link() in ../../../src/wifi/wifid.c:123) DEBUG: link: new link: wlxd0c0bf3ed6c6 (3) (link_new() in ../../../src/wifi/wifid-link.c:71) DEBUG: supplicant: new supplicant for wlxd0c0bf3ed6c6 (supplicant_new() in ../../../src/wifi/wifid-supplicant.c:2102) INFO: link: add link: wlxd0c0bf3ed6c6 DEBUG: ignored device: wlxd0c0bf3ed6c6 (manager_add_udev_link() in ../../../src/wifi/wifid.c:123)

zrzhuang commented 2 years ago

in this path "/home/user/zrzhuang/WifiDisplay/miraclecast-master/build/src/wifi", i do "sudo ./miracle-wifid --log-level trace",below is the log: i find after i install the USB wireless adaptor drive,ther are two device (wls35u1i2 & wlxd0c0bf3ed6c6 )

root@ubuntu:/home/user/zrzhuang/WifiDisplay/miraclecast-master/build/src/wifi# sudo ./miracle-wifid --log-level trace INFO: miracle-wifid - revision 1.0sssssssss Oct 25 2021 16:07:53 DEBUG: friendly-name from local hostname: ubuntu (manager_read_name() in ../../../src/wifi/wifid.c:391) DEBUG: link: new link: wls35u1i2 (4) (link_new() in ../../../src/wifi/wifid-link.c:71) DEBUG: supplicant: new supplicant for wls35u1i2 (supplicant_new() in ../../../src/wifi/wifid-supplicant.c:2102) INFO: link: add link: wls35u1i2 DEBUG: No Define Rely_udev:interface_name = (null),lazy_managed = 0 (manager_add_udev_link() in ../../../src/wifi/wifid.c:120) INFO: link: manage link wls35u1i2 DEBUG: supplicant: start supplicant of wls35u1i2 (supplicant_start() in ../../../src/wifi/wifid-supplicant.c:2636) DEBUG: supplicant: spawn supplicant of wls35u1i2 (supplicant_spawn() in ../../../src/wifi/wifid-supplicant.c:2482) INFO: supplicant: wpa_supplicant found: /sbin/wpa_supplicant INFO: supplicant: wpas spawned as pid:5702 DEBUG: link: new link: wlxd0c0bf3ed6c6 (3) (link_new() in ../../../src/wifi/wifid-link.c:71) DEBUG: supplicant: new supplicant for wlxd0c0bf3ed6c6 (supplicant_new() in ../../../src/wifi/wifid-supplicant.c:2102) INFO: link: add link: wlxd0c0bf3ed6c6 DEBUG: No Define Rely_udev:interface_name = (null),lazy_managed = 0 (manager_add_udev_link() in ../../../src/wifi/wifid.c:120) INFO: link: manage link wlxd0c0bf3ed6c6 DEBUG: supplicant: start supplicant of wlxd0c0bf3ed6c6 (supplicant_start() in ../../../src/wifi/wifid-supplicant.c:2636) DEBUG: supplicant: spawn supplicant of wlxd0c0bf3ed6c6 (supplicant_spawn() in ../../../src/wifi/wifid-supplicant.c:2482) INFO: supplicant: wpa_supplicant found: /sbin/wpa_supplicant INFO: supplicant: wpas spawned as pid:5703 DEBUG: supplicant: open supplicant of wls35u1i2 (supplicant_open() in ../../../src/wifi/wifid-supplicant.c:2268) DEBUG: supplicant: open supplicant of wlxd0c0bf3ed6c6 (supplicant_open() in ../../../src/wifi/wifid-supplicant.c:2268) TRACE: wpa: raw message: OK

TRACE: wpa: raw message: OK

TRACE: wpa: raw message: wifi_display=1 ifname=wlxd0c0bf3ed6c6 address=d0:c0:bf:3e:d6:c6

WARNING: supplicant: wpa_supplicant or driver does not support P2P (supplicant_status_fn() in ../../../src/wifi/wifid-supplicant.c:1697) TRACE: wpa: raw message: p2p_device_address=d2:c0:bf:3e:d6:c6 p2p_state=IDLE wifi_display=1 ifname=wls35u1i2 address=d2:c0:bf:3e:d6:c6

DEBUG: supplicant: local p2p-address is: d2:c0:bf:3e:d6:c6 (supplicant_status_fn() in ../../../src/wifi/wifid-supplicant.c:1822) TRACE: wpa: raw message: OK

TRACE: wpa: raw message: OK

TRACE: wpa: raw message: FAIL

TRACE: wpa: raw message: OK

TRACE: wpa: raw message: FAIL

albfan commented 2 years ago

You need to run all commands in different tabs at same time so you can capture execution

Probably the problem will be shown on journal log

zrzhuang commented 2 years ago

log.tar.gz hi. this is the log,please help me check it.

and i have two question, 1.when i do this cmd "$ systemctl stop NetworkManager.service $ systemctl stop wpa_supplicant.service",the wifi will be open,is OK?

2.are the phone and the sink need at the same wifi?

wait for you reply,thanks!

albfan commented 2 years ago

Miracast uses WiFi direct. Is a different protocol than usual WiFi.

Network manager can expose different interfaces and most cards can attend several protocols at same time, but that is not implemented yet in miraclecast, see #75

Stopping NM you avoid Miraclecast to use the wrong wpa_supplicant

Source and sink connect to a each other directly (using WiFi direct protocol) only them see this special network created ad-hoc for connection

zrzhuang commented 2 years ago

hi,can you find the error from the log?

albfan commented 2 years ago

You forget to add --log-level trace to miracle-sinkctl and journalctl -f is not capturing the communication (you should start this capture the first to capture all the operations (miracle-wifid start, miracle-sinkctl operations and your mobile trying to source to sink)

zrzhuang commented 2 years ago

hi : can you give me the complete and correct log from the cmd "sudo miracle-wifid &" to you phone display on the sink device successfully,and i can take this as a reference.thanks

albfan commented 2 years ago

That depends a lot on devices, you can search other issues with logs attached to find the expected output

zrzhuang commented 2 years ago

i find the function "static int ctl_wifi_peer_fn(sd_bus_message m, void data, sd_bus_error *err)" can't be called ,i don't know wheather is the reason that my phone can't find the sink?

albfan commented 2 years ago

Again,

We need logs. There we will see how the process is failing. journal to is probably the key as it shows the pair handshake and the streaming

zrzhuang commented 2 years ago

how can i run all commands in different tabs at same time,the cmds are below ?

$ sudo journalctl -f |& tee journal.log
$ sudo miracle-wifid --log-level trace |& tee wifid.log
$ sudo miracle-sinkctl --log-level trace --log-journal-level trace |& tee sink.log
albfan commented 2 years ago

You can open three terminals or open new tabs

https://newbedev.com/how-to-open-new-tab-in-existing-terminal-session-and-using-keyboard-shortcut-modifying-global-settings

For gnome-terminal it is Ctrl+Shift+T

Search for shortcuts or menu action on your terminal.

I use Tilix and you can even split session horizontally or vertically

zrzhuang commented 2 years ago

here is the log when i do below cmds in three different tabs log_20211101.tar.gz : from this lpg ,i find the sink can find my phone,but can not receive the P2P-PROV-DISC-PBC-REQ of my phone.

albfan commented 2 years ago

You have to start the screen sharing from your phone, miraclecast is waiting for your phone to start that.

zrzhuang commented 2 years ago

my phone has start the screen sharing,keep on searching the sink device always,but can't find the sink device on my phone.in the sink code ,the sink can't receive the probe req event of my phone likely ,and i don't know the reason,hope you answer,and i don't know how to solve this

albfan commented 2 years ago

That implies debug your android device. I strongly suggest to try in a recent ubuntu version.

zrzhuang commented 2 years ago

hi.i have run this code in Raspberry Pi 4B,the system is the Raspbian,my phone can connect the sink,but can't see the mirror screen on the sink device,below is the log Log.tar.gz ;