[HowTo][Flohack's Special][Convergence]Use a simulated miracast sink for testing convergence


  • Infrastructure

    W.I.P. - Work in progress, I could not try this, as my WiFi driver does not support P2P mode

    Motivation
    Many of us do not have either a N5, a slimport adapter or a wifi dongle for Miracast, but want to try out convergence to see if they like it. Fun fact, there is an open-source development called Miraclecast which also provides a sink, i.e. an endpoint for the phone to cast the screen to.

    Preconditions
    Your wireless NIC should support the following modes in order to do P2P communication:

    • P2P-client (Client)
    • P2P-GO (Group owner)
    • P2P-device

    This can be found out by using the iw phy command. Check for supported interface modes in the output when you run the iw phy command. Most of the modern WirelessNICs support this feature. Do not mix it up with the supported frames, the list follows after

        Supported interface modes:
    

    How - Linux

    1. Add the following ppa to your desktop Ubuntu installation: sudo add-apt-repository ppa:thopiekar/miraclecast
    2. Update your package list: sudo apt-get update
    3. Install miraclecast: sudo apt install miraclecast
    4. Stop NetworkManager and wpa supplicant: systemctl stop NetworkManager.service && systemctl stop wpa_supplicant.service
    5. Start the miraclecast daemon: sudo miracle-wifid &
    6. Start the controlling application: sudo miracle-sinkctl
    7. It should report that it has added a link. Start this link by running it with the number of the output in place: run my_number_here
    8. If all goes well you can discover the device from the system settings on your phone, under Brightness & Screen. Enable external displays and then look into wireless displays.

    How - Windows
    Luckily the steps involved with Windows as OS are much less. Basically you can try this with either Windows 8.1 or Windows 10. For Windows 8.1 please try to install the demo version of this software: AirServer Universal. For Windows 10 there is a integrated solution available:

    1. Tap on the Windows-key, type connect, and hit the Enter-key.

    You either get "The device doesn't support Miracast, so you can't project to it wirelessly", or " 'name' is ready for you to connect wirelessly".



  • I followed the guide and wasn't able to connect.

    Tested using UT 15.04 (r3) in a Nexus 5 Hammerhead and in Ubuntu 17.10 in my laptop.

    outcome of iw phy (the relevant proof it supports P2P frames):

            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
    

    The process on the Computer runs smoothly, the problem is when trying to connect to the external display in the options menu. Under Wireless Displays, there is a list of devices which only the computer shows. After clicking it, it stays indefinitely trying to connect. If I leave the menu and return, on the right side of "Choose a display", the blue loading icons stays indefinitely too and does not allow me to try connecting to the computer. If I wait a bit longer, I'm able to try connecting to the device but the same occurs. I also tried leaving the screen on always to see if it returned anything at all and I got Failed to connect to machina. Try again. (my machine name) Tried and got the same result.

    Please let me know what other information you need to try and get this working. It would be a great addition!

    Thanks in advance!


  • Infrastructure

    Hello All,

    just found out I was looking at the wrong capabilities list in iw phy, you need to llok for supported interface modes:

    0_1523775782954_0180e3a8-3918-427c-b32d-22ba1f60a89d-grafik.png

    Like on this screenshot, the P2P entries are missing, so with this network card miracast wont work, unfortunately. It is my second card not having this mode :(

    BR


  • Infrastructure

    @gsilvapt Can you check again, you checked for supported frame types, which is a different capability ;)


  • Infrastructure

    And here a screenshot how it should look like:

    0_1523776869614_81450a77-d0a3-4ac9-bbeb-617f43305b6a-grafik.png



  • what can I expect to happen if it works? I don't have a UT device around just now, so I tried with Android. I get:

    $ sudo miracle-sinkctl 
    [ADD] Link: 3
    [miraclectl] # run 3
    now running on link 3
    [ADD] Peer: b2:72:bf:3b:28:c8@3
    [PROV] Peer: b2:72:bf:3b:28:c8@3 Type: pbc PIN: 
    [GO NEG] Peer: b2:72:bf:3b:28:c8@3 Type: pbc PIN: 
    [CONNECT] Peer: b2:72:bf:3b:28:c8@3
    now running on peer b2:72:bf:3b:28:c8@3
    NOTICE: SINK connected
    SINK set resolution 1920x1080
    

    but other than the console output I never see anything. I was expecting to see the screen of my Android.

    Edit: Ah found something:

    On Laptop:

    • git clone https://github.com/albfan/miraclecast
    • follow the "How - Linux" steps in @Flohack's post above

    On Android:

    • install "Miracast Shorcut" (from fdroid)
    • run it
    • see your laptop show up

    On Laptop:

    • see "SINK connected"
    • open new terminal
    • cd miraclecast/res
    • ./gstplayer
    • see a live stream playing from your Android

    Of course it misses some of the miracle of convergence .... it's just a video, you can't interact with it


  • Infrastructure

    @doniks Cool at least partially this is working. Now we need a proof with UT ;)

    BR


Log in to reply
 

Looks like your connection to UBports Forum was lost, please wait while we try to reconnect.