[Samsung Galaxy S 5 Unified Development] curiousrom:
Cast - Miracast or Wifi Display Not Working - Mirroring Workaround

I can confirm that Cast (Miracast or Wifi display) is not working on my S5 G900M LineageOS 16.0 Pie build 2019-02-09 + Open GApps ARM 9.0 Pico + Magisk v18.0. No custom kernel or any other system modifications.

Added to New S5 LineageOS 16.0 haggertk 2019-02-09 Build! - Bug Report.

I don't think that it's a bug. It's simply not enabled yet as this unofficial build is a work in progress on it's way to becoming official. [MENTION=2693412]haggertk[/MENTION] could confirm this. Meanwhile check the LineageOS Gerrit links below.

Did not test Chromecast as I don't have a Chromecast enabled device to project to.

I can mirror & control the S5 using scrcpy as described in the scrcpy chapter below.

LineageOS Cast Test Setup:

Used this tutorial How to Turn On or Off Projecting to this PC in Windows 10 to enable Miracast (Wifi display) on my laptop running Windows 10 Home 64-bit.

Checked if the laptop was Miracast enabled using dxdiag as described here: How to Check If Your Windows 10 Supports Miracast

On my S3 i9300 running official LineageOS 14.1 > Settings > Display > Cast > 3-dots > Enable wireless display. The S3's screen was immediatly mirrored on the laptop after enabling Cast.

It failed with the S5 G900M running haggertk's klte Unofficial LineageOS 16.0 Pie build 2019-02-09. Settings > Connected devices > Connection preferences > Cast > 3-dots > Enable wireless display. In the Cast panel the S5 is seeing the laptop but fails to project to the PC. The PC is not finding the S5 Wifi display as illustrated in the second screen capture.

View attachment 4691822 View attachment 4691823

I captured a logcat on both Galaxy devices using the fast & easy SysLog after a fresh reboot. Some selected lines:

Sorry for the clutter XDA app users as the Hide function does not work in the app.

S3 i9300 LineageOS 14.1:

I/chatty ( 768): uid=1000(system) WifiP2pService expire 11 lines

I/WifiDisplayController( 768): Initiated connection to Wifi display: MyComputer-UX330

I/wpa_supplicant( 1012): P2P-PROV-DISC-PBC-RESP f8:94:c2:xx:xx:xx

I/wpa_supplicant( 1012): P2P-DEVICE-FOUND fa:94:c2:xx:xx:xx p2p_dev_addr=f8:94:c2:xx:xx:xx pri_dev_type=7-0050F200-0 name='MyComputer-UX330' config_methods=0x88 dev_capab=0x25 group_capab=0x8b wfd_dev_info=0x01011c440006 new=0

I/WifiDisplayController( 2390): Connected to Wifi display: MyComputer-UX330

***

S5 LineageOS unofficial klte 16.0 build 2019-01-09:

I/wpa_supplicant( 1012): p2p0: WPS-PBC-ACTIVE

I/wpa_supplicant( 1012): p2p0: Trying to associate with fa:94:c2:xx:xx:xx (SSID='DIRECT-HRMyComputer-UX330msEZ' freq=2412 MHz)

I/wpa_supplicant( 1012): p2p0: Association request to the driver failed

I/WifiDisplayController( 768): Timed out waiting for Wifi display connection after 30 seconds: MyComputer-UX330

I/WifiDisplayController( 768): Wifi display connection failed!

These pages in the LineageOS Gerrit are interesting:

Not merged yet @ the present but could be applied to the S5 Qualcom SOC in the future maybe: 237132: sdm845-common: Add QCOM's WFD implementation "Sadly, out-of-the-box Miracast support was killed in P, so we need this to keep Wi-Fi display feature working."

237129 Merge changes for launching wifidisplay from system settings and check the Relation chain & Same topic on the right side of the page.

236372: g2-common: overlay: Remove Wifi Display config "Remove Wifi Display config Google removed support for it in Pie."

234959: serrano-common: Remove Wifi Display options "Remove Wifi Display config Google removed support for it in Pie."

So it seems that Google removed support for Miracast in Pie, probably to push their data collecting Chromecast. :eek: Check Requirements for Chromecast devices and Requirements for Google Home and Chromecast devices. And Google Home requieres in turn the data collecting Google Assistant while Miracast requieres none of those.

But thankfully some LineageOS devs are working on Miracast - Wifi display. And maybe an XDA dev will come up with a hack to enable it in Android 9.0 Pie.

LineageOS Gerrit searches:

owner:haggertk@lineageos.org branch:lineage-16.0 status:merged cast: no results @ the present.

branch:lineage-16.0 cast

branch:lineage-16.0 status:merged cast

branch:lineage-16.0 wifi-display

S5 Screen Mirroring Using scrcpy via USB

I can successfully mirror & control the S5 via USB or wirelessly in my laptop using scrpy - Display and control your Android device > README.md.

It is very easy to use:

S5 > Settings > System > Advanced > Developer options > Debugging > Android debugging & Debugging notify enabled.

The S5's screen must be turned on but > Display > Brightness level can be turned down all the way to 0% & scrcpy still works (30% for my taste).

Settings > Display > Advanced > Sleep > 30 minutes for me until I'm finished with the scrcpy session.

On Windows 10 64-bit I downloaded scrcpy-win64-v1.6.zip, unzipped it, copied the scrcpy-win64 folder to the root of C drive.

I did not try the Linux & Mac OS versions.

Connected the S5 to computer via USB cable. Grant adb debugging permission on the phone if asked.

PC > File Explorer > in the navigation bar of C:\scrcpy-win64 typed CMD & hit Enter to open the Command Prompt & then typed scrcpy & hit Enter: done!

I can then see the S5 display on my laptop & control it with a mouse & the keyboard shortcuts described in > scrcpy - Display and control your Android device > README.md > Shortcuts without touching the S5's buttons.

I attached a screenshot made on the laptop using Alt + Print Screen & pasting in Paint.

View attachment 4691824

***

S5 Screen Mirroring Wirelessly Using scrcpy

Connect the S5 to the same Wi-Fi network as your computer.

S5 > Settings > System > Advanced > Developer options > Debugging: Android debugging, Debugging notify & ADB over network enabled (read the warning about enabling this only on trusted networks).

ADB over network now shows your S5's IP. It's 192.168.1.2:5555 in my case.

A status bar notification appears: ADB over network enabled.

Type CMD in File Explorer's navigation bar of C:\scrcpy-win64 & hit Enter to open the Command Prompt.

Type & hit Enter after each line:

adb connect 192.168.1.2:5555 (change for your S5's IP on that network). Grant adb debugging permission on the phone if asked.

scrcpy

Done! I can see my S5's screen on the laptop & control it with a mouse and the keyboard shortcuts described in the README.md's Shortcuts or via the S5's screen as normal. I attached a screenshot made on the laptop.

View attachment 4691825 View attachment 4691826

When you are finished > tap on the ADB over network enabled notification which will open Developer options & disable ADB over network. Or reboot which will disable it.

I always keep Android debugging & Debugging notify enabled to fix some problems, reboot the S5 if the screen or buttons are not responsive (adb reboot), capture logcat, etc.

***

Note if you get this error when switching from a scrcpy USB session to wireless or vice versa or when connecting an other device:

adb: error: failed to get feature set: more than one device/emulator

ERROR: "adb push" returned with value 1

Press any key to continue...

Just type this & hit Enter after each line:

adb disconnect

scrcpy

Or read this scrcpy Github thread: Add multiple devices support to mirror

Check this scrcpy [MENTION=8190144]®om[/MENTION] dev's blog about how it works technically: Introducing scrcpy. On Reddit with some user comments & questions: Introducing scrcpy, an app to display and control Android devices

Hope this is helpful to somebody. Feedback is always appreciated. :cool:

***

[MENTION=9542362]djbrzos[/MENTION] - Could you give some details please?:confused: Are you using Chromecast? Which app & settings on your S5? Using a dongle on the TV? TV settings?

***

100% Battery Rebooting @ 92%

This is a known issue (or a feature?) & caused by a Samsung charging driver maximum battery voltage limitation. See New S5 LineageOS 16.0 haggertk 2019-01-09 Build! - Report & Bugs > 9. Battery charging...

***