Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miraclecast as a Peer (Visibility for Other Device) #73

Closed
bpipi opened this issue Mar 28, 2016 · 20 comments
Closed

Miraclecast as a Peer (Visibility for Other Device) #73

bpipi opened this issue Mar 28, 2016 · 20 comments

Comments

@bpipi
Copy link

bpipi commented Mar 28, 2016

Hi,
I want to use miraclecast as a receiver. Means When I search the device in my android device for casting the screen, it has to show the miraclecast device and should connect it wirelessly and mirroring should start. But When I used miracle-sinkctl the miraclecast device is detecting the android device after running run 7 command.
I tried to use it as a peer and used miracle-wifictl command. After this can you please tell me how to enable visibility for other device? I have used psp-scan after miracle-wifictl, but I am getting command not found. Can you please help me with this?

Thanks

@albfan
Copy link
Owner

albfan commented Mar 28, 2016

miracle-sinkctl is not implemented. #47 is another issue related with this. See code hints about what is left unimplemented

Main idea: After two devices create it's own net and one can see other, you need to open an RSTP stream with content of screen.

Implement sink is easy because is the other device which creates the stream, and you only need a "viewer". But reverse is hard because you need to know how other device expect the stream (port, config) and miracast is little obscure at that point.

@bpipi
Copy link
Author

bpipi commented Mar 28, 2016

I need linux system as a viewer where miraclecast will run. I am using android as a source (The screen of which will be mirrored on the linux device). Infact How to implement sink so that my android screen will start mirroring on linux system?

Can you tell me the steps to achieve this?

Thanks

@albfan
Copy link
Owner

albfan commented Mar 28, 2016

Then you have it out of the box. I'm planning a screencast to show the entire process, from build to run.

I will let you know as soon it's avaliable. Meanwhile steps on README.md should be enough.

@bpipi
Copy link
Author

bpipi commented Mar 29, 2016

I have followed the steps present in the README.md but when I run miracle-sinkctl, miraclecast device is detecting the android and android is not detecting the miracst receiver. Actual scenario is android( as a source) should detect the device and linux (miraclecast) as a sink should display the screen of the android.

@bpipi
Copy link
Author

bpipi commented Apr 5, 2016

Hi,
Have you posted the screenshots of the building process? If yes please tell me the place where you have posted it.

Thanks

@albfan
Copy link
Owner

albfan commented Apr 5, 2016

I decide to wait for any progress on #57 to do it, as demo for interaction is better explained with a video. Maybe in a couple of days.

@bpipi
Copy link
Author

bpipi commented Apr 5, 2016

Please paste the output of the miracle-wifid,miracle-sinkctl commands and how to connect the android device to miraclecast device?

@albfan
Copy link
Owner

albfan commented Apr 5, 2016

All is in readme. https://github.com/albfan/miraclecast#documentation

Your problem

miraclecast device is detecting the android and android is not detecting the miracst receiver

shows miraclecast is right configured and working.

I suppose you do a list on miracle-sinkctl and see your device as peer

Explain in detail why your android device don't see miraclecast. Where are you looking for that. On my android devices there's an option "screen mirroring" where I see miraclecast and connect with it.

@bpipi
Copy link
Author

bpipi commented Apr 5, 2016

I am checking with cast-screen option with wireless-display option enabled. I dont have screen-mirroring option in my android device.

Thanks

@albfan
Copy link
Owner

albfan commented Apr 5, 2016

Something like this?:

http://www.trishtech.com/2014/09/cast-android-display-screen-to-other-devices/

I think that is for chromecast only, isn't it?

http://www.pocket-lint.com/news/133437-miracast-explained-how-is-it-different-from-chromecast-and-airplay

I haven't that option on my device, but maybe I can simulate with chromecast app.

http://www.androidcentral.com/how-mirror-your-android-screen-chromecast

Let's see traces and with google add in the middle of miracast standard.

@bpipi
Copy link
Author

bpipi commented Apr 6, 2016

Yes I need like this only. But When I tried cast-screen option with wireless-display option enabled with Piracast on rpi it's working. But still I will try with the screen mirroring option.
And reopen #68 issue.

Thanks

@albfan
Copy link
Owner

albfan commented Apr 6, 2016

Seeing this video:

https://www.youtube.com/watch?v=MmxumFIPxr4

can you post here output from running piracast (i guess ./main &> piracast.log) and output from running miracle-wifid --log-level trace &> wifid.log and miracle-sinkctl --log-level trace &> sink.log? That should be enough to detect the faulty part.

@bpipi
Copy link
Author

bpipi commented Apr 19, 2016

Here I am attaching the piracast.log, wifid.log and sink.log.

Piracast.log

Bring up wlan0 just in case...
Increase rmem_default...
Starting ISC DHCP server: dhcpd.
Waiting for incoming connection...
peer_status: 2
peer_status: 2
peer_status: 2
peer_status: 2
peer_status: 2
peer_status: 22
Discovery request received!
wlan0     No scan results
wlan0     No scan results
wlan0     No scan results
wlan0     Scan completed :
          Cell 01 - Address: 16:F6:5A:F0:45:5D
                    ESSID:"DIRECT-"
                    Protocol:IEEE 802.11g
                    Frequency:2.462 GHz (Channel 11)
                    Encryption key:on
                    Bit Rates:54 Mb/s
                    IE: Unknown: DD7D0050F204104A0001101044000101101200020004103B0001001047001016835D86E6C956DCB8D6887F3C1429CB102100065869616F6D6910230005484D20315310240005484D20315310420008666139336463343310540008000A0050F204000510110008536872696B616E741008000243881049000600372A000120
                    Quality=0/100  Signal level=100/100  
                    Extra:fm=0003
Getting peer device address...
p2p_peer_devaddr_get:
peer_devaddr: 16:F6:5A:F0:45:5D
p2p_wpsinfo:
Getting peer authentication type...
p2p_req_cm_get:
wlan0     p2p_get:
CM=pbc
Confirming peer authentication...
p2p_set_nego:
mac: 16:F6:5A:F0:45:5D
peer_status: 10
Negotiation suceeded!
p2p_role_get:
Role: 3
do_wps:
Selected interface 'wlan0'
OK
wps passed!
read_all_sta:
read_all_sta:
read_all_sta:
read_all_sta:
read_all_sta:
Wireless display negotiation completed!
Source has requested IP!
leased IP:  192.168.2.30
Received 'OPTIONS * RTSP/1.0\r\nCSeq: 0\r\nRequire: org.wfa.wfd1.0\r\n\r\n'
M2 Resp: 'RTSP/1.0 200 OK\r\nCSeq: 2\r\nPublic: org.wfa.wfd1.0, GET_PARAMETER, SET_PARAMETER, SETUP, PLAY, PAUSE, TEARDOWN\r\n\r\n'
M3 Req:
'GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0\r\nCSeq: 1\r\nContent-Length: 127\r\nContent-Type: text/parameters\r\n\r\nwfd_audio_codecs\r\nwfd_video_formats\r\nwfd_coupled_sink\r\nwfd_client_rtp_ports\r\nwfd_standby_resume_capability\r\nwd_initial_buffer\r\n'
M3 Resp:
'RTSP/1.0 200 OK\r\nDate: Sun, 11 Aug 2013 04:41:40 +000\r\nServer: stagefright/1.2 (Linux;Android 4.3)\r\nCSeq: 2\r\nContent-Type: text/parameters\r\nContent-Length: 182\r\n\r\nwfd_video_formats: 39 00 02 02 0001FFFF 3FFFFFFF 00000000 00 0000 0000 00 none none\r\nwfd_audio_codecs: LPCM 00000002 00\r\nwfd_client_rtp_ports: RTP/AVP/UDP;unicast 50000 0 mode=play\r\n'
M4 Req:
'SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0\r\nCSeq: 2\r\nSession: 00000000\r\nContent-Length: 248\r\nContent-Type: text/parameters\r\n\r\nwfd_audio_codecs: LPCM 00000002 00\r\nwfd_video_formats: 00 00 02 02 00000020 00000000 00000000 00 0000 0000 00 none none\r\nwfd_presentation_URL: rtsp://192.168.2.30/wfd1.0/streamid=0 none\r\nwfd_client_rtp_ports: RTP/AVP/UDP;unicast 50000 0 mode=play\r\n'
M4 Resp:
'RTSP/1.0 200 OK\r\nDate: Sun, 11 Aug 2013 04:41:40 +000\r\nServer: stagefright/1.2 (Linux;Android 4.3)\r\nCSeq: 3\r\n\r\n'
M6 Rsp: 'RTSP/1.0 200 OK\r\nCSeq: 4\r\nDate: Thu, Apr 07 2016 04:54:56 GMT\r\nSession: 00000000\r\nTransport: RTP/AVP/UDP;unicast;client_port=50000-50001;server_port=19022-19023\r\n\r\n'
M7 Rsp: 'RTSP/1.0 200 OK\r\nCSeq: 5\r\nDate: Thu, Apr 07 2016 04:54:56 GMT\r\n\r\n'

