Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Real programmers don't comment their code. It was hard to write, it should be hard to understand.


computers / comp.mobile.android / Re: Tutorial: How to wirelessly mirror Android YouTube sans ads onto Windows/Linux/macOS with scrcpy/sndcpy/newpipe running on Android

SubjectAuthor
* Tutorial: How to wirelessly mirror Android YouTube sans ads onto Windows/Linux/mAndy Burnelli
`- Re: Tutorial: How to wirelessly mirror Android YouTube sans ads onto Windows/LinAndy Burnelli

1
Tutorial: How to wirelessly mirror Android YouTube sans ads onto Windows/Linux/macOS with scrcpy/sndcpy/newpipe running on Android

<tmrgqt$mr7t$1@news.mixmin.net>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=35607&group=comp.mobile.android#35607

  copy link   Newsgroups: comp.mobile.android alt.comp.microsoft.windows misc.phone.mobile.iphone comp.sys.mac.system alt.os.linux alt.comp.os.windows-10 alt.comp.os.windows-11 alt.internet.wireless comp.mobile.ipad
Followup: comp.mobile.android,alt.comp.os.windows-10,alt.comp.microsoft.windows
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.mixmin.net!.POSTED!sewer!alphared!news.uzoreto.com!aioe.org!uC+u+wrvCiJRhswcuU7oWw.user.46.165.242.75.POSTED!not-for-mail
From: spa...@nospam.com (Andy Burnelli)
Newsgroups: comp.mobile.android,alt.comp.microsoft.windows,misc.phone.mobile.iphone,comp.sys.mac.system,alt.os.linux,alt.comp.os.windows-10,alt.comp.os.windows-11,alt.internet.wireless,comp.mobile.ipad
Subject: Tutorial: How to wirelessly mirror Android YouTube sans ads onto Windows/Linux/macOS with scrcpy/sndcpy/newpipe running on Android
Followup-To: comp.mobile.android,alt.comp.os.windows-10,alt.comp.microsoft.windows
Date: Thu, 8 Dec 2022 02:06:31 +0000
Organization: Mixmin
Message-ID: <tmrgqt$mr7t$1@news.mixmin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Thu, 8 Dec 2022 02:06:21 -0000 (UTC)
Injection-Info: news.mixmin.net; posting-host="d69badb3e6e93515d6f6b0152dd223744cfd45c3";
logging-data="748797"; mail-complaints-to="abuse@mixmin.net"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1
Content-Language: en-GB
 by: Andy Burnelli - Thu, 8 Dec 2022 02:06 UTC

Tutorial:

How to wirelessly mirror Android YouTube sans ads onto Windows/Linux/macOS
with scrcpy/sndcpy/newpipe running on Android (tested on Android/Windows).

All FOSS tools described work independently and together as desired.
a. scrcpy mirror display (video) from Android onto any desktop PC
b. sndcpy cast (forward) audio from Android onto any desktop PC
c. newpipe (optional) a better youtube client that never shows ads
d. webdav (optional) mount Android over Wi-Fi onto Windows as a drive

This is a general purpose tutorial which should work on _any_ platform.
A. You will be able to mirror any Android application to your desktop
B. You will be able to interact fully with that app on your desktop
(using the shared desktop PC mouse, keyboard, monitor & clipboard)
C. 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)
D. All this will be done 100% over Wi-Fi (there are no cables involved)
E. All tools are FOSS tools so there will _never_ be any costs involved
F. 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.
<https://i.postimg.cc/G2KhqJ38/sndcpy01.jpg> Mirror both video & audio
<https://i.postimg.cc/jdXm2ggJ/sndcpy02.jpg> Even mirror ad-free YouTube
<https://i.postimg.cc/90PPxkRP/sndcpy03.jpg> Resolution is same as devices
<https://i.postimg.cc/qgfYKWf8/sndcpy04.jpg> Resizing to full monitor size
<https://i.postimg.cc/JhjpnRgh/webdav14.jpg> Mirroring using IP address

Not in this tutorial is how to seamlessly mount the entire Android file
system onto the desktop as a drive letter (which is in other tutorials).
<https://i.postimg.cc/wM4Z45pN/webdav10.jpg> Free Android WebDAV servers
<https://i.postimg.cc/BQyRxCN9/webdav11.jpg> Mount sdcards read & write
<https://i.postimg.cc/yYWwgGmy/webdav12.jpg> As Windows drive letters
<https://i.postimg.cc/QtbR1GY0/webdav13.jpg> Over Wi-Fi on your home LAN
<https://i.postimg.cc/gcKXV6F7/webdav16.jpg> A third free WebDAV server

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.

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 no matter how
desperate the iKooks claim that a web browser can do everything. It can't.)

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.

Please ask honest questions if you have issues getting it to work on your
system (as long as that system is not iOS, which is crippled in many ways).

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.
sndcpy (comes with adb): <https://github.com/Genymobile/scrcpy>
scrcpy (comes with adb): <https://github.com/rom1v/sndcpy>

Here is a tutorial for using scrcpy/sndcpy so my instructions below
will simply be cursory copy & paste commands that have worked for me.
<https://github.com/rom1v/sndcpy/issues/74>
*Tutorial to use scrcpy and sndcpy at same time*

There is also a tutorial for mirroring sound/audio onto macOS:
*Share your Android screen and audio on macOS*
<https://dev.to/equiman/share-your-android-screen-and-audio-on-macos-1p64>

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:\> 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.
<https://newpipe.net/>

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:
a. Turn on Android USB debugging
b. Connect Android to the desktop temporarily over USB
c. C:\> adb devices
List of devices attached
adb-SERIAL._adb-tls-connect._tcp. device
C:\> adb tcpip 5555
d. Manually disconnect the USB cable connection
e. adb connect 192.168.1.4:5555

But as of about Android 10, you can directly connect adb over a Wi-Fi
network.
a. Turn on Android USB debugging & Wireless debugging
b. Connect Android to the Wi-Fi network access point
C:\> ping 192.168.1.4
c. C:\> adb devices
List of devices attached
adb-SERIAL._adb-tls-connect._tcp. device
C:\> adb -s adb-SERIAL._adb-tls-connect._tcp.
e. 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:\> scrcpy adb-SERIAL._adb-tls-connect._tcp.

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.
<https://i.postimg.cc/G2KhqJ38/sndcpy01.jpg> Mirror both video & audio
<https://i.postimg.cc/jdXm2ggJ/sndcpy02.jpg> Even mirror ad-free YouTube
<https://i.postimg.cc/90PPxkRP/sndcpy03.jpg> Resolution is same as devices
<https://i.postimg.cc/qgfYKWf8/sndcpy04.jpg> Resizing to full monitor size

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.
Followup set to the Windows & Android newsgroups (and their archives) only.
--
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.

Re: Tutorial: How to wirelessly mirror Android YouTube sans ads onto Windows/Linux/macOS with scrcpy/sndcpy/newpipe running on Android

<tmt3jn$pqk$1@gioia.aioe.org>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=35610&group=comp.mobile.android#35610

  copy link   Newsgroups: comp.mobile.android alt.comp.os.windows-10 alt.comp.microsoft.windows
Path: i2pn2.org!i2pn.org!aioe.org!htnL9PrEhukO41EXSqWbXA.user.46.165.242.75.POSTED!not-for-mail
From: spa...@nospam.com (Andy Burnelli)
Newsgroups: comp.mobile.android,alt.comp.os.windows-10,alt.comp.microsoft.windows
Subject: Re: Tutorial: How to wirelessly mirror Android YouTube sans ads onto Windows/Linux/macOS with scrcpy/sndcpy/newpipe running on Android
Date: Thu, 8 Dec 2022 16:33:06 +0000
Organization: Aioe.org NNTP Server
Message-ID: <tmt3jn$pqk$1@gioia.aioe.org>
References: <tmrgqt$mr7t$1@news.mixmin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="26452"; posting-host="htnL9PrEhukO41EXSqWbXA.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1
Content-Language: en-GB
X-Notice: Filtered by postfilter v. 0.9.2
 by: Andy Burnelli - Thu, 8 Dec 2022 16:33 UTC

Andy Burnelli wrote:

> 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:\> scrcpy adb-SERIAL._adb-tls-connect._tcp.

Note I accidentally typed "scrcpy" where I had meant "sndcpy" above!

Always striving to add value for the benefit of the team...
<https://i.postimg.cc/tgvzsMRm/scrcpy25.jpg> Mirror video over Wi-Fi to PC
<https://i.postimg.cc/G2KhqJ38/sndcpy01.jpg> Cast audio over Wi-Fi to PC
<https://i.postimg.cc/JhjpnRgh/webdav14.jpg> Mirroring Android on Windows
<https://i.postimg.cc/yYWwgGmy/webdav12.jpg> Mounting Android onto Windows
<https://i.postimg.cc/QtbR1GY0/webdav13.jpg> Over Wi-Fi on your home LAN

Below is a minor correction. And some clarification. Using another example.

Note you can use a serial or an IP address (depending on how you connected
adb to the phone over Wi-Fi) where I'll summarize the IP address method.
<https://developer.android.com/studio/command-line/adb>

Here are the steps, summarized, to mirror, cast, and mount over Wi-Fi...
Android: Turn on the Wi-Fi & connect to an access point
(OK to use Android 11+ random MAC for every connection,
but then you need to set the IP address to static on the phone).
(Due to the random MAC, you can't set it as static on the router,
but you can reserve the IP address on the router for the phone).
Desktop: Turn on the Wi-Fi & connect to an access point
(again it's OK to use random MAC but I bridge Ethernet to Wi-Fi)
Android: Turn on Wireless debugging via the new Android 12 special tile
Accept the authentication (generally you hit the remember option).
And note the (static) IP address & random port & random PIN.

Windows:
C:\> ping 192.168.0.2
Reply from 192.168.0.2: bytes=32 time=3ms TTL=64
C:\> adb devices
List of devices attached === empty
C:\> adb connect 192.168.0.2:43210 [or] adb pair 192.168.0.2:43210 123456
C:\> adb devices
List of devices attached === 192.168.0.2
C:\> scrcpy -s 192.168.0.2
C:\> sndcpy 192.168.0.2
C:\> net use Z: \\192.168.0.2@8080\DavWWWRoot /USER:foo bar

Those commands above pretty much make Android seamless with the desktop!
a. The phone is mirrored onto the desktop & operated from the desktop
b. The phone audio is cast to the desktop & independently controlled
c. The phone filesystem is mounted onto the desktop as a drive letter

To help others, I note two important sndcpy points which were gotcha's for
me until I figured them out on my own, since zero tutorials explicitly
mentioned these two critically different points (as far as I can tell).

Observation 1:

While scrcpy needs nothing on Android, sndcpy does need an app on Android!

I had to manually load sndcpy.apk onto the Android device & execute it and
give it permission on the Android phone that it asked for when I ran. This
copy of sndcpy.apk from the desktop to Android was critically important,
and yet it's missing from most tutorials, probably because it's "supposed"
to happen automatically when you run the sndcpy.bat setup file.

Observation 2:
You run sndcpy _differently_ from how you run scrcpy in that the "-s"
option is not used for sndcpy but it's only used for scrcpy (confusingly).

Once you figured those two gotchas out, then the process worked fine!

Using only free tools and only Wi-Fi (no cable)... I documented this:
a. Mirror the phone onto a desktop (with mouse, keyboard, & clipboard).
b. Cast (forward) the phone audio onto the desktop (with separate controls)
c. Connect the phone over Wi-Fi & mount it as a Windows drive letter
d. Anonymously play/rip YouTube (and anything else) without any ads ever

Note each of those tasks used _independent_ FOSS tools in my tests:
A. Mirror & control === scrcpy
B. Cast (forward audio) === sndcpy
C. Connect & mount over Wi-Fi === adb on Windows & webdav on Android
D. Anonymous privacy-aware YouTube play/rip client === newpipe

Use this to get the latest adb (& AdbWinApi.dll" & "AdbWinUsbApi.dll").
<https://developer.android.com/studio/releases/platform-tools.html>
You get adb & fastboot without having to install the entire Android SDK.

<https://dl.google.com/android/repository/platform-tools_r33.0.3-windows.zip>

C:\> adb version
Android Debug Bridge version 1.0.41
Version 33.0.3-8952118

As always, if you know more than I do about this, or if you have another
method for the four tasks above, please add technical value to the thread.
--
Posted out of the goodness of my heart to disseminate useful information
which, in this case, is to clarify points about casting sound & video.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor