Tutorial example of wirelessly mirroring & ripping anonymous YouTube audio & video & mounting the Android filesystem over Wi-Fi using only FOSS tools!

Search This thread

GalaxyA325G

Senior Member
May 11, 2021
396
74
Samsung Galaxy A32 5G
Tutorial example of wirelessly mirroring Android YouTube audio & video & the filesystem anonymously & sans ads to the desktop over Wi-Fi using only FOSS general purpose tools such as scrcpy, sndcpy, adb, newpipe, webdav, etc.

All FOSS tools described work independently and together as desired.
  • adb = connect Android 100% wirelessly to the desktop PC (no cables)
  • scrcpy = mirror display (video) from Android onto any desktop PC
  • sndcpy = cast (forward) audio from Android onto any desktop PC
  • newpipe = (optional) an anonymous youtube client that never shows ads (plus it downloads/rips/converts audio & video streams)
  • webdav = (optional) mount Android over Wi-Fi onto Windows as a drive letter (The root partition is mounted read only if you're unrooted)
This is a general purpose tutorial which should work on _any_ platform.
  • You will be able to mirror any Android application to your desktop
  • You will be able to interact fully with that app on your desktop
    • (using the shared desktop PC mouse, keyboard, monitor & clipboard)
  • You will be able to forward (cast) the sound from Android to the PC
    • (the controls are independent so that you can reduce echo if needed)
  • All this will be done 100% over Wi-Fi (there are no cables involved)
  • All tools are FOSS tools so there will _never_ be any costs involved
  • And you will _never_ see ads ever (even in YouTube) with my tutorials.

Here are some representative screenshots I made to show how it worked:

Here is an example of mounting the entire Android fileystem as a Windows drive:

As always, this tutorial is written and documented out of the kindness of my heart as free general purpose cross platform functionality is always what I strive for, and particularly, in this example, where I strive for the privacy and utility of a completely ad free FOSS YouTube client cast.

It's general purpose because everyone can do this right now, on any PC.

Note: The _example_ I documented is just one use model, but it's an important use model since YouTube FOSS clients do not exist on the PC (as far as I'm aware).

That means all Android apps should work the same - however - and this is important - there is no other app out there that I know of which performs this FOSS YouTube functionality on the desktop (and no, a web browser is not even close to the same functionality by any means as far as I can tell).

The only other method I know of is emulation (which is the topic of other tutorials as I've written a tutorial in the past for ever free Android emulator on Windows).

As always, since the whole intent is to kind heartedly teach others and to then learn back from what they know that I don't yet know, if you know more than I do about this topic, please do add on-topic technical value.

Here are the minimum tools required to cast the screen & audio to the PC.

Install scrcpy & sndcpy on Windows/Linux as per the instructions at Github.
Here is a tutorial for using scrcpy/sndcpy so my instructions below
will simply be cursory copy & paste commands that have worked for me.
There is also a tutorial for mirroring sound/audio onto macOS:

Here's what I did to mirror NewPipe audio/video youtube to Windows.
(Again, YouTube is just one of many possible examples; YouTube sans ads was
chosen because that functionality does NOT exist on any desktop platform!)

Install scrcpy.apk on Android & put the app icon in a convenient location.
  • C:\>net use T: \\[email protected]\DavWWWRoot /USER:foo bar
  • C:\> copy scrcpy.apk Z:\scrcpy.apk
Note in that copy case Android was mounted over Wi-Fi onto the desktop as a drive letter using free WebDAV servers which has been explained in other tutorials so it's assumed you know how to copy APKs to Android.

Install any FOSS Android YouTube client to watch YouTube sans advertisements.
Now you are ready to mirror Newpipe audio & video over to your desktop PC.

You can use USB cable & then switch to Wi-Fi using this rather old method:
  • Turn on Android USB debugging
    • Note it's helpful to turn on the new Android 12 Wireless debugging tile
  • Connect Android to the desktop temporarily over USB
  • C:\> adb devices
    • List of devices attached
    • adb-SERIAL._adb-tls-connect._tcp. device
  • C:\> adb tcpip 5555
  • Manually disconnect the USB cable connection
  • adb connect 192.168.1.4:5555

But as of about Android 10, you can directly connect adb over a Wi-Fi
network.
  • Turn on Android USB debugging & Wireless debugging
  • Connect Android to the Wi-Fi network access point
    • C:\> ping 192.168.1.4
  • C:\> adb devices
    • List of devices attached
    • adb-SERIAL._adb-tls-connect._tcp. device
  • C:\> adb -s adb-SERIAL._adb-tls-connect._tcp.
  • adb connect 192.168.1.4:43210 (this port is shown on Android)

Once you're connected to adb, mirror the screen,mouse,keyboard & clipboard.
  • C:\> scrcpy -s adb-SERIAL._adb-tls-connect._tcp.

Once you've mirrored the Android onto the desktop, share the audio.
  • C:\> sndcpy adb-SERIAL._adb-tls-connect._tcp.
Note that screen copy uses the "-s" option for the serial while sound copy does not!

Here are some screenshots showing the sharing of YouTube audio/video with Android in your pocket or in another room in the house, without ever seeing an ad using any available FOSS YouTube client.
Note: If the Android phone is in the same room (usually it's in my pocket), you may want to turn the volume down on the phone to prevent echoes.

Note: The instructions say you need VLC but I didn't use it but I do have VLC on both Android & Windows but I don't see where it applies.

Note: Obviously your IP address will differ as will your serial number.

As always, let me know if you enjoy these tutorials, and please add value and like and bookmark (for eventual updates).
--
Posted out of the goodness of my heart to disseminate useful information which, in this case, is to show others how to mirror Android audio & video.
 

Attachments

  • webdav09.jpg
    webdav09.jpg
    93.8 KB · Views: 9
  • webdav16.jpg
    webdav16.jpg
    122.8 KB · Views: 9
  • sndcpy02.jpg
    sndcpy02.jpg
    146.6 KB · Views: 7
  • sndcpy03.jpg
    sndcpy03.jpg
    111.7 KB · Views: 7
  • sndcpy04.jpg
    sndcpy04.jpg
    121.6 KB · Views: 7
  • sndcpy01.jpg
    sndcpy01.jpg
    165.7 KB · Views: 7
  • webdav10.jpg
    webdav10.jpg
    167.5 KB · Views: 7
  • webdav11.jpg
    webdav11.jpg
    129.1 KB · Views: 6
  • webdav12.jpg
    webdav12.jpg
    181.8 KB · Views: 6
  • webdav13.jpg
    webdav13.jpg
    219.9 KB · Views: 6
  • webdav14.jpg
    webdav14.jpg
    664.1 KB · Views: 6
  • scrcpy01.jpg
    scrcpy01.jpg
    734.5 KB · Views: 6
  • scrcpy02.jpg
    scrcpy02.jpg
    979.1 KB · Views: 6
  • adb16.jpg
    adb16.jpg
    93.9 KB · Views: 6
  • scrcpy03.jpg
    scrcpy03.jpg
    2.1 MB · Views: 6
  • scrcpy05.jpg
    scrcpy05.jpg
    527.7 KB · Views: 7
  • scrcpy07.jpg
    scrcpy07.jpg
    536.5 KB · Views: 7
  • scrcpy16.jpg
    scrcpy16.jpg
    1.4 MB · Views: 7
  • vysor36.jpg
    vysor36.jpg
    170.2 KB · Views: 7
  • vysor34.jpg
    vysor34.jpg
    127 KB · Views: 9
Last edited:
  • Like
Reactions: ze7zez

GalaxyA325G

Senior Member
May 11, 2021
396
74
Samsung Galaxy A32 5G
Have you investigated how fast your battery drains when mirroring over wifi?

That's a good question where I don't know the answer simply because my battery lasts almost forever nowadays, no matter what I do with it.

Of course it used to be that we had to set all sorts of things to "save" the juice but with my free Samsung Galaxy A32-5G having a 5 Amp hour battery, it could practically start my car - it's so big. :)

Keeping the charger connected all the time damages the battery.
Are you sure about that?

While I have fast charging enabled, and while my free Galaxy A32-5G came with a fast charger in the box (unfortunately it doesn't handle wireless charging), I have the new Android battery-protection settings set to limit charging to 85% (even if it's on the cable 100% of the time).
  • On my A32-5G with Android 12, I've set:
    • Settings > Battery and device care
    • Longpress on the report of something like
      • "Battery 1d 5h left"
    • Then press "More battery settings"
    • Turn "Protect battery" on
      • "To extend the lifespan of your battery, limit the maximum charge to 85%."
While I do NOT keep the phone on the charger all the time, even if I did keep the phone on the charger all the time, doesn't that setting protect the battery?

Here are all the settings at that "More battery settings" screen:

  • Adaptive battery = off
  • Show battery percentage = on
  • Fast charging = on
  • Protect battery = on
Anyway, your question is a valid question since not all Android batteries are five amp hours or more...

To better help answer your fair question, I just installed these highly rated free ad free gsf free apps to see if they can help me understand the issue better (listed in order of rating):

Let me know what you want me to look for to help answer your question.
 
Last edited:
  • Like
Reactions: ze7zez

GalaxyA325G

Senior Member
May 11, 2021
396
74
Samsung Galaxy A32 5G
BetterBatteryStats may be. Disconnect the charger. Take a screenshot of the graphs while the phone is lying down for an 1 hour with tethering enabled and then while wirelessly mirorring movie for an 1 hour.
I haven't forgotten about this, where I agree BBS is better than the others I had found, but now the problem is there are a huge number of settings for Better Battery Stats as you can see from these screenshots that I made today. I'm not sure which to set & which to look at yet.
 

Attachments

  • battery11.jpg
    battery11.jpg
    90.2 KB · Views: 7
  • battery12.jpg
    battery12.jpg
    132.6 KB · Views: 7
  • battery13.jpg
    battery13.jpg
    91.9 KB · Views: 7
  • battery14.jpg
    battery14.jpg
    84.5 KB · Views: 4
  • battery15.jpg
    battery15.jpg
    73.9 KB · Views: 4
  • battery16.jpg
    battery16.jpg
    58.9 KB · Views: 6

GalaxyA325G

Senior Member
May 11, 2021
396
74
Samsung Galaxy A32 5G
For presenting the results in graphical form, GSAM is better.
Thank you for the suggestion of GSAM which I had to look up to see what it is, and therefore I present those search results for others to benefit from, as always, since every thread should help everyone now and in the future.
Try as I might, I couldn't find a canonical thread on XDA-Developers for GSAM by its developers, but many threads mention GSAM, e.g.,
It seems to be an older app, so it may have broken with each successive Android 12 release (based on the titles of many of the XDA help threads anyway), but here's an older non-XDA reference for GSAM:
I've been running the battery apps and I've not noticed anything adverse in my battery life (the battery essentially lasts forever no matter what I do with it) but I admit I haven't yet delved into the details so I apologize for my inaction.
---
I'll install this GSam app to test it out, but keep in mind I rarely install apps with ads or gsf unless there is nothing else on the planet that does the job. In fact, almost never have I been forced to resort to apps with ads, although every once in a while I do have to resort to apps with gsf code.
 

Attachments

  • gsam01.jpg
    gsam01.jpg
    837.9 KB · Views: 4
  • gsam02.jpg
    gsam02.jpg
    159.6 KB · Views: 4

ze7zez

Recognized Contributor

GalaxyA325G

Senior Member
May 11, 2021
396
74
Samsung Galaxy A32 5G
Please do not create fake news.
The GSAM Battery Monitor supports Android 13.
While you can see from my own screenshot that it "supports" Android 13, I think your comment about 'fake news' is overly harsh as I did research and I'm well aware there are tons of threads where people updated and it did NOT work - but I'm not going to argue that point other than to say "fake news" is overly harsh as I have no agenda here but the truth.

Moving forward... let's look at the truth... working together... so we all benefit from working together.

The FIRST item on the agenda is to find the canonical thread on GSAM so that we can go THERE to find the (latest) truth.

If that fails, then we have to dig for the truth on our own, where I duly deleted the GSAM app and re-installed it just now to see what happens on MY Android 12 device...

OK. Below are about a dozen sets of screenshots which show what GSAM is reporting on my phone, which I have set to charge only to 85% and I'm also using scrcpy over wifi (via adb).

I don't yet know how to interpret those screenshots, but there they are for you to see if the impact seems great from being on Wi-Fi mirroring Android onto the PC.
 

Attachments

  • gsam03.jpg
    gsam03.jpg
    79.5 KB · Views: 1
  • gsam04.jpg
    gsam04.jpg
    69.2 KB · Views: 1
  • gsam05.jpg
    gsam05.jpg
    82.6 KB · Views: 1
  • gsam06.jpg
    gsam06.jpg
    94.8 KB · Views: 1
  • gsam07.jpg
    gsam07.jpg
    76.6 KB · Views: 1
  • gsam08.jpg
    gsam08.jpg
    76.9 KB · Views: 1
  • gsam09.jpg
    gsam09.jpg
    83.5 KB · Views: 1
  • gsam10.jpg
    gsam10.jpg
    103.7 KB · Views: 1
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 1
    Tutorial example of wirelessly mirroring Android YouTube audio & video & the filesystem anonymously & sans ads to the desktop over Wi-Fi using only FOSS general purpose tools such as scrcpy, sndcpy, adb, newpipe, webdav, etc.

    All FOSS tools described work independently and together as desired.
    • adb = connect Android 100% wirelessly to the desktop PC (no cables)
    • scrcpy = mirror display (video) from Android onto any desktop PC
    • sndcpy = cast (forward) audio from Android onto any desktop PC
    • newpipe = (optional) an anonymous youtube client that never shows ads (plus it downloads/rips/converts audio & video streams)
    • webdav = (optional) mount Android over Wi-Fi onto Windows as a drive letter (The root partition is mounted read only if you're unrooted)
    This is a general purpose tutorial which should work on _any_ platform.
    • You will be able to mirror any Android application to your desktop
    • You will be able to interact fully with that app on your desktop
      • (using the shared desktop PC mouse, keyboard, monitor & clipboard)
    • You will be able to forward (cast) the sound from Android to the PC
      • (the controls are independent so that you can reduce echo if needed)
    • All this will be done 100% over Wi-Fi (there are no cables involved)
    • All tools are FOSS tools so there will _never_ be any costs involved
    • And you will _never_ see ads ever (even in YouTube) with my tutorials.

    Here are some representative screenshots I made to show how it worked:

    Here is an example of mounting the entire Android fileystem as a Windows drive:

    As always, this tutorial is written and documented out of the kindness of my heart as free general purpose cross platform functionality is always what I strive for, and particularly, in this example, where I strive for the privacy and utility of a completely ad free FOSS YouTube client cast.

    It's general purpose because everyone can do this right now, on any PC.

    Note: The _example_ I documented is just one use model, but it's an important use model since YouTube FOSS clients do not exist on the PC (as far as I'm aware).

    That means all Android apps should work the same - however - and this is important - there is no other app out there that I know of which performs this FOSS YouTube functionality on the desktop (and no, a web browser is not even close to the same functionality by any means as far as I can tell).

    The only other method I know of is emulation (which is the topic of other tutorials as I've written a tutorial in the past for ever free Android emulator on Windows).

    As always, since the whole intent is to kind heartedly teach others and to then learn back from what they know that I don't yet know, if you know more than I do about this topic, please do add on-topic technical value.

    Here are the minimum tools required to cast the screen & audio to the PC.

    Install scrcpy & sndcpy on Windows/Linux as per the instructions at Github.
    Here is a tutorial for using scrcpy/sndcpy so my instructions below
    will simply be cursory copy & paste commands that have worked for me.
    There is also a tutorial for mirroring sound/audio onto macOS:

    Here's what I did to mirror NewPipe audio/video youtube to Windows.
    (Again, YouTube is just one of many possible examples; YouTube sans ads was
    chosen because that functionality does NOT exist on any desktop platform!)

    Install scrcpy.apk on Android & put the app icon in a convenient location.
    • C:\>net use T: \\[email protected]\DavWWWRoot /USER:foo bar
    • C:\> copy scrcpy.apk Z:\scrcpy.apk
    Note in that copy case Android was mounted over Wi-Fi onto the desktop as a drive letter using free WebDAV servers which has been explained in other tutorials so it's assumed you know how to copy APKs to Android.

    Install any FOSS Android YouTube client to watch YouTube sans advertisements.
    Now you are ready to mirror Newpipe audio & video over to your desktop PC.

    You can use USB cable & then switch to Wi-Fi using this rather old method:
    • Turn on Android USB debugging
      • Note it's helpful to turn on the new Android 12 Wireless debugging tile
    • Connect Android to the desktop temporarily over USB
    • C:\> adb devices
      • List of devices attached
      • adb-SERIAL._adb-tls-connect._tcp. device
    • C:\> adb tcpip 5555
    • Manually disconnect the USB cable connection
    • adb connect 192.168.1.4:5555

    But as of about Android 10, you can directly connect adb over a Wi-Fi
    network.
    • Turn on Android USB debugging & Wireless debugging
    • Connect Android to the Wi-Fi network access point
      • C:\> ping 192.168.1.4
    • C:\> adb devices
      • List of devices attached
      • adb-SERIAL._adb-tls-connect._tcp. device
    • C:\> adb -s adb-SERIAL._adb-tls-connect._tcp.
    • adb connect 192.168.1.4:43210 (this port is shown on Android)

    Once you're connected to adb, mirror the screen,mouse,keyboard & clipboard.
    • C:\> scrcpy -s adb-SERIAL._adb-tls-connect._tcp.

    Once you've mirrored the Android onto the desktop, share the audio.
    • C:\> sndcpy adb-SERIAL._adb-tls-connect._tcp.
    Note that screen copy uses the "-s" option for the serial while sound copy does not!

    Here are some screenshots showing the sharing of YouTube audio/video with Android in your pocket or in another room in the house, without ever seeing an ad using any available FOSS YouTube client.
    Note: If the Android phone is in the same room (usually it's in my pocket), you may want to turn the volume down on the phone to prevent echoes.

    Note: The instructions say you need VLC but I didn't use it but I do have VLC on both Android & Windows but I don't see where it applies.

    Note: Obviously your IP address will differ as will your serial number.

    As always, let me know if you enjoy these tutorials, and please add value and like and bookmark (for eventual updates).
    --
    Posted out of the goodness of my heart to disseminate useful information which, in this case, is to show others how to mirror Android audio & video.
    1
    Have you investigated how fast your battery drains when mirroring over wifi?

    That's a good question where I don't know the answer simply because my battery lasts almost forever nowadays, no matter what I do with it.

    Of course it used to be that we had to set all sorts of things to "save" the juice but with my free Samsung Galaxy A32-5G having a 5 Amp hour battery, it could practically start my car - it's so big. :)

    Keeping the charger connected all the time damages the battery.
    Are you sure about that?

    While I have fast charging enabled, and while my free Galaxy A32-5G came with a fast charger in the box (unfortunately it doesn't handle wireless charging), I have the new Android battery-protection settings set to limit charging to 85% (even if it's on the cable 100% of the time).
    • On my A32-5G with Android 12, I've set:
      • Settings > Battery and device care
      • Longpress on the report of something like
        • "Battery 1d 5h left"
      • Then press "More battery settings"
      • Turn "Protect battery" on
        • "To extend the lifespan of your battery, limit the maximum charge to 85%."
    While I do NOT keep the phone on the charger all the time, even if I did keep the phone on the charger all the time, doesn't that setting protect the battery?

    Here are all the settings at that "More battery settings" screen:

    • Adaptive battery = off
    • Show battery percentage = on
    • Fast charging = on
    • Protect battery = on
    Anyway, your question is a valid question since not all Android batteries are five amp hours or more...

    To better help answer your fair question, I just installed these highly rated free ad free gsf free apps to see if they can help me understand the issue better (listed in order of rating):

    Let me know what you want me to look for to help answer your question.
    1
    BetterBatteryStats may be. Disconnect the charger. Take a screenshot of the graphs while the phone is lying down for an 1 hour with tethering enabled and then while wirelessly mirorring movie for an 1 hour.