wifid.log

INFO: miracle-wifid - revision 1.0 Apr 19 2016 08:31:25
WARNING: cannot read hostname from systemd.hostname1: Launch helper exited with unknown return code 1 (manager_read_name() in ../../../src/wifi/wifid.c:373)
DEBUG: link: new link: wlan1 (7) (link_new() in ../../../src/wifi/wifid-link.c:71)
DEBUG: supplicant: new supplicant for wlan1 (supplicant_new() in ../../../src/wifi/wifid-supplicant.c:2082)
INFO: link: add link: wlan1
ERROR: link: invalid arguments (link_set_friendly_name() in ../../../src/wifi/wifid-link.c:190)
INFO: link: manage link wlan1
DEBUG: supplicant: start supplicant of wlan1 (supplicant_start() in ../../../src/wifi/wifid-supplicant.c:2564)
DEBUG: supplicant: spawn supplicant of wlan1 (supplicant_spawn() in ../../../src/wifi/wifid-supplicant.c:2411)
INFO: supplicant: wpas spawned as pid:1150
DEBUG: supplicant: open supplicant of wlan1 (supplicant_open() in ../../../src/wifi/wifid-supplicant.c:2245)
TRACE: wpa: raw message: OK
TRACE: wpa: raw message: p2p_device_address=30:46:9a:35:6d:0a
p2p_state=IDLE
ifname=wlan1
address=30:46:9a:35:6d:0a
WARNING: supplicant: wpa_supplicant does not support wifi-display (supplicant_status_fn() in ../../../src/wifi/wifid-supplicant.c:1768)
DEBUG: supplicant: local p2p-address is: 30:46:9a:35:6d:0a (supplicant_status_fn() in ../../../src/wifi/wifid-supplicant.c:1802)
TRACE: wpa: raw message: OK
TRACE: wpa: raw message: OK
TRACE: wpa: raw message: FAIL
DEBUG: link: link wlan1 started (link_supplicant_started() in ../../../src/wifi/wifid-link.c:277)
DEBUG: supplicant: send 'WFD_SUBELEM_SET 0 000600111c4400c8' to wpas on wlan1 (supplicant_set_wfd_subelements() in ../../../src/wifi/wifid-supplicant.c:1970)
TRACE: wpa: raw message: UNKNOWN COMMAND
DEBUG: supplicant: sent P2P_FIND to wpas on wlan1 (supplicant_p2p_start_scan() in ../../../src/wifi/wifid-supplicant.c:2015)
TRACE: wpa: raw message: OK
DEBUG: supplicant: p2p-scanning now active on wlan1 (supplicant_p2p_find_fn() in ../../../src/wifi/wifid-supplicant.c:1896)
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 0 bc:ee:7b:55:5e:2c
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 1 c0:3f:0e:10:8b:10
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 2 ac:9e:17:e9:e0:74
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 3 c8:60:00:95:0e:48
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 4 ba:c1:a2:19:e1:14
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 5 fa:8f:ca:59:c2:a7
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: <3>P2P-DEVICE-FOUND 16:f6:5a:f0:45:5d p2p_dev_addr=16:f6:5a:f0:45:5d pri_dev_type=10-0050F204-5 name='Shrikant' config_methods=0x188 dev_capab=0x25 group_capab=0x0
DEBUG: peer: new peer: 16:f6:5a:f0:45:5d @ wlan1 (peer_new() in ../../../src/wifi/wifid-peer.c:52)
INFO: peer: add peer: 16:f6:5a:f0:45:5d
DEBUG: peer: peer 16:f6:5a:f0:45:5d @ wlan1 started (peer_supplicant_started() in ../../../src/wifi/wifid-peer.c:162)
DEBUG: supplicant: requesting data for new peer 16:f6:5a:f0:45:5d (supplicant_event_p2p_device_found() in ../../../src/wifi/wifid-supplicant.c:957)
TRACE: wpa: raw message: 16:f6:5a:f0:45:5d
pri_dev_type=10-0050F204-5
device_name=Shrikant
manufacturer=Xiaomi
model_name=HM 1S
model_number=HM 1S
serial_number=fa93dc43
config_methods=0x188
dev_capab=0x25
group_capab=0x0
level=-32
age=0
listen_freq=2462
wps_method=not-ready
interface_addr=00:00:00:00:00:00
member_in_go_dev=00:00:00:00:00:00
member_in_go_iface=00:00:00:00:00:00
go_neg_req_sent=0
go_state=unknown
dialog_token=0
intended_addr=00:00:00:00:00:00
country=IN
oper_freq=0
req_config_methods=0x0
flags=[REPORTED]
status=0
wait_count=0
invitation_reqs=0
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 6 bc:f6:85:fe:75:30
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 7 24:c9:a1:24:48:18
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 8 f4:8e:92:53:88:a1
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 9 24:c9:a1:23:1b:48
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-BSS-ADDED 10 20:55:31:3a:b0:77
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
TRACE: wpa: raw message: IFNAME=wlan1 <3>CTRL-EVENT-SCAN-STARTED 
NOTICE: caught signal 2, exiting..
DEBUG: link: free link: wlan1 (7) (link_free() in ../../../src/wifi/wifid-link.c:115)
INFO: link: link wlan1 no longer managed
DEBUG: supplicant: stop supplicant of wlan1 (supplicant_stop() in ../../../src/wifi/wifid-supplicant.c:2618)
DEBUG: supplicant: close supplicant of wlan1 (supplicant_close() in ../../../src/wifi/wifid-supplicant.c:2286)
DEBUG: peer: peer 16:f6:5a:f0:45:5d @ wlan1 stopped (peer_supplicant_stopped() in ../../../src/wifi/wifid-peer.c:172)
ERROR: dbus: syscall failed (-107): Transport endpoint is not connected (peer_dbus_removed() in ../../../src/wifi/wifid-dbus.c:490)
DEBUG: peer: free peer: 16:f6:5a:f0:45:5d @ wlan1 (peer_free() in ../../../src/wifi/wifid-peer.c:90)
INFO: peer: remove peer: 16:f6:5a:f0:45:5d
DEBUG: link: link wlan1 stopped (link_supplicant_stopped() in ../../../src/wifi/wifid-link.c:287)
ERROR: dbus: syscall failed (-107): Transport endpoint is not connected (link_dbus_removed() in ../../../src/wifi/wifid-dbus.c:766)
INFO: link: remove link: wlan1
DEBUG: supplicant: free supplicant of wlan1 (supplicant_free() in ../../../src/wifi/wifid-supplicant.c:2108)
DEBUG: supplicant: stop supplicant of wlan1 (supplicant_stop() in ../../../src/wifi/wifid-supplicant.c:2618)
DEBUG: supplicant: close supplicant of wlan1 (supplicant_close() in ../../../src/wifi/wifid-supplicant.c:2286)
DEBUG: exiting.. (main() in ../../../src/wifi/wifid.c:569)
Successfully initialized wpa_supplicant
wlan1: CTRL-EVENT-SCAN-STARTED 
wlan1: CTRL-EVENT-SCAN-STARTED 
wlan1: CTRL-EVENT-SCAN-STARTED 
wlan1: CTRL-EVENT-SCAN-STARTED 
P2P-DEVICE-FOUND 16:f6:5a:f0:45:5d p2p_dev_addr=16:f6:5a:f0:45:5d pri_dev_type=10-0050F204-5 name='Shrikant' config_methods=0x188 dev_capab=0x25 group_capab=0x0
wlan1: CTRL-EVENT-SCAN-STARTED 
wlan1: CTRL-EVENT-SCAN-STARTED 
wlan1: CTRL-EVENT-SCAN-STARTED 
CTRL_IFACE: Detach monitor /tmp/.miracle-wpas-1147-1\x00 that cannot receive messages
P2P-FIND-STOPPED 
P2P-DEVICE-LOST p2p_dev_addr=16:f6:5a:f0:45:5d
wlan1: CTRL-EVENT-TERMINATING 

