[Lenovo Yoga Tab 3 Plus ROMs, Kernels, Recoveries, ] vladimiroltean:
I think I get it now. The p2p group interface was a false track. Here's the critical portion of your log:

E/HDCP (577): Unable to locate libstagefright_hdcp.so
E/WifiDisplaySource(577): Failed to set HDCP observer.
E/WifiDisplaySource(577): Unable to instantiate HDCP component. Not using HDCP after all.
I/MediaPlayerService(577): MediaPlayerService::getOMX
I/OMXClient(577): MuxOMX ctor
I/OMXMaster(573): makeComponentInstance(OMX.google.h264.encoder) in mediacodec process
I/Converter(577): using audio bitrate of 128000 bps, video bitrate of 5000000 bps
E/ACodec (577): Encoder could not be configured to emit SPS/PPS before IDR frames. (err -1010)
E/ACodec (577): [OMX.google.h264.encoder] configureCodec returning error -1010
E/ACodec (577): signalError(omxError 0xfffffc0e, internalError -1010)
E/MediaCodec(577): Codec reported err 0xfffffc0e, actionCode 0, while in state 3
E/MediaCodec(577): configure failed with err 0xfffffc0e, resetting...
I/MediaPlayerService(577): MediaPlayerService::getOMX
I/OMXClient(577): MuxOMX ctor
I/OMXMaster(573): makeComponentInstance(OMX.google.h264.encoder) in mediacodec process
I/Converter(577): We going to manually prepend SPS and PPS to IDR frames.
W/ACodec (577): do not know color format 0x7f000789 = 2130708361
E/OMXNodeInstance(573): setParameter(23d002d:google.h264.encoder, ParamVideoIntraRefresh(0x6000006)) ERROR: UnsupportedIndex(0x8000101a)
E/ACodec (577): Setting intra macroblock refresh mode (-1010) failed: 0x0
E/ACodec (577): [OMX.google.h264.encoder] configureCodec returning error -1010
E/ACodec (577): signalError(omxError 0xfffffc0e, internalError -1010)
E/MediaCodec(577): Codec reported err 0xfffffc0e, actionCode 0, while in state 3
E/MediaCodec(577): configure failed with err 0xfffffc0e, resetting...
I/MediaPlayerService(577): MediaPlayerService::getOMX
I/OMXClient(577): MuxOMX ctor
I/OMXMaster(573): makeComponentInstance(OMX.google.h264.encoder) in mediacodec process
E/PlaybackSession(577): video converter returned err -1010
I/WifiDisplayController(1050): Lost RTSP connection with Wifi display due to error 1: Smart TV 05B6
I/WifiDisplayController(1050): Wifi display connection failed!
I/WifiDisplayController(1050): Lost RTSP connection with Wifi display due to error 1: Smart TV 05B6
I/WifiDisplayController(1050): Wifi display connection failed!
I/WifiDisplayController(1050): Retrying Wifi display connection. Retries left: 2
I/WifiDisplayController(1050): Stopped listening for RTSP connection on 192.168.17.2:7236
I/WifiDisplaySource(577): We're stopped.
I/WifiDisplayController(1050): Disconnecting from Wifi display: Smart TV 05B6
I/WifiDisplayController(1050): Disconnected from Wifi display: Smart TV 05B6
I/WifiDisplayController(1050): Connecting to Wifi display: Smart TV 05B6
I/ExtendedRemoteDisplayHelper(1050): ExtendedRemoteDisplay isAvailable() : Not Available.
D/WifiP2pService(1050): Inviting device : fa:28:19:3c:57:8f
I/wpa_supplicant(1380): p2p-p2p0-3: CTRL-EVENT-DISCONNECTED bssid=f6:28:19:3c:57:8f reason=3 locally_generated=1
I/wpa_supplicant(1380): P2P-GROUP-REMOVED p2p-p2p0-3 client reason=REQUESTED
I/wpa_supplicant(1380): nl80211: deinit ifname=p2p-p2p0-3 disabled_11b_rates=0
E/DhcpClient(1050): Read error
E/DhcpClient(1050): android.system.ErrnoException: read failed: ENETDOWN (Network is down)
E/DhcpClient(1050):	at libcore.io.Posix.readBytes(Native Method)
E/DhcpClient(1050):	at libcore.io.Posix.read(Posix.java:169)
E/DhcpClient(1050):	at libcore.io.BlockGuardOs.read(BlockGuardOs.java:231)
E/DhcpClient(1050):	at android.system.Os.read(Os.java:373)
E/DhcpClient(1050):	at android.net.dhcp.DhcpClient$ReceiveThread.run(DhcpClient.java:358)
E/ConnectivityPacketTracker.p2p-p2p0-3(1050): read error:
E/ConnectivityPacketTracker.p2p-p2p0-3(1050): android.system.ErrnoException: read failed: ENETDOWN (Network is down)
E/ConnectivityPacketTracker.p2p-p2p0-3(1050):	at libcore.io.Posix.readBytes(Native Method)
E/ConnectivityPacketTracker.p2p-p2p0-3(1050):	at libcore.io.Posix.read(Posix.java:169)
E/ConnectivityPacketTracker.p2p-p2p0-3(1050):	at libcore.io.BlockGuardOs.read(BlockGuardOs.java:231)
E/ConnectivityPacketTracker.p2p-p2p0-3(1050):	at android.system.Os.read(Os.java:373)
E/ConnectivityPacketTracker.p2p-p2p0-3(1050):	at android.net.util.BlockingSocketReader.mainLoop(BlockingSocketReader.java:127)
E/ConnectivityPacketTracker.p2p-p2p0-3(1050):	at android.net.util.BlockingSocketReader.-android_net_util_BlockingSocketReader_lambda$1(BlockingSocketReader.java:67)
E/ConnectivityPacketTracker.p2p-p2p0-3(1050):	at android.net.util.BlockingSocketReader$-void__init__int_recvbufsize_LambdaImpl0.run(BlockingSocketReader.java)
E/ConnectivityPacketTracker.p2p-p2p0-3(1050):	at java.lang.Thread.run(Thread.java:761)
D/NetlinkEvent(578): Unknown ifindex 9 in RTM_DELADDR
D/IpManager.p2p-p2p0-3(1050): interfaceRemoved(p2p-p2p0-3)
D/DhcpClient(1050): doQuit
D/DhcpClient(1050): onQuitting
D/CommandListener(578): Setting iface cfg
E/IpManager.p2p-p2p0-3(1050): ALERT: Failed to clear IPv4 address on interface p2p-p2p0-3
E/IpManager.p2p-p2p0-3(1050): java.lang.IllegalStateException: command '99 interface setcfg p2p-p2p0-3 0.0.0.0 0' failed with '400 99 Failed to clear address (No such device)'
E/IpManager.p2p-p2p0-3(1050):	at com.android.server.NetworkManagementService.setInterfaceConfig(NetworkManagementService.java:1127)
E/IpManager.p2p-p2p0-3(1050):	at android.net.ip.IpManager.clearIPv4Address(IpManager.java:942)
E/IpManager.p2p-p2p0-3(1050):	at android.net.ip.IpManager.-wrap6(IpManager.java)
E/IpManager.p2p-p2p0-3(1050):	at android.net.ip.IpManager$StoppingState.processMessage(IpManager.java:1151)
E/IpManager.p2p-p2p0-3(1050):	at com.android.internal.util.StateMachine$SmHandler.processMsg(StateMachine.java:980)
E/IpManager.p2p-p2p0-3(1050):	at com.android.internal.util.StateMachine$SmHandler.handleMessage(StateMachine.java:799)
E/IpManager.p2p-p2p0-3(1050):	at android.os.Handler.dispatchMessage(Handler.java:102)
E/IpManager.p2p-p2p0-3(1050):	at android.os.Looper.loop(Looper.java:154)
E/IpManager.p2p-p2p0-3(1050):	at android.os.HandlerThread.run(HandlerThread.java:61)
E/IpManager.p2p-p2p0-3(1050): Caused by: com.android.server.NativeDaemonConnector$NativeDaemonFailureException: command '99 interface setcfg p2p-p2p0-3 0.0.0.0 0' failed with '400 99 Failed to clear address (No such device)'
E/IpManager.p2p-p2p0-3(1050):	at com.android.server.NativeDaemonConnector.executeForList(NativeDaemonConnector.java:505)
E/IpManager.p2p-p2p0-3(1050):	at com.android.server.NativeDaemonConnector.execute(NativeDaemonConnector.java:401)
E/IpManager.p2p-p2p0-3(1050):	at com.android.server.NativeDaemonConnector.execute(NativeDaemonConnector.java:396)
E/IpManager.p2p-p2p0-3(1050):	at com.android.server.NativeDaemonConnector.execute(NativeDaemonConnector.java:381)
E/IpManager.p2p-p2p0-3(1050):	at com.android.server.NetworkManagementService.setInterfaceConfig(NetworkManagementService.java:1125)
E/IpManager.p2p-p2p0-3(1050):	... 8 more
E/IpManager.p2p-p2p0-3(1050): Failed to disable IPv6java.lang.IllegalStateException: command '100 interface ipv6 p2p-p2p0-3 disable' failed with '400 100 Failed to change IPv6 state (No such file or directory)'
D/CommandListener(578): Clearing all IP addresses on p2p-p2p0-3
D/DhcpClient(1050): Receive thread stopped
I/WifiDisplayController(1050): Failed to initiate connection to Wifi display: Smart TV 05B6, reason=0
I/WifiDisplayController(1050): Wifi display connection failed!
D/CommandListener(578): Clearing all IP addresses on p2p-p2p0-3
I/wpa_supplicant(1380): P2P-DEVICE-LOST p2p_dev_addr=fa:28:19:3c:57:8f
E/QCOM PowerHAL(1050): Failed to acquire lock.
I/WifiDisplayController(1050): Retrying Wifi display connection. Retries left: 1
I/WifiDisplayController(1050): Connecting to Wifi display: Smart TV 05B6
I/ExtendedRemoteDisplayHelper(1050): ExtendedRemoteDisplay isAvailable() : Not Available.
E/WifiP2pService(1050): Dropping connect requeset
E/WifiP2pService(1050): address: fa:28:19:3c:57:8f
E/WifiP2pService(1050): wps: setup: 0
E/WifiP2pService(1050): BSSID: null
E/WifiP2pService(1050): pin: null
E/WifiP2pService(1050):
E/WifiP2pService(1050): groupOwnerIntent: 0
E/WifiP2pService(1050): persist: -2
I/WifiDisplayController(1050): Failed to initiate connection to Wifi display: Smart TV 05B6, reason=0
I/WifiDisplayController(1050): Wifi display connection failed!
W/InputMethodManagerService(1050): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy@f37157a attribute=null, token = android.os.BinderProxy@f4b96f3
I/ActivityManager(1050): Setting hasTopUi=false for pid=1554
D/PhoneStatusBar(1554): disable: < expand icons* alerts system_info* back home recent clock search quick_settings >
I/WifiDisplayController(1050): Retrying Wifi display connection. Retries left: 0
I/WifiDisplayController(1050): Connecting to Wifi display: Smart TV 05B6
I/ExtendedRemoteDisplayHelper(1050): ExtendedRemoteDisplay isAvailable() : Not Available.
E/WifiP2pService(1050): Dropping connect requeset
E/WifiP2pService(1050): address: fa:28:19:3c:57:8f
E/WifiP2pService(1050): wps: setup: 0
E/WifiP2pService(1050): BSSID: null
E/WifiP2pService(1050): pin: null
E/WifiP2pService(1050):
E/WifiP2pService(1050): groupOwnerIntent: 0
E/WifiP2pService(1050): persist: -2
I/WifiDisplayController(1050): Failed to initiate connection to Wifi display: Smart TV 05B6, reason=0
I/WifiDisplayController(1050): Wifi display connection failed!

Now here's my interpretation of what's happening:

* Your TV is telling your tablet it wants to use HDCP encryption.

* Your tablet is like "ok, sure. But wait, I don't know how to do that... Let me try without HDCP anyway. Let me initialize the software h264 encoder (OMX.google.h264.encoder)"

* "Encoder could not be configured to emit SPS/PPS before IDR frames." This is ok. I get this too. It says right below that "We going to manually prepend SPS and PPS to IDR frames."

* "Setting intra macroblock refresh mode (-1010) failed: 0x0" Whoops! I don't get this in my logs. Looking it up on Google gets me to this thread on NXP community, where the conclusion seems to be that "From your shared log, it seems your WiFi sink device is HDCP enabled. android_jb4.2.2_1.0.0-ga doesn't support HDCP. So please double check whether your WiFi sink device is HDCP enabled.."

* *EDIT* The error above is not the critical one. It just says that Periodic Intra Refresh is not supported by the codec. Should be non-fatal.

* "E/PlaybackSession(577): video converter returned err -1010" This is the critical error. It all goes downhill after configuring the h264 codec fails.

* The p2p group is brought down as part of the cleanup process after failure, not as a result of there being a problem with the wi-fi link. Proof: "P2P-GROUP-REMOVED p2p-p2p0-3 client reason=REQUESTED" The p2p fixup patch was handling errors generated by reason=FORMATION_FAILED. No wonder why the patch does nothing to help you...

* The DhcpClient and ConnectivityPacketTracker services throwing ENETDOWN, and IpManager throwing ENODEV, is simply a result of them being caught off-guard by the cleanup process while they were trying to do their stuff. Should be ignored.

So it looks like we found the difference between my environment and yours: you have a HDCP-enabled TV and I don't. Give me some more time to understand what are the next steps. In the meantime you can confirm that I'm right by testing with a non-HDCP TV.

*