Giter VIP home page Giter VIP logo

miraclecast's Introduction

MiracleCast - Wifi-Display/Miracast Implementation

Join the chat at https://gitter.im/albfan/miraclecast Semaphore CI Build Status Travis CI Build Status Coverage Status

The MiracleCast project provides software to connect external monitors to your system via Wi-Fi. It is compatible to the Wifi-Display specification also known as Miracast. MiracleCast implements the Display-Source as well as Display-Sink side.

The Display-Source side allows you to connect external displays to your system and stream local content to the device. A lot of effort is put into making this as easy as connecting external displays via HDMI. Note: This is not implemented yet. Please see #4.

On the other hand, the Display-Sink side allows you to create wifi-capable external displays yourself. You can use it on your embedded devices or even on full desktops to allow other systems to use your device as external display.

Requirements

The MiracleCast projects requires the following software to be installed:

  • systemd: A system management daemon. It is used for device-management (udev), dbus management (sd-bus) and service management. Systemd >= 221 will work out of the box. For earlier versions systemd must be compiled with --enable-kdbus, even though kdbus isn't used, but only the independent, experimental sd-libraries. required: >=systemd-213

  • glib: A utility library. Used by the current DHCP implementation. Will be removed once sd-dns gains DHCP-server capabilities. required: ~=glib2-2.38 (might work with older releases, untested..)

  • gstreamer: MiracleCast rely on gstreamer to show cast its output. You can test if all needed is installed launching res/test-viewer.sh

  • wpa_supplicant: MiracleCast spawns wpa_supplicant with a custom config.

  • P2P Wi-Fi device Although widespread these days, there are some devices not compatible with Wi-Fi Direct (prior know as Wi-Fi P2P). Test yours with res/test-hardware-capabilities.sh

  • check: Test-suite for C programs. Used for optional tests of the MiracleCast code base. optional: ~=check-0.9.11 (might work with older releases, untested..)

  • copy the dbus policy res/org.freedesktop.miracle.conf to /etc/dbus-1/system.d/

Build and install

To compile MiracleCast, you can choose from:

See more info on wiki Building

Automatic interface selection with udev

If you want to select the interface to start miraclecast with, add a udev rule with the script res/write-udev-rule.sh and configure miraclecast with

$ ../configure --enable-rely-udev

You can also choose the interface with --interface option for miracle-wifid.

Linux Flavours and general compilation instructions

Ubuntu

Check your systemd version with:

$ systemctl --version

If you are on 221 or above your systemd has kdbus enabled.

If you are below 221, an alternative repo was created to install systemd with dbus

https://github.com/albfan/systemd-ubuntu-with-dbus

See there was interface changes on systemd 219, if you are below that version, use branch systemd-219 to compile miraclecast

See specific instructions on that repo

Arch linux

Use existing AUR package. Remember to enable kdbus to systemd-git dependency if you are below 221 systemd.

$ export _systemd_git_kdbus=--enable-kdbus

You can achieve installation using yaourt

Other flavours

If you feel confidence enough (since systemd is the entrypoint for an OS) extract instructions from arch linux AUR PKGBUILD:

Documentation

Steps to use it as sink

  1. shutdown wpa_supplicant and NetworkManager

    $ systemctl stop NetworkManager.service
    $ systemctl stop wpa_supplicant.service 
    
  2. launch wifi daemon

    $ sudo miracle-wifid &
    
  3. launch sink control (your network card will be detected. here 3)

    $ sudo miracle-sinkctl
    [ADD]  Link: 3
    
  4. run WiFi Display on link:

    > run 3
    
  5. Pair your machine with other miracast device (mirroring)

  6. See your screen device on this machine

Steps to use it as peer

  1. Repeat steps 1 and 2 from "use as sink"

  2. launch wifi control

    $ sudo miracle-wifictl
    
  3. Enable visibility for other devices

  4. Locate them using scanning

    > p2p-scan
    
  5. Apart from list, or show info with peer <mac> there's nothing useful here by now. For a Q&D see Using as peer

UIBC

The User Input Back Channel (UIBC) is an optional WFD feature that when implemented facilitates communication of user inputs to a User Interface, present at the WFD Sink, to the WFD Source.

To use it just add --uibc on miracle-sinkctl startup. Single mouse events and key events are implemented.

Autocompletion

Source res/miraclecast-completion for autocompletion

License

This software is licensed under the terms of the GNU-LGPL license. Please see ./COPYING for further information.

Credits

This software is originally maintained by: David Herrmann [email protected]

This fork is maintained by: Alberto Fanjul [email protected]

If you have any questions, do not hesitate to contact one of the maintainers.

Additional urls

miraclecast's People

Contributors

akhuettel avatar al42and avatar albfan avatar andreygusakov avatar antonioyip avatar arshsingh avatar brlin-tw avatar corny avatar derekdai avatar dzink avatar edwardbetts avatar ericnelsonaz avatar ferrybig avatar gitter-badger avatar grahamwhiteuk avatar hurricos avatar kaijan57 avatar markmuth avatar mcp292 avatar mijoharas avatar nixjdm avatar nxdefiant avatar phomes avatar semarainc avatar socketpair avatar taz03 avatar thopiekar avatar wallacoloo avatar warrenc-juno avatar xliang-lifesize avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

miraclecast's Issues

How to using miraclecast in arch linux

I install a arch linux system to test it.
Follow the steps https://github.com/albfan/miraclecast.

First i test the wifi and environment

iw list:
Supported interface modes:

  • IBSS
  • managed
  • AP
  • AP/VLAN
  • monitor
  • mesh point
  • P2P-client
  • P2P-GO

[root@nbpt res]# ./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

[root@nbpt res]#

I set the res/miracle-wifi.sh with the propriety wifi device name.
I add some lines at the end of res/wpa.conf:
network={
ssid="TP-LINK_6122"
psk="nbpt5200"
}

Then:
res/miracle-wifi.sh
miracle-dhcp --netdev wls35u1(My wifi device name)
miracle-wifid &

[root@nbpt nbpt]# miracle-sinkctl
[ADD] Link: 3
[miraclectl] # list
LINK INTERFACE FRIENDLY-NAME

3 wls35u1 nbpt

LINK PEER-ID FRIENDLY-NAME CONNECTED

0 peers and 1 links listed.
[miraclectl] # run 3
now running on link 3
[miraclectl] # list
LINK INTERFACE FRIENDLY-NAME

3 wls35u1 nbpt

LINK PEER-ID FRIENDLY-NAME CONNECTED

0 peers and 1 links listed.
[ADD] Peer: 6a:76:4f:b4:c2:75@3 (here use my phone to mirror, My pc did recognize my phone)
[miraclectl] # help
Available commands:
list List all objects
show Show detailed object information
run Run sink on given link
bind Like 'run' but bind the link name to run when it is hotplugged
quit Quit program
help Print help
[miraclectl] # show 3
Link=3
InterfaceIndex=3
InterfaceName=wls35u1
FriendlyName=nbpt
P2PScanning=1
WfdSubelements=000600111c4400c8
[miraclectl] # list
LINK INTERFACE FRIENDLY-NAME

3 wls35u1 nbpt

LINK PEER-ID FRIENDLY-NAME CONNECTED
3 6a:76:4f:b4:c2:75@3 Sink-B4C275 no

1 peers and 1 links listed.
[miraclectl] #
[REMOVE] Peer: 6a:76:4f:b4:c2:75@3
[miraclectl] #
But finally my phone(Sony z1) not connected my pc,
Is there some steps should to do?

Device won't connect

I'm not sure what I'm missing, but I can't get my phone to connect. I'm using Ubuntu 15.04 and have installed miraclecast through the linked PPA.

The tests in /res run successfully (test-hardware-capabilities.sh and test-viewer.sh).

As per the setup guide, I run sudo miracle-wifi.sh; sudo miracle-wifid & and then sudo miracle-sinkctl and run 3 inside sinkctl. The computer is then picked up as a peer by my phone.

After attempting a connection from my phone, it's picked up in the sinkctl list and is added as a peer, but it never does anything else, and eventually my phone times out and a few minutes later, is removed as a peer.

I'm not sure what is supposed to happen, is there supposed to be a video popup with the screencast? Do I need to run the miracle-gst.sh script? The GST test script mentioned a vlc stream before I had the GST plugins installed, does that work better?

How do I get from a peered device to a video stream?

Ubuntu 15.04 "wpa_supplicant does not support wifi-display" but "wlan0 supports P2P"

Hi,

I'm trying this and encountered a strange result. When running miracle-wifid, I get this error message:

WARNING: supplicant: wpa_supplicant does not support wifi-display (supplicant_status_fn() in ../../../src/wifi/wifid-supplicant.c:1768)

But when running the test-hardware-capabilities.sh script, I get

wlan0 supports P2P

The result of iw list is

Wiphy phy0
        max # scan SSIDs: 4
        max scan IEs length: 2257 bytes
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports RSN-IBSS.
        Device supports AP-side u-APSD.
        Device supports T-DLS.
        Supported Ciphers:
                * WEP40 (00-0f-ac:1)
                * WEP104 (00-0f-ac:5)
                * TKIP (00-0f-ac:2)
                * CCMP (00-0f-ac:4)
                * CMAC (00-0f-ac:6)
        Available Antennas: TX 0x1 RX 0x3
        Configured Antennas: TX 0x1 RX 0x3
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * WDS
                 * monitor
                 * mesh point
                 * P2P-client
                 * P2P-GO
        Band 1:
                Capabilities: 0x11ce
                        HT20/HT40
                        SM Power Save disabled
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 0-7
                Bitrates (non-HT):
                        * 1.0 Mbps
                        * 2.0 Mbps (short preamble supported)
                        * 5.5 Mbps (short preamble supported)
                        * 11.0 Mbps (short preamble supported)
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
                Frequencies:
                        * 2412 MHz [1] (14.0 dBm)
                        * 2417 MHz [2] (15.0 dBm)
                        * 2422 MHz [3] (15.0 dBm)
                        * 2427 MHz [4] (15.0 dBm)
                        * 2432 MHz [5] (15.0 dBm)
                        * 2437 MHz [6] (15.0 dBm)
                        * 2442 MHz [7] (15.0 dBm)
                        * 2447 MHz [8] (15.0 dBm)
                        * 2452 MHz [9] (15.0 dBm)
                        * 2457 MHz [10] (15.0 dBm)
                        * 2462 MHz [11] (15.0 dBm)
                        * 2467 MHz [12] (15.0 dBm) (no IR)
                        * 2472 MHz [13] (14.0 dBm) (no IR)
                        * 2484 MHz [14] (17.0 dBm) (no IR)
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * start_ap
                 * new_station
                 * new_mpath
                 * set_mesh_config
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * join_mesh
                 * remain_on_channel
                 * set_tx_bitrate_mask
                 * frame
                 * frame_wait_cancel
                 * set_wiphy_netns
                 * set_channel
                 * set_wds_peer
                 * tdls_mgmt
                 * tdls_oper
                 * probe_client
                 * set_noack_map
                 * register_beacons
                 * start_p2p_device
                 * set_mcast_rate
                 * channel_switch
                 * Unknown command (104)
                 * connect
                 * disconnect
        Supported TX frame types:
                 * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * mesh point: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
                 * P2P-device: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
        Supported RX frame types:
                 * IBSS: 0x40 0xb0 0xc0 0xd0
                 * managed: 0x40 0xd0
                 * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * mesh point: 0xb0 0xc0 0xd0
                 * P2P-client: 0x40 0xd0
                 * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
                 * P2P-device: 0x40 0xd0
        software interface modes (can always be added):
                 * AP/VLAN
                 * monitor
        valid interface combinations:
                 * #{ managed } <= 2048, #{ AP, mesh point } <= 8, #{ P2P-client, P2P-GO } <= 1,
                   total <= 2048, #channels <= 1, STA/AP BI must match
                 * #{ WDS } <= 2048,
                   total <= 2048, #channels <= 1, STA/AP BI must match
        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        Device supports TX status socket option.
        Device supports HT-IBSS.
        Device supports SAE with AUTHENTICATE command
        Device supports low priority scan.
        Device supports scan flush.
        Device supports AP scan.
        Device supports per-vif TX power setting
        P2P GO supports CT window setting
        Driver supports a userspace MPM
        Device supports active monitor (which will ACK incoming frames)
        Driver/device bandwidth changes during BSS lifetime (AP/GO mode)

I'm using your custom systemd with dbus and compiled the latest master (commit 30b8c2d).

Do you know where it is wrong?

short tutorial

Add a screencast to show current features of miraclecast

miracle-wifid ERROR

Hi Alberto,
when I execute

$ sudo ./miracle-wifid --wpa-bindir /usr/sbin

I get the next output error:

ERROR: supplicant: cannot attach to global wpas interface of wlp0s29u1u5 (supplicant_global_attach_fn() in /home/fmoya/development/miraclecast/src/wifi/wifid-supplicant.c:2163)
ERROR: supplicant: wpas (pid:23579) failed unexpectedly, relaunching after short grace period.. (supplicant_failed() in /home/fmoya/development/miraclecast/src/wifi/wifid-supplicant.c:2287)

I have pass correctly all the test (miraclecast/test).

If I execute "rest/./test-wifi-capabilities.sh" I have the next result:

wlp0s29u1u5 supports P2P

When I execute "res/miracle-wifi.sh" I have the next output:

killing existing wpa_supplicant connection
starting wpa_supplicant for miraclecast on wlp0s29u1u5
wpa_supplicant v2.0
random: Trying to read entropy from /dev/random
dbus: Register D-Bus object '/fi/w1/wpa_supplicant1'
Providing DBus service 'fi.w1.wpa_supplicant1'.
Providing DBus service 'fi.epitest.hostap.WPASupplicant'.
Successfully initialized wpa_supplicant
Initializing interface 'wlp0s29u1u5' conf './wpa.conf' driver 'nl80211' ctrl_interface 'N/A' bridge 'N/A'
Configuration file './wpa.conf' -> '/home/fmoya/development/miraclecast/res/./wpa.conf'
Reading configuration file '/home/fmoya/development/miraclecast/res/./wpa.conf'
ctrl_interface='/run/wpa_supplicant'
ap_scan=1
device_name='wlp0s29u1u5'
config_methods='pbc'
nl80211: interface wlp0s29u1u5 in phy phy0
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
nl80211: Set mode ifindex 4 iftype 2 (STATION)
nl80211: Subscribe to mgmt frames with non-AP handle 0x7f87a94091b0
nl80211: Register frame type=0xd0 nl_handle=0x7f87a94091b0
nl80211: Register frame match - hexdump(len=2): 04 0a
nl80211: Register frame type=0xd0 nl_handle=0x7f87a94091b0
nl80211: Register frame match - hexdump(len=2): 04 0b
nl80211: Register frame type=0xd0 nl_handle=0x7f87a94091b0
nl80211: Register frame match - hexdump(len=2): 04 0c
nl80211: Register frame type=0xd0 nl_handle=0x7f87a94091b0
nl80211: Register frame match - hexdump(len=2): 04 0d
nl80211: Register frame type=0xd0 nl_handle=0x7f87a94091b0
nl80211: Register frame match - hexdump(len=6): 04 09 50 6f 9a 09
nl80211: Register frame type=0xd0 nl_handle=0x7f87a94091b0
nl80211: Register frame match - hexdump(len=5): 7f 50 6f 9a 09
nl80211: Register frame type=0xd0 nl_handle=0x7f87a94091b0
nl80211: Register frame match - hexdump(len=1): 06
nl80211: Register frame type=0xd0 nl_handle=0x7f87a94091b0
nl80211: Register frame match - hexdump(len=2): 0a 07
nl80211: Register frame type=0xd0 nl_handle=0x7f87a94091b0
nl80211: Register frame match - hexdump(len=2): 0a 11
netlink: Operstate: linkmode=1, operstate=5
nl80211: Using driver-based off-channel TX
nl80211: driver param='(null)'
nl80211: Regulatory information - country=ES
nl80211: 2400-2483 @ 40 MHz
nl80211: 5150-5250 @ 80 MHz
nl80211: 5250-5350 @ 80 MHz
nl80211: 5470-5725 @ 80 MHz
nl80211: 57240-65880 @ 2160 MHz
nl80211: Added 802.11b mode based on 802.11g information
wlp0s29u1u5: Own MAC address: 08:86:3b:69:c6:0c
wpa_driver_nl80211_set_key: ifindex=4 alg=0 addr=(nil) key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 alg=0 addr=(nil) key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 alg=0 addr=(nil) key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_nl80211_set_key: ifindex=4 alg=0 addr=(nil) key_idx=3 set_tx=0 seq_len=0 key_len=0
wlp0s29u1u5: RSN: flushing PMKID list in the driver
nl80211: Flush PMKIDs
wlp0s29u1u5: State: DISCONNECTED -> INACTIVE
WPS: Set UUID for interface wlp0s29u1u5
WPS: UUID based on MAC address - hexdump(len=16): 5e 7c e5 f3 ee 5c 5e c6 a2 3a 6c 52 38 e5 85 ce
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: Supplicant port status: Unauthorized
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
EAPOL: Supplicant port status: Unauthorized
EAPOL: Supplicant port status: Unauthorized
Using existing control interface directory.
ctrl_iface bind(PF_UNIX) failed: Address already in use
ctrl_iface exists, but does not allow connections - assuming it was leftover from forced program termination
Successfully replaced leftover ctrl_iface socket '/run/wpa_supplicant/wlp0s29u1u5'
P2P: Own listen channel: 1
P2P: Random operating channel: 81:11
P2P: Add operating class 81
P2P: Channels - hexdump(len=11): 01 02 03 04 05 06 07 08 09 0a 0b
dbus: Register interface object '/fi/w1/wpa_supplicant1/Interfaces/1'
wlp0s29u1u5: Added interface wlp0s29u1u5
wlp0s29u1u5: State: INACTIVE -> DISCONNECTED
wpa_driver_nl80211_set_operstate: operstate 0->0 (DORMANT)
netlink: Operstate: linkmode=-1, operstate=5
Daemonize..

Do you know where is the problem, or what I'm doing wrong?

Thanks.

move instructions to wiki

README.md is becoming huge. Lot of its information is valuable but all at same time becomes messy.

Move to different pages:

  • compile and install instructions
  • usage instructions

p2p_group_formation_failure

Hi,

I'm trying to run miraclecast on Ubuntu 15.04 server with miraclecast+dbus ppa. I've no normal wifi connection configured (use wired one) so i don't kill wpa_supplicant on start (it's not running). I simply run "miracle-wifid --wpa-bindir /sbin" and then miracle-sinkctl. My card has P2P capabilities (Realtek RTL8821AE). On tablet I'can scan and see my server, choose it to connect but connection fails.

I guess that problem is with "supplicant_event_p2p_group_formation_failure".

Here is my log:

miracle-wifid --wpa-bindir /sbin --log-time --log-level 100

[0000.000004] INFO: miracle-wifid - revision some-rev-TODO-xyz Apr 29 2015 23:35:15
[0000.063930] DEBUG: friendly-name from local hostname: bee (manager_read_name() in wifid.c:355)
[0000.066291] DEBUG: link: new link: wlan0 (3) (link_new() in wifid-link.c:71)
[0000.066325] DEBUG: supplicant: new supplicant for wlan0 (supplicant_new() in wifid-supplicant.c:2062)
[0000.066339] INFO: link: add link: wlan0
[0000.066351] INFO: link: manage link wlan0
[0000.066361] DEBUG: supplicant: start supplicant of wlan0 (supplicant_start() in wifid-supplicant.c:2543)
[0000.066459] DEBUG: supplicant: spawn supplicant of wlan0 (supplicant_spawn() in wifid-supplicant.c:2391)
[0000.066745] INFO: supplicant: wpas spawned as pid:1411
[0000.413442] DEBUG: supplicant: open supplicant of wlan0 (supplicant_open() in wifid-supplicant.c:2225)
[0000.414566] DEBUG: supplicant: local p2p-address is: 4c:bb:58:bc:30:b5 (supplicant_status_fn() in wifid-supplicant.c:1782)
[0000.415322] DEBUG: link: link wlan0 started (link_supplicant_started() in wifid-link.c:277)
[0021.134018] DEBUG: supplicant: send 'WFD_SUBELEM_SET 0 000600111c4400c8' to wpas on wlan0 (supplicant_set_wfd_subelements() in wifid-supplicant.c:1950)
[0021.136809] DEBUG: supplicant: sent P2P_FIND to wpas on wlan0 (supplicant_p2p_start_scan() in wifid-supplicant.c:1995)
[0021.138209] DEBUG: supplicant: p2p-scanning now active on wlan0 (supplicant_p2p_find_fn() in wifid-supplicant.c:1876)
[0048.289149] DEBUG: peer: new peer: 11:22:33:44:55:66 @ wlan0 (peer_new() in wifid-peer.c:52)
[0048.289736] INFO: peer: add peer: 11:22:33:44:55:66
[0048.289816] DEBUG: peer: peer 11:22:33:44:55:66 @ wlan0 started (peer_supplicant_started() in wifid-peer.c:162)
[0048.291458] DEBUG: supplicant: requesting data for new peer 11:22:33:44:55:66 (supplicant_event_p2p_device_found() in wifid-supplicant.c:950)
[0048.871295] DEBUG: supplicant: GO Negotiation Request from 11:22:33:44:55:66 (supplicant_event_p2p_go_neg_request() in wifid-supplicant.c:1053)
[0048.875874] DEBUG: supplicant: connect to 11:22:33:44:55:66 via pbc/(null) (supplicant_peer_connect() in wifid-supplicant.c:734)
[0048.877551] DEBUG: supplicant: p2p-scanning stopped on wlan0 (supplicant_event_p2p_find_stopped() in wifid-supplicant.c:892)
[0049.891545] DEBUG: supplicant: set STA-MAC for 11:22:33:44:55:66 from  to 52:55:27:e4:fe:52 (via GO-NEG-SUCCESS) (supplicant_event_p2p_go_neg_success() in wifid-supplicant.c:1183)
[0065.115627] DEBUG: supplicant: peer Lager connection failed (supplicant_event_p2p_group_formation_failure() in wifid-supplicant.c:1288)
[0065.115834] DEBUG: supplicant: stray P2P-GROUP-REMOVED: <3>P2P-GROUP-REMOVED wlan0 GO reason=FORMATION_FAILED (supplicant_event_p2p_group_removed() in wifid-supplicant.c:1270)
[0065.118803] DEBUG: supplicant: unhandled wpas-event: <3>AP-DISABLED  (supplicant_event() in wifid-supplicant.c:1458)
[0065.121779] DEBUG: supplicant: sent P2P_FIND to wpas on wlan0 (supplicant_p2p_start_scan() in wifid-supplicant.c:1995)
[0065.138621] DEBUG: supplicant: p2p-scanning now active on wlan0 (supplicant_p2p_find_fn() in wifid-supplicant.c:1876)
[0120.357737] DEBUG: supplicant: lost peer 11:22:33:44:55:66 (supplicant_event_p2p_device_lost() in wifid-supplicant.c:974)
[0120.358135] DEBUG: peer: peer 11:22:33:44:55:66 @ wlan0 stopped (peer_supplicant_stopped() in wifid-peer.c:172)
[0120.359683] DEBUG: peer: free peer: 11:22:33:44:55:66 @ wlan0 (peer_free() in wifid-peer.c:90)
[0120.360228] INFO: peer: remove peer: 11:22:33:44:55:66

---

sudo miracle-sinkctl
[ADD] Link: 3
[miraclectl] # run 3
now running on link 3
[ADD] Peer: 11:22:33:44:55:66@3
[PROV] Peer: 11:22:33:44:55:66@3 Type: pbc PIN: 
[GO NEG] Peer: 11:22:33:44:55:66@3 Type: pbc PIN: 
[FAIL] Peer: 11:22:33:44:55:66@3 Reason: unknown
no longer waiting for peer Lager (11:22:33:44:55:66@3)
[REMOVE] Peer: 11:22:33:44:55:66@3
[miraclectl] # 

wpa_supplicant binary not found

While trying to start miracle-wifid I got this:

$ sudo miracle-wifid &
[1] 2912
ERROR: supplicant: execution of wpas (/usr/bin/wpa_supplicant) not possible: No such file or directory (supplicant_spawn() in wifid-supplicant.c:2398)
ERROR: link: cannot start supplicant on wlan0 (link_set_managed() in wifid-link.c:149)

while wpa_supplicant is located at:

$ which wpa_supplicant 
/sbin/wpa_supplicant

different number for interface on miracle-sinkctl

I get to the step 4 of the usage guide:

  1. launch sink control (your network card will be detected. here 3)

     $ sudo miracle-sinkctl
     [ADD]  Link: 3
    

however, my result is

$ sudo miracle-sinkctl
[ADD]  Link: 7

is there something wrong ? what this num meaning?

miracle-sinkctl: LINK is not added

Running the miracle-sinkclt binary does not add a link as shown in the documentation:

[bob@leapfrog ~]$ sudo miracle-sinkctl
[miraclectl] # list
LINK INTERFACE FRIENDLY-NAME

LINK PEER-ID FRIENDLY-NAME CONNECTED

0 peers and 0 links listed.
[miraclectl] #

Monitoring the systemd system bus shows an empty array being returned after the miracle-sinkctl binary is executed:

 method return sender=:1.97 -> dest=:1.100 reply_serial=5
   array [
      dict entry(
         object path "/org/freedesktop/miracle/wifi"
         array [
            dict entry(
               string "org.freedesktop.miracle.wifi.Manager"
               array [
               ]
            )
         ]
      )
   ]

Any idea why the link is not being added?

More details on failed tests

While building miraclecast on launchpad.net for Ubuntu I get this:

Making check in test
make[2]: Entering directory '/build/buildd/miraclecast-0.0.0~rev123~pkg11~201503241015~ubuntu15.04.1/test'
make --no-print-directory test_rtsp test_wpas test_valgrind
  CC       test_rtsp-test_rtsp.o
  CCLD     test_rtsp
  CC       test_wpas-test_wpas.o
  CCLD     test_wpas
  CC       test_valgrind-test_valgrind.o
  CCLD     test_valgrind
make --no-print-directory check-TESTS
FAIL: test_rtsp
PASS: test_wpas
PASS: test_valgrind
make[5]: Nothing to be done for 'all'.
============================================================================
Testsuite summary for miracle 1
============================================================================
# TOTAL: 3
# PASS:  2
# SKIP:  0
# XFAIL: 0
# FAIL:  1
# XPASS: 0
# ERROR: 0
============================================================================
See test/test-suite.log
Please report to http://www.freedesktop.org/wiki/Software/miracle
============================================================================
Makefile:765: recipe for target 'test-suite.log' failed
make[4]: *** [test-suite.log] Error 1

I think it would be more useful if more info could be provided.

can not connect

Hi Alberto,

I have all installed and running in a ubuntu15.04 machine.

The netcard we use is RTL8188, and we started the wpa in RTL8188 with ./wpa_supplicant -i wlan0 -Dwext -c wpa.conf ,then miracle-wifid & and returns a value, the next miracle-sinkctl and only shows [miraclectl] #. my device can't find and connect.
Does miraclecast have logs? where is the log? How can I see the logs?What can I do to find what is wrong?

Thanks again.

support for 1:n connections

When I use a ubuntu PC as GO ,and then a samsung phone connect to it sucessfuly , but when I try to use another phone more to connect the PC , failed ,log as follows:

[ADD] Peer: d2:22:be:dd:ba:fb@20 
[PROV] Peer: d2:22:be:dd:ba:fb@20 Type: pbc PIN: 

no more others.

and the normal process should be as:

[GO NEG] Peer: d2:22:be:dd:ba:fb@20 Type: pbc PIN: 
[ADD] Peer: d2:22:be:dd:ba:fb@20 
[PROV] Peer: d2:22:be:dd:ba:fb@20 Type: pbc PIN: 
[CONNECT] Peer: d2:22:be:dd:ba:fb@20

Does miraclecast not support 1:n now?

Can you give me any suggestions?

Isolate from systemd

In theory, there is no need for systemd on miraclecast. Just some compile (but not runtime) dependencies

That will allow to install in non systemd OS

miraclecast as source

From #47 (comment)
Here is a Q&D (quick and dirty) for use laptop as source:

Start miracle-wifid as usual

$ sudo miracle-wifid --log-level trace

Start miracle-wifictl

$ sudo miracle-wifictl --log-level trace
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     3 wlp3s0                   archlinux-alberto             

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 

 0 peers and 1 links listed.
[miraclectl] # select 3
link 3 selected

Now do something to make your device visible (like start screen mirroring)

[ADD] Peer: f2:27:65:35:b6:8f@3
[PROV] Peer: ff:ff:ff:ff:ff:ff@3 Type: pbc PIN: 
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     3 wlp3s0                   archlinux-alberto             

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 ff:ff:ff:ff:ff:ff@3           Alberto Fanjul Alonso            no        

 1 peers and 1 links listed.
[miraclectl] # connect ff:ff:ff:ff:ff:ff@3
[CONNECT] Peer: ff:ff:ff:ff:ff:ff@3
[miraclectl] # list
  LINK INTERFACE                FRIENDLY-NAME                 
     3 wlp3s0                   archlinux-alberto             

  LINK PEER-ID                  FRIENDLY-NAME                  CONNECTED 
     3 ff:ff:ff:ff:ff:ff@3           Alberto Fanjul Alonso            yes        

 1 peers and 1 links listed.

Search on miracle-wifid output for a message like this

TRACE: wpa: raw message: <3>P2P-GROUP-STARTED p2p-wlp3s0-3 client ssid="DIRECT-ZP-Alberto Fanjul Alonso" freq=2462 psk=5d3ce6a19876398db2d9b7566cc1d8e3a87c36b449ff3fd601f95d60718cdd4e go_dev_addr=ff:ff:ff:ff5:ff:ff ip_addr=192.168.49.200 ip_mask=255.255.255.0 go_ip_addr=192.168.49.1

At this point you have your devices paired show they can see each other

Start a stream on laptop (using vlc for example)

$ cvlc screen:// :screen-fps=25 :screen-caching=100 --sout '#transcode{vcodec=MJPG,vb=0,width=1022,height=575,acodec=none}:http{mux=ogg,dst=:8554/myscreen}'

On the other device use some viewer to reproduce that:( I've used vlc for android)

that stream can be viewed opening url: http://192.168.49.200:8554/myscreen

Develops needed:

  1. autocomplete peer-id on miracle-wifictl
  2. miracle-sinkctl need a command to launch automatically that external command (miracle-sinkctl does the same with gstreamer)
  3. provide a gstreamer command to stream screen (See examples here https://coderwall.com/p/_inesq/gstreamer-commands-for-desktop-streaming-to-raspberry-pi)
  4. Develop an android app based on vlc for android to make device visible, pair with laptop and receive config from miracle-sinkctl about url to open

Could not read interface -Dnl80211 flags: No such device

I'm trying to run the miracle-wifi.sh script, but I'm getting this error:

➜  res git:(master) sudo ./miracle-wifi.sh 
cannot find wpa_supplicant connection to kill
starting wpa_supplicant for miraclecast on
wpa_supplicant v2.3
dbus: Register D-Bus object '/fi/w1/wpa_supplicant1'
Providing DBus service 'fi.w1.wpa_supplicant1'.
Providing DBus service 'fi.epitest.hostap.WPASupplicant'.
Successfully initialized wpa_supplicant
Initializing interface '-Dnl80211' conf './wpa.conf' driver 'default' ctrl_interface 'N/A' bridge 'N/A'
Configuration file './wpa.conf' -> '/tmp/miraclecast/res/./wpa.conf'
Reading configuration file '/tmp/miraclecast/res/./wpa.conf'
ctrl_interface='/run/wpa_supplicant'
ap_scan=1
device_name='my-device'
config_methods='pbc'
rfkill: initial event: idx=0 type=1 op=0 soft=0 hard=0
rfkill: initial event: idx=1 type=2 op=0 soft=0 hard=0
Could not read interface -Dnl80211 flags: No such device
nl80211: Driver does not support authentication/association or connect commands
nl80211: Remove monitor interface: refcount=0
netlink: Operstate: ifindex=0 linkmode=0 (kernel-control), operstate=6 (IF_OPER_UP)
Could not read interface -Dnl80211 flags: No such device
nl80211: Set mode ifindex 0 iftype 2 (STATION)
nl80211: Failed to set interface 0 to mode 2: -19 (No such device)
-Dnl80211: Failed to initialize driver interface
Failed to add interface -Dnl80211
-Dnl80211: Cancelling scan request
-Dnl80211: Cancelling authentication timeout
dbus: Unregister D-Bus object '/fi/w1/wpa_supplicant1'

The test says my hardware is compatible:

➜  res git:(master) ./test-wifi-capabilities.sh 
wlp2s0 supports P2P

Choose device from command line

Add --interface, -i option to choose device by name

These must allow to launch miraclecast on one interface and access internet through other

Missing sd-event.h on Debian testing

Hi!
I'm trying to compile on Debian testing, and I'm getting the following error:

[ 3%] Building C object src/shared/CMakeFiles/miracle-shared.dir/rtsp.c.o
/home/andrei/tmp/miraclecast/src/shared/rtsp.c:31:30: fatal error: systemd/sd-event.h: No such file or directory
#include <systemd/sd-event.h>
^
compilation terminated.

Debian Testing already has systemd and libdbus, though I can't find this specific header in any packages..
Should I follow the same instructions as for Ubuntu and replace systemd with the one compiled from here (https://github.com/albfan/systemd-ubuntu-with-dbus), or is there a less-painful workaround?

I have systemd v. 215-17 and dbus/libdbus v1.8.16-1

Thanks!

Mirroring laptop screen on samsung smart tv

I have a Samsung smart tv which is miracast enabled. Now how can I cast my ubuntu screen to the tv? In other words, how can I use my laptop as source and the tv as sink?

Can not do mirroring

Hi Alberto,

I have all installed and running in a CentOS 7 machine.

I view my machine in my android device, but when I try to send my display, my device says "Connecting" but after a few seconds it disconnect and then show again my machine with miraclecast.

Miraclecast have logs? where is the log? What can I do to find what is wrong?
My wifi device has no IP when I run miraclecast, is that normal?
When I run "sudo ./miracle-sinkctl" and then "run 3" the binary ends, is that normal?

Thanks again.

configure project through autotools

Avoid these:

using

AC_ARG_ENABLE([rely-udev],
          AS_HELP_STRING([--enable-rely-udev], [Use tagged device with miraclecast]), AC_DEFINE([RELY_UDEV], [], [Rely on udev to find miraclecast device]))
AC_ARG_ENABLE([log-debug],
              AS_HELP_STRING([--disable-log-debug], [Disable log debug]), , AC_DEFINE([BUILD_LOG_DEBUG], [], [Enable debug log level]))

SIGSEGV in miracle-sinkctl on peer connect

Hi,
after a lot of trail and error I finally got miracle-cast working (at least my phone is able to discover the sink). The problem occurs as soon as I try to start mirroring my phone screen. miracle-sinkctl crashes with a segmentation fault instantly.

My current setup:
Ubuntu 15.04 (amd64)
wpa_supplicant (2.4; build from source since 2.1 results in 'wifi-direct not supported')
miracle-cast (build from source; master branch)

I have been able to track down the problem at least a bit:

The SIGSEGV is raised by sd_bus_message_is_signal() in ctl-wifi.c

The first two lines of gdb's backtrace look like:

0 0x0007ffff7946c7 in sd_bus_message_is_signal() from /lib/x86_64-.../libsystemd.so.0
1 0x00000000406bfa in ctl_wifi_properties_fn(m=0x617010, data=0x63b530, err=<optimized out>)

I also looked up the source of sd_bus_message_is_signal which (at least according to this) already checks if the message struct pointers (interface and member) are valid. Only m->header is not checked. So I assume this one is to blame.

Cheers,
Patrick

lipcap dependency

I download the file on my ubuntu , and when i try

# ./configure 

it happened a error like this:

configure: error: *** POSIX caps headers not found

The best suitable Linux distro for testing miraclecast

I am very interesting in this project.
For building dependencies, I have built glib and systemd with --enable-kdbus on CentOS 7.
After building the sources successfully, I installed the outputs and reboot system.
Then, system can't boot up normally. I think this failure is caused by systemd.

What's the suitable Linux OS for testing ???

Local helper are not distribution-independent

While looking at

thopiekar@hp:/usr/share/miraclecast$ cat miracle-wifi.sh 
./kill-wpa.sh

echo starting wpa_supplicant for miraclecast
sudo wpa_supplicant -dd -B -iwlp3s0 -Dnl80211 -c wpa.conf

I noticed that these scripts won't work on Ubuntu, as the first wifi-adapter is not called wlp3s0. After all the patches on Ubuntu's systemd it won't rename the network-devices and leave wlan0 as it is.

config wpa_supplicant

Which changes need to be made in the wpa.conf?
Should the network entry be a new network? Or could it be an existing network, e.g. from another AP. Both my phone and my computer are already connected to this existing network. I want the miraclecast sink (running on the computer) on the same network. In this case, I do not even need any pbc/display/keypad configuration, do it? What would I put into wpa.conf?

SIGCHLD starting miracle-wifid

sudo miracle-wifid --wpa-bindir /sbin --log-level 8 &
[1] 25868
adi@adi:~/miraclecast/res$ 
INFO: miracle-wifid - revision some-rev-TODO-xyz Apr 29 2015 23:35:15
DEBUG: friendly-name from local hostname: adi (manager_read_name() in wifid.c:355)
DEBUG: link: new link: wlan0 (3) (link_new() in wifid-link.c:71)
DEBUG: supplicant: new supplicant for wlan0 (supplicant_new() in wifid-supplicant.c:2062)
INFO: link: add link: wlan0
INFO: link: manage link wlan0
DEBUG: supplicant: start supplicant of wlan0 (supplicant_start() in wifid-supplicant.c:2543)
DEBUG: supplicant: spawn supplicant of wlan0 (supplicant_spawn() in wifid-supplicant.c:2391)
INFO: supplicant: wpas spawned as pid:25871
ERROR: supplicant: wpas (pid:25871) failed unexpectedly, relaunching after short grace period.. (supplicant_failed() in wifid-supplicant.c:2287)
DEBUG: supplicant: terminating wpas (pid:25871) (supplicant_failed() in wifid-supplicant.c:2302)
DEBUG: supplicant: close supplicant of wlan0 (supplicant_close() in wifid-supplicant.c:2266)
DEBUG: caught SIGCHLD for 25871, reaping child (manager_signal_fn() in wifid.c:163)

config by udev

Remove DO_NOT_RELY_UDEV flag and add an option to rely on udev

This is based on tagged devices by udev. Create an script to "mark" device

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.