sink.log

root@linaro-alip:/home/linaro# miracle-sinkctl
[ADD] Link: 7             
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     7 wlan1                                         
  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
 0 peers and 1 links listed.
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     7 wlan1                                         
  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
 0 peers and 1 links listed.
[miraclectl] # run 7
now running on link 7
[miraclectl] # link
Command not found
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     7 wlan1                                         
  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     7 16:f6:5a:f0:45:5d@7      Shrikant                       no        
 1 peers and 1 links listed.
[miraclectl] # 

@albfan
Copy link
Owner

albfan commented Apr 19, 2016

cannot read hostname from systemd.hostname1

That tells you have some problem with dbus. Using a dbus client like d-feet you can check if it is enabled.

wpa_supplicant does not support wifi-display

What wpa_supplicant version you have? there're versions not compatible with wifi-direct

@bpipi
Copy link
Author

bpipi commented Apr 21, 2016

I have a netgear N150 wireless usb adaptor (WNA1100). When I test this adaptor with res/test-hardware-capabilities.sh, I am getting 'device supports p2p'. I even tested with iw list command.
So I think device is supporting.

But wat about this line in wifid.log?
ERROR: link: invalid arguments (link_set_friendly_name() in ../../../src/wifi/wifid-link.c:190)

Thanks

