Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with scrcpy on Ubuntu 24.04 #7071

Open
gapplef opened this issue Aug 27, 2024 · 7 comments
Open

Problem with scrcpy on Ubuntu 24.04 #7071

gapplef opened this issue Aug 27, 2024 · 7 comments

Comments

@gapplef
Copy link

gapplef commented Aug 27, 2024

After search around, I found pkgx is the most convenient way to run latest scrcpy on ubuntu without manually build.
But I encounter some problems:

>>> pkgx scrcpy
scrcpy 2.6 <https://github.com/Genymobile/scrcpy>
ERROR: Could not initialize SDL audio: dsp: No such audio device
exec: No such file or directory
ERROR: Command not found: [adb], [start-server]
ERROR: (make 'adb' accessible from your PATH or define its fullpath in the ADB environment variable)
INFO: You may install 'adb' by "apt install adb"
ERROR: Could not start adb server

Seemes the dependency adb is missing.
After install 'adb' as suggested, I still get error

>>> sudo apt install adb
>>> pkgx scrcpy
scrcpy 2.6 <https://github.com/Genymobile/scrcpy>
ERROR: Could not initialize SDL audio: dsp: No such audio device
ERROR: Could not start adb server

Any suggestion to fix the problem?

@jhheider
Copy link
Contributor

it's a very good question. in general, running pkgx under sudo can cause permissions errors down the road, but it's worth a try to see if this is a permissions problem.

however, before doing that, i might try playing with this option:

    --audio-source=source
        Select the audio source (output, mic or playback).
        The "output" source forwards the whole audio output, and disables playback on
        the device.
        The "playback" source captures the audio playback (Android apps can opt-out,
        so the whole output is not necessarily captured).
        The "mic" source captures the microphone.
        Default is output.

as it sounds like maybe it's having an issue connecting to the dsp device.

@gapplef
Copy link
Author

gapplef commented Aug 27, 2024

I have tried changing the audio source with --audio-source=output, --audio-source=mic, or --audio-source=playback, and also tried running pkgx with sudo. None of these worked 😭 and the error message is the same.

@jhheider
Copy link
Contributor

interesting. are other alsa-based tools working correctly? or pkgx mpg123? my guess is linux sound system fragmentation is to blame here.

the fact that the adb server won't start might also be to blame. you might want to run adb start-server and see what it tells you.

@gapplef
Copy link
Author

gapplef commented Aug 28, 2024

  • mpg123 failed to run:
>>> pkgx mpg123 -v example.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
	version 1.32.7; written and copyright by Michael Hipp and others
	free software (LGPL) without any warranty but with best wishes
Decoder: x86-64 (AVX)
Trying output module: oss, device: <nil>
[src/libout123/modules/oss.c:open_oss():174] error: Can't open default sound device!
[src/libout123/libout123.c:check_output_module():1163] error: Module 'oss' device open failed.
[src/libout123/libout123.c:out123_open():484] error: Found no driver out of [oss] working with device <default>.
main: [src/mpg123.c:check_fatal_output():338] error: out123 error 3: failure loading driver module

>>> pkgx mpg123 --list-modules
Available modules
-----------------
oss            output  Output audio using OSS
dummy          output  Dummy audio output - does not output audio.
raw            output  raw headerless stream (builtin)
cdr            output  compact disc digital audio stream (builtin)
wav            output  RIFF WAVE file (builtin)
au             output  Sun AU file (builtin)
test           output  output into the void (builtin)
sleep          output  output into the void that takes its time (builtin)
hex            output  interleaved hex printout (builtin)
txt            output  plain text printout, a column per channel (builtin)

I not sure is it relevant, but pipeWire has been set to default for audio since Ubuntu 22.10.

  • adb start-server seemes work fine, nothing was returned.

@jhheider
Copy link
Contributor

hm, i wonder if they need a build flag or something to support that.

@jhheider
Copy link
Contributor

if you rebuild either scrcpy or mpg123 on your ubuntu22 instance, does it make a difference? i can give it a try in docker tomorrow.

@gapplef
Copy link
Author

gapplef commented Aug 29, 2024

Sorry, I don't have a Ubuntu 22.04 instance currently 😓

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants