Scrcpy 2.0 Android screen mirroring and control utility for Windows, Linux, and macOS has just been released with support for audio forwarding that enables audio to be played back into the computer/laptop, instead of the smartphone, at least for mobile devices running Android 11 or greater.
We first reported about Scrcpy open-source utility in 2018, and at the time, it worked relatively well in Ubuntu 16.04 but required quite a few steps for the installation, and it would lag from time to time. I could still use the mouse and keyboard to control my phone, send SMS, chat, browse the web, play games, switch between landscape and portrait modes, and so on. Five years later, Scrcpy 2.0 has been released, the installation is much easier, and new features have been implemented.
Scrcpy 2.0 highlights:
- Quality – 1920×1080 or above
- Performance – 30~120fps, depending on the device
- Latency – 35~70ms
- Startup time: ~1 second to display the first image
- Nothing to install on the Android device, as it relies on adb USB or WiFi debugging mode
- No account, no ads, no internet required
- Audio forwarding for Android 11 and greater
- Video and audio recording
- Mirroring with the Android device screen off
- Copy/paste in both directions
- Configurable quality
- Android device used as a webcam in Linux-only through V4L2
- Physical keyboard/mouse simulation (HID)
- OTG mode
So I decided to give another in Ubuntu 22.04. Scrcpy can be installed easily with apt or snap, but those are older versions 1.2.1 and 1.2.5, so I used the method to install the latest version that is not overly complicated. We first need to install some dependencies:
sudo apt install ffmpeg libsdl2-2.0-0 adb wget \
gcc git pkg-config meson ninja-build libsdl2-dev \
libavcodec-dev libavdevice-dev libavformat-dev libavutil-dev \
libswresample-dev libusb-1.0-0 libusb-1.0-0-dev
Then we can checkout the code and run the install_release.sh script:
git clone https://github.com/Genymobile/scrcpy
You’ll also have to make sure Developer Options and USB debugging is enabled on your smartphone. I thought WiFi debugging would work out of the box, but apparently, this now only works on Android 11 or greater (albeit I use WiFi adb in older Android versions before) but my phone is running Android 10, so I just connected a USB cable to my phone, and it works like a charm. I could browse the web, play a game, start a video call in LINE, watch a YouTube video in NewPipe in a maximized window (not fullscreen), display the Yahoo Finance app to show stock tickers, and so on. I could only hear audio from my phone because it is only running Android 10.
I also tested some of the new features like copy/paste. I could select text and copy some text in Firefox Android and copy it to Gedit with Ctrl+V. It’s bidirectional, so I could copy some text (a URL) in Firefox in Ubuntu and copy it with Ctrl+V in Android.
I also tried to use my phone as a webcam following the V4L2 instructions, but this part failed because of some codec issue:
jaufranc@cnx-laptop-4:~$ scrcpy --v4l2-sink=/dev/video2 --no-display
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
INFO: Video orientation is locked for v4l2 sink. See --lock-video-orientation.
INFO: No display and no recording: audio disabled
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 4.0 MB/s (52867 bytes in 0.013s)
[server] INFO: Device: HUAWEI STK-L22 (Android 10)
INFO: v4l2 sink started to device: /dev/video2
[server] ERROR: Encoding error: android.media.MediaCodec$CodecException: Error 0xfffffc0e
WARN: Device disconnected
[server] ERROR: Exception on thread Thread[main,5,main]
android.media.MediaCodec$CodecException: Error 0xfffffc0e
at android.media.MediaCodec.native_configure(Native Method)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
It could be really useful for older smartphones that can be converted into webcams. Note that scrcpy also works with Raspberry Pi, and it’s likely to work with other Arm Linux SBCs, so there could be some interesting use cases.
Nevertheless, Scrcpy 2.0 is a pretty neat tool that’s easy to use and well-documented. The source code and detailed instructions can be found on GitHub.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.