@albfan
Copy link
Owner

albfan commented Apr 24, 2016

That means miraclecast couldn't discover interface name with dbus. See my previous response.

Check that service with d-feet.

@albfan albfan closed this as completed Apr 27, 2016
@zwqaoy
Copy link

zwqaoy commented Aug 18, 2016

hi
i have connected the android device with ubuntu wireless, but i don't see the android devices mirroring on the ubuntu PC, what should i do?

the following is connect success log:
[ADD] Peer: ba:64:91:cd:28:77@4
[PROV] Peer: ba:64:91:cd:28:77@4 Type: pbc PIN:
[GO NEG] Peer: ba:64:91:cd:28:77@4 Type: pbc PIN:
[CONNECT] Peer: ba:64:91:cd:28:77@4
now running on peer ba:64:91:cd:28:77@4
NOTICE: SINK connected

thanks.

@albfan
Copy link
Owner

albfan commented Aug 18, 2016

Try to open a new issue, not comment on closed ones and unrelated.

About your problem, are you installing from cmake? There's a problem with file permissions at install. Use this PR to check if that fix the problem (solution is complete but not merged because there is a more standard way to do the same)

#108

To checkout that PR:

$ git fetch origin pull/108/head:cmake-perm
$ git checkout cmake-perm

Better comment there if it works or not.

@zwqaoy
Copy link

zwqaoy commented Aug 18, 2016

yes, the software is installed from cmake, i use the command "vlc rtp://@:1991", and then the ubuntu PC
show my android mirroring by VLC, but the mirroring is not smooth very much and splash
thanks

@albfan
Copy link
Owner

albfan commented Aug 18, 2016

You can attach files directly here on github.

Wait for that pull request to be merged and you will not need to use an external player (like vlc). Experience should be better.

To use PC as source colloborate to implement #4. Manual steps are described there

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants