Scrcpy is a cross-platform open-source mirroring application for Android devices that connects over USB or TCP/IP, for controlling the connected devices via keyboard or mouse.
The best part of using this application is that; it doesn't need root access on Android devices and doesn't show ads or collect your data 😄
Recently, its lead developer Romain Vimont announced the release of Scrcpy 2.0 with a few new additions.
Let's take a look at it.
🆕 Scrcpy 2.0: What's New?
The major highlight of this release is the introduction of real-time audio forwarding on Android 11+ devices.
What is it?: This is a new addition to Scrcpy that allows the streaming and recording of audio from the connected Android device to the host computer without any noticeable lag.
It has been the most requested feature since the first version of Scrcpy released five years ago, and now it's here.
The lead developer experimented a lot, initially by developing 'USBaudio' as a solution, but it performed pretty poorly.
Then he moved on to a new prototype called 'sndcpy', an API to capture audio from an Android app in Android 10. Sadly, that had some unavoidable issues that caused it to run poorly.
Luckily, back in January a Scrcpy user, 'yume-chan' provided Romain with a proof-of-concept to capture device audio using shell permissions on Android with a functional workaround for Android 11.
Since then, Romain has been busy integrating the new functionality into Scrcpy.
How does it work?: It uses Android's low-latency friendly API called 'AudioRecord' to record the audio, the 'MediaCodec' API to encode the captured audio, and a new 'Audio Player component' to feed the audio output with very little latency.
Furthermore, the audio and video streams are demuxed into packets by a 'demuxer'.
Romain also shared a helpful client architecture flow-chart that depicts how the video and audio streams are handled on Scrcpy 2.0 if you are interested in the technical bits 🤓
What devices are supported? 📱
On Android 12 and newer, the audio-forwarding feature works out of the box. But, for Android 11, you must unlock your screen when starting Scrcpy for successful audio capture.
Whereas, for Android 10 or earlier, audio cannot be captured at all.
Besides that, Scrcpy now has support for encoding in H.265 and AV1, provided your device supports it.
If you want to know more about how the new audio-forwarding feature works on Scrcpy, you may check the official announcement blog post.
📥 Download Scrcpy 2.0
Packages have been made available for Linux, macOS, and Windows. You can get them from its GitHub page.
For installation instructions, refer to the instructions on GitHub to successfully set it up for your PC/mobile.
More from It's FOSS...
- 📩 Stay updated with the latest on Linux and Open Source. Get our weekly Newsletter.
- Understand the difference between Snap and Flatpak.
- 🛍️ Linux books by Pakct in Humble Bundle offer.
- Join our community forum.