Sound related issues
Please read the prerequisites to run scrcpy.
Also read the FAQ and check if your issue already exists.
Environment
- OS: Debian (codename: bookworm)
- Scrcpy version: 2.6.1
- Installation method: included to scrcpy script (after cloning the repo)
- Device model: Oppo Reno 5 5G
- Android version: 13
Describe the bug
After launching of scrcpy, the music that was runing on the device got disabled, even if I had included to don't forward audio, don't forward audio playback and don't forward any playback
Console output
Additionally, I have recieved multiple times same following console output related to the audio:
ALSA lib pcm.c:8570:(snd_pcm_recover) underrun occurred
What exact command did you execute?
I tryed all combinations of the variations of thr parameters:
--no-audio
--no-audio-palyback
--no-playback
Audio may not be captured/forwarded if you pass --no-audio, that's not possible. 🤔
What is the full output in the console when you execute scrcpy --no-audio?
Audio may not be captured/forwarded if you pass
--no-audio, that's not possible. 🤔What is the full output in the console when you execute
scrcpy --no-audio?
As mentioned, I tryed of any combinations of parameters (with are listed in scrcpy's man? help and usage) that should disable forwarding audio and media in between the pc and mobile device, but it's like you wrote, scrcpy seem to ignore them.
scrcpy seem to ignore them.
How do you provide the parameters? Please post a screenshot of your terminal.
I had created a bash script that executes the scrcpy with given parameters.
I think that including a screenshoot with would display the same as given above (besides of the linux "shebang") has no sense
I had created a bash script that executes the scrcpy with given parameters.
Please post that exact bash script then, and the exact output you get.
#!/bin/bash
cmd=$(scrcpy --no-audio --no-audio-playback --no-playback)
nice -n19 ${cmd} &
cmd=$(scrcpy --no-audio --no-audio-playback --no-playback)
Firstly, --no-playback here implies --no-audio and --no-video, so your intent is to only get control?
But the most important issue here is that in bash, cmd=$(something) will assign to cmd the output of something (i.e. what it prints to the console), not something itself, so I'm not sure what you're trying to do here.
Before trying to run with nice, just run scrcpy --no-audio. In your first post, you said:
After launching of scrcpy, the music that was running on the device got disabled, even if I had included to don't forward audio
If you run scrcpy --no-audio (just that), that's not possible.
First, I wanted ro mention that I had trunchated the complete script and made it as simple as possible to make it easier to read and skipping most of it's orginal functionality.
The orginal script had a menu with would like to select in with mode it would be scrcpy run and depending from that, propper switches would become set.
In reference to Your answers:
Firstly,
--no-playbackhere implies--no-audioand--no-video, so your intent is to only get control?
In one option, yes. This should allow me to remotly control the device while listening music on it.
Currently, running scrcpy (even with given switches) stop's by me the music
But the most important issue here is that in bash,
cmd=$(something)will assign tocmdthe output ofsomething(i.e. what it prints to the console), notsomethingitself, so I'm not sure what you're trying to do here.
As mentioned above, the assigning to "cmd" is a simplicization of the command for better readibility.
Besides of that, in Linux you can assign a command (with switches) to a variable if you need to use it multiple times to don't need to repeatly write it every time
Before trying to run with
nice, just runscrcpy --no-audio
The nice command is there only to control the process priority
Besides of that, in Linux you can assign a command (with switches) to a variable if you need to use it multiple times to don't need to repeatly write it every time
Yes, but the syntax is not cmd=$(yourcommand), but cmd="yourcommand" ($() is for executing a subprocess and returning the output).
The nice command is there only to control the process priority
Sure, but in the script you posted, you passed wrong arguments (but ok this is maybe only a bug in your simplified script).
In any case, without using a script, and just executing scrcpy --no-audio, that cannot impact audio on the device. If it does, then the argument is not correctly passed.
Yes, but the syntax is not
cmd=$(yourcommand), butcmd="yourcommand"($()is for executing a subprocess and returning the output).
Sure, but in the script you posted, you passed wrong arguments (but ok this is maybe only a bug in your simplified script).
ah yes, right..sorry... I had typed the "$( )" by error. Thanks for pointing it out 😉👍
In any case, without using a script, and just executing
scrcpy --no-audio, that cannot impact audio on the device. If it does, then the argument is not correctly passed.
Actually, I did a so called "mind shortcut" and had put the command together to skip the "mode selection" step with would pass the parameters to scrcpy 😉