Update: MIUI 10 (Android 8) have an inbuilt screen recorder that can record internal sound, but I don't know about MIUI pie.
It works on rooted and on some non rooted (confirmed working on OnePlus, Xiaomi, and few Moto) devices.
Install ScreenCam Screen Recorder (It's open-source!).
You can choose between 3 audio recording method :
-Mic : only mic
-Internal audio (Default source) : internal audio + mic, no root, confirmed working on OnePlus, Xiaomi, and few Moto
-Internal audio (System app, R_Submix) : internal audio only, but need to be rooted and install a magisk module
Instructions for Internal audio (System app, R_Submix):
-Download and install the magisk module (latest stable worked for me)
You need to be rooted
Install Internal Audio Plugin, click enable then reboot.
You need to be rooted with magisk
1. install App systemizer from magisk repo and reboot
2. Install Internal Audio Plugin
3. With Terminal Emulator , enter the following lines :
Choose "Systemize Installed Apps (Enter label)" , enter "com.mobzapp.internalaudioplugin" then choose priv-app and reboot.
Then you can record your screen with internal audio with RecMe or you can stream with internal audio with ScreenStream. Don't forget to set audio source to internal sound.
If it says your device isn't compatible :
Okay Guys I Finally Got The Solution For Android Internal Recording!
This Is A Temporary Fix/Solution But As Said Something Is Better Than Nothing!😁
Okay Guys So You Have To Follow All The Steps In The Guide Except The App Systemizing Part It's Pretty Simpe After Enabling The Audio Plugin And Configuring The Audio Source To (Internal Only) You Have To Make Sure That You Open REC Me App Right After It. I Mean In Recent Tab First Open Internal Audio Plugin And Then Open The REC Me App One Below The Other Or Whatever You're Recent Style Is It Just Has To Be One After The Other. 1) Internal Audio Plugin Then REC Me App And Start You're Recording. Then It Should Work Perfectly Fine That's All I Got Hope This Helps!😁🙏
Guys I Have Seen In The Lastest Version Of REC Me App That The Recorded Video Slows Down And The There No Sound In The Video For This I Came Up With This Old Version Of The App Which Supports Lag Free Recording And Internal Audio Just Follow My Previous Step's With This App And Every Thing Should Be Fine!
Go Ahead And Install It Now And Let Me Know If It Worked For You.
And Make Sure Not To Change The Storage Path In The Prefrence.
And Once You Have Configured Internal Audio In The Audio Settings Do Not Change It Even After Restarting App Shows Only Normal Option Like File, Mic ETC Once It's Selected It Should Work Perfectly Fine!