[Hisense Sero 7 Pro ROMs, Kernels, Recoveries, & Ot] ziddey:
I just took a look at lolcat and indeed, and seeing "E/MyAudioRecord( 987): AudioRecord::read returned -3" spammed.

The interesting lines:

E/ACodec ( 987): Encoder could not be configured to emit SPS/PPS before IDR frames. (err -2147483648)
E/ACodec ( 987): [OMX.Nvidia.h264.encoder] configureCodec returning error -2147483648
E/MediaCodec( 987): Codec reported an error. (omx error 0x80001001, internalError -2147483648)
I/Converter( 987): We going to manually prepend SPS and PPS to IDR frames.
E/OMXNodeInstance( 134): OMX_SetParameter() failed for StoreMetaDataInBuffers: 0x80001005
E/ACodec ( 987): [OMX.Nvidia.h264.encoder] storeMetaDataInBuffers (output) failed w/ err -2147483648
I/ACodec ( 987): setupVideoEncoder succeeded
E/OMXNodeInstance( 134): OMX_EnableAndroidNativeBuffers failed with error -2147479547 (0x80001005)
I/r_submix( 134): adev_open_input_stream()
I/r_submix( 134): in_standby()
I/r_submix( 134): in_standby()
D/NvOsDebugPrintf( 134): NvMMLiteOpen : Block : BlockType = 4
I/OMXClient( 987): Using client-side OMX mux.
D/NvOsDebugPrintf( 134): NvRmPowerModuleClockControl on MOD[29] INST[0]
D/NvOsDebugPrintf( 134): NvRmModuleResetWithHold deassert MOD[29] INST[0]
D/NvOsDebugPrintf( 134): NvMMLiteBlockCreate : Block : BlockType = 4
D/NvOsDebugPrintf( 134): +NvxVideoEncoderSetNvMMAttributes
D/NvOsDebugPrintf( 134): -NvxVideoEncoderSetNvMMAttributes
I/Converter( 987): using audio bitrate of 128000 bps
W/AudioPolicyManagerBase( 134): startInput() input 63 failed: other input already started
E/AudioRecord( 987): start() status -38

I did find https://github.com/kensuke/How-to-Miracast-on-AOSP/wiki/Source-patch

with the same line "Encoder could not be configured to emit SPS/PPS before IDR frames. (err -2147483648)" in the before-patch, although looking at the patch itself (https://github.com/kensuke/How-to-M...frameworks/av/media/libstagefright/ACodec.cpp), it's pretty hackish and simply skips past any errors.. although the subsequent logcat shows this as seemingly the only skip: "E/ACodec(131): setupAVCEncoderParameters() SKIP!! setCyclicIntraMacroblockRefresh()[-1010]"

Maybe...

And here's the logcat for disabling screen casting, right before it completely eats ****:

I/MediaRouterService( 511): Unselected global route:Route Chromecast6207 (com.google.android.gms/.cast.media.CastRemoteDisplayProviderService:42e1a9d60f0e25734da55025f9efd1b0)
I/Choreographer( 908): Skipped 35 frames! The application may be doing too much work on its main thread.
E/NetworkSession( 987): Recvfrom failed, 199/200 retries left
I/Converter( 987): shutting down video encoder
W/GraphicBufferSource( 134): giving up limiting timestamp gap (pts = 4641463763)
E/NetworkSession( 987): Recvfrom failed, 199/200 retries left
E/NetworkSession( 987): Recvfrom failed, 198/200 retries left
E/NetworkSession( 987): Recvfrom failed, 197/200 retries left
W/GraphicBufferSource( 134): Dropped back down to Loaded without Executing
E/BufferQueue( 134): [GraphicBufferSource] dequeueBuffer: BufferQueue has been abandoned!
W/nvwsi ( 130): dequeueBuffer failed, error -19
E/BufferQueue( 134): [GraphicBufferSource] dequeueBuffer: BufferQueue has been abandoned!
W/nvwsi ( 130): dequeueBuffer failed, error -19
E/libEGL ( 130): eglMakeCurrent:775 error 3003 (EGL_BAD_ALLOC)
W/SurfaceFlinger( 130): DisplayDevice::makeCurrent failed. Aborting surface composition for display Chromecast6207
E/SurfaceFlinger( 130): eglSwapBuffers(0x1, 0x4132db50) failed with 0x0000300d
F/SurfaceFlinger( 130): eglSwapBuffers(0x1, 0x4130bf08) failed with 0x0000300d
F/libc ( 130): Fatal signal 6 (SIGABRT) at 0x00000082 (code=-6), thread 130 (surfaceflinger)
D/NvOsDebugPrintf( 134): NvRmPowerModuleClockControl off MOD[29] INST[0]
I/Converter( 987): encoder (video/avc) shut down.
I/Converter( 987): shutting down audio encoder
I/Converter( 987): encoder (audio/mp4a-latm) shut down.

edit: I just checked your git and saw https://github.com/dolorespark/andr...a/blob/aosp442_r1/frameworks/av/miracast.diff

Looks like you were already there :(

I decided to give that N7 libstagefright library a shot and it seems to have grenaded my system pretty badly. Reverted and Google Play Music and Pandora still don't work anymore :(