UBports Robot Logo UBports Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    [HowTo][Convergence]Use a simulated miracast sink for testing convergence

    Scheduled Pinned Locked Moved Support
    flo hacks
    27 Posts 9 Posters 10.3k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
      Reply
      • Reply as topic
      Log in to reply
      This topic has been deleted. Only users with topic management privileges can see it.
      • flohackF Offline
        flohack
        last edited by flohack

        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".

        My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

        ierihonI 1 Reply Last reply Reply Quote 7
        • gsilvaptG Offline
          gsilvapt
          last edited by

          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!

          flohackF 1 Reply Last reply Reply Quote 0
          • flohackF Offline
            flohack
            last edited by

            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

            My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

            1 Reply Last reply Reply Quote 0
            • flohackF Offline
              flohack @gsilvapt
              last edited by

              @gsilvapt Can you check again, you checked for supported frame types, which is a different capability πŸ˜‰

              My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

              1 Reply Last reply Reply Quote 1
              • flohackF Offline
                flohack
                last edited by

                And here a screenshot how it should look like:

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

                My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                1 Reply Last reply Reply Quote 2
                • D Offline
                  doniks
                  last edited by doniks

                  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

                  flohackF 1 Reply Last reply Reply Quote 0
                  • flohackF Offline
                    flohack @doniks
                    last edited by

                    @doniks Cool at least partially this is working. Now we need a proof with UT πŸ˜‰

                    BR

                    My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                    1 Reply Last reply Reply Quote 0
                    • joniusJ Offline
                      jonius
                      last edited by

                      I have a FP2 with UT 16.04. But there are no external displays shown in that menu. But how would the phone find the notebook anyways? The stopping the network manager that wifi connections gets lost.

                      joniusJ flohackF 2 Replies Last reply Reply Quote 0
                      • joniusJ Offline
                        jonius @jonius
                        last edited by

                        @jonius said in [HowTo][Convergence]Use a simulated miracast sink for testing convergence:

                        I have a FP2 with UT 16.04. But there are no external displays shown in that menu. But how would the phone find the notebook anyways? When stopping the network manager the wifi connections gets lost.

                        In the miraclectl shell I got the print "[ADD] Peer: <some Mac address>@2" and later a "[REMOVE] ..." message.

                        1 Reply Last reply Reply Quote 0
                        • flohackF Offline
                          flohack @jonius
                          last edited by

                          @jonius Hello,

                          yes the loss of network connections is intentional. Miracast needs P2P mode on the WiFi card which means its not allowed to be associated with any other network. This is why you need to check first if your card even supports that.

                          I did not try this myself as I do not own a PC which has such a card. Therefore I am waiting for people who are able to follow the instructions. Seems you were not able, meh. Sounded too good to be true πŸ˜‰

                          BR

                          My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                          1 Reply Last reply Reply Quote 0
                          • joniusJ Offline
                            jonius
                            last edited by

                            I have checked that and it shows the three modes you named above. But how is my FP2 supposed to find the computer, if it is not connected to my local network anymore? Do I need to search for some kind of miraclecast wifi opened by the netbook?

                            flohackF 1 Reply Last reply Reply Quote 0
                            • flohackF Offline
                              flohack @jonius
                              last edited by

                              @jonius Hello,

                              P2P mode should be configured so that FP2 finds any display device announcing itself. Its a special form of AdHoc mode. So nothing needs to be done, in theory. Seems in practice its not so easy...

                              BR

                              My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                doniks
                                last edited by

                                @Flohack Ok, now I have UT running on my Nexus 7 and my laptop has this required mode, but I can't figure it out still.

                                Firstly, on UT, the "External display" is greyed out and I can't toggle the switch. The switch is on the left.

                                However, in the terminal I can enter aethercastctl [1] and do enable, which actually changes the switch in the settings to on-the-right. Also in aethercastctl I get a confirmation that it is Enabled: true, I can also scan which gives me a Scanning: true. After a while this times out and noting else happens.

                                But, in general, I'm not getting how this is supposed to go together. aethercast seems to be happily scanning while connected to regular wifi. I can repeat my test with the Android, trying to cast UT to Android. In that case aethercast actually finds the android when after a scan I can also progress a few steps with connect - the android phone bleeps and shows some kind of connection dialog, aethercast tells me it is now in State: connected. Well, I don't actually see the UT display on the android phone, so something is failing after all. But what this tells me is that aethercast (UT) might actually want to connect (and stream?) via regular wifi and not via some special "direct" mode. Is it the difference between a) what we transport, ie, the display, versus b) how we transport it, ie, either wlan or wifi direct? And maybe miraclecast expects a) display data over b) wifi direct, and while UT happily sends a) display data, it sends it over b) regular wifi ....

                                [1] https://wiki.ubuntu.com/Touch/DisplayCasting

                                1 Reply Last reply Reply Quote 1
                                • flohackF Offline
                                  flohack
                                  last edited by

                                  Thanks for your findings. It seems we need much more here, too sad it does not work out of box.

                                  BR

                                  My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                                  D 1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    doniks @flohack
                                    last edited by

                                    modules:composer.user_said_in, @flohack, &#91;HowTo&#93;&#91;Convergence&#93;Use a simulated miracast sink for testing convergence

                                    Thanks for your findings. It seems we need much more here, too sad it does not work out of box.

                                    BR

                                    Maybe it's not "much more", but just a way to convince miraclecast into talking on regular wifi

                                    flohackF 1 Reply Last reply Reply Quote 0
                                    • flohackF Offline
                                      flohack @doniks
                                      last edited by

                                      @doniks Miracast is per definition not possible over "normal" WiFi, thats why most people had only success with the Microsoft Miracast stick. That seems to be still the most compatible one...

                                      BR

                                      My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                                      D 1 Reply Last reply Reply Quote 0
                                      • LuksusL Offline
                                        Luksus
                                        last edited by

                                        It seems that the wireless display mode is broken on 16.04 for FP2.
                                        I reflashed it with 15.04 and there my "display" shows up.
                                        By the way, you can add the LG 1500pf/g/Largo projectors to the confirmed working devices :-).

                                        Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                                        D 1 Reply Last reply Reply Quote 1
                                        • D Offline
                                          doniks @Luksus
                                          last edited by

                                          modules:composer.user_said_in, @luksus, &#91;HowTo&#93;&#91;Convergence&#93;Use a simulated miracast sink for testing convergence

                                          It seems that the wireless display mode is broken on 16.04 for FP2.
                                          I reflashed it with 15.04 and there my "display" shows up.

                                          Sounds like it justifies a bug report

                                          By the way, you can add the LG 1500pf/g/Largo projectors to the confirmed working devices :-).

                                          Sounds like worth documenting, maybe in a new page about wireless displays here: https://docs.ubports.com/en/latest/userguide/dailyuse/index.html

                                          hint, hint πŸ˜‰

                                          1 Reply Last reply Reply Quote 0
                                          • ierihonI Offline
                                            ierihon @flohack
                                            last edited by

                                            Nexus 5 with SlimPort: on 16.04 RC icons are wery big 😞

                                            I back to 15.04 to try Convergence mode.

                                            1 Reply Last reply Reply Quote 0
                                            • ierihonI Offline
                                              ierihon
                                              last edited by

                                              How to enable desktop mode like on 15.04?

                                              M 1 Reply Last reply Reply Quote 0
                                              • First post
                                                Last post