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

no audio #4691

Closed
songzt opened this issue Feb 21, 2024 · 19 comments
Closed

no audio #4691

songzt opened this issue Feb 21, 2024 · 19 comments

Comments

@songzt
Copy link

songzt commented Feb 21, 2024

help!
on windows, execute "scrcpy"
can screen, but no audio.

full output in the console:

scrcpy 2.1.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)      YWT0222A27007035            device  CET_AL00
D:\scrcpy-win64-v2.1.1\scrcpy-server: 1 file pushed, 0 skipped. 0.7 MB/s (56995 bytes in 0.080s)
[server] INFO: Device: [HUAWEI] HUAWEI CET-AL00 (Android 12)
INFO: Renderer: direct3d
INFO: Texture: 1224x2696

It's very similar to this issue: #4684

and i do like this: kill adb.exe. but not resolved.

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

The console output looks good, there is no audio error.

How is the audio volume on your device?

@songzt
Copy link
Author

songzt commented Feb 21, 2024

set 0. but update 100, also no audio.
and it is normal before, but I don't know what's going on today, no audio.
i try reboot computer and device, but not resolved.

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

Run scrcpy -Vverbose and let scrcpy run for a few seconds. What is the output?

@songzt
Copy link
Author

songzt commented Feb 21, 2024

console output:

scrcpy 2.1.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)      YWT0222A27007035            device  CET_AL00
DEBUG: Device serial: YWT0222A27007035
DEBUG: Using server (portable): D:\scrcpy-win64-v2.1.1\scrcpy-server
D:\scrcpy-win64-v2.1.1\scrcpy-server: 1 file pushed, 0 skipped. 2.4 MB/s (56995 bytes in 0.022s)
[server] INFO: Device: [HUAWEI] HUAWEI CET-AL00 (Android 12)
[server] DEBUG: Using audio encoder: 'c2.android.opus.encoder'
[server] DEBUG: Using video encoder: 'c2.qti.avc.encoder'
DEBUG: Server connected
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
INFO: Renderer: direct3d
DEBUG: Trilinear filtering d[server] WARN: Could not get any audio timestamp
isabled (not an OpenGL renderer
DEBUG: Using icon (portable): D:\scrcpy-win64-v2.1.1\icon.png
DEBUG: Demuxer 'video': starting thread
DEBUG: Demuxer 'audio': starting thread
INFO: Texture: 1224x2696
DEBUG: [Audio] Buffering threshold exceeded, skipping 240 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 720 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 240 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples
VERBOSE: [Audio] Buffering: target=2400 avg=5805.135253 cur=5040 compensation=-3405
VERBOSE: [Audio] Buffering: target=2400 avg=4324.020996 cur=4171 compensation=-1924
VERBOSE: [Audio] Buffering: target=2400 avg=3719.243896 cur=3205 compensation=-1319
VERBOSE: [Audio] Buffering: target=2400 avg=3332.595703 cur=2871 compensation=-932
VERBOSE: [Audio] Buffering: target=2400 avg=3106.660644 cur=3594 compensation=-706
VERBOSE: [Audio] Buffering: target=2400 avg=2947.302246 cur=3415 compensation=-547
VERBOSE: [Audio] Buffering: target=2400 avg=2796.995605 cur=2796 compensation=-396
VERBOSE: [Audio] Buffering: target=2400 avg=2672.948974 cur=2695 compensation=-272
VERBOSE: [Audio] Buffering: target=2400 avg=2599.476806 cur=2146 compensation=0
VERBOSE: [Audio] Buffering: target=2400 avg=2584.162597 cur=3106 compensation=-184
VERBOSE: [Audio] Buffering: target=2400 avg=2602.313476 cur=2579 compensation=-202
VERBOSE: [Audio] Buffering: target=2400 avg=2531.343505 cur=2528 compensation=-131
VERBOSE: [Audio] Buffering: target=2400 avg=2476.617187 cur=2494 compensation=-76
VERBOSE: [Audio] Buffering: target=2400 avg=2453.543945 cur=1995 compensation=0
VERBOSE: [Audio] Buffering: target=2400 avg=2436.910156 cur=1995 compensation=0
VERBOSE: [Audio] Buffering: target=2400 avg=2423.152587 cur=2955 compensation=0
VERBOSE: [Audio] Buffering: target=2400 avg=2456.467041 cur=2475 compensation=-56
VERBOSE: [Audio] Buffering: target=2400 avg=2449.371093 cur=2461 compensation=-49
VERBOSE: [Audio] Buffering: target=2400 avg=2411.634277 cur=2448 compensation=0
DEBUG: User requested to quit
DEBUG: quit...
DEBUG: Server disconnected
DEBUG: Server terminated
DEBUG: Receiver stopped
DEBUG: Demuxer 'audio': end of frames
DEBUG: Demuxer 'video': end of frames

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

Oh, it seems your audio output does not request samples often enough.

Try scrcpy --audio-output-buffer=10 (refs #3793)

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

WARN: Could not get any audio timestamp

Oh, or the problem might be on the device side.

Try the latest version, this might be already "fixed" or worked around.

@songzt
Copy link
Author

songzt commented Feb 21, 2024

run scrcpy --audio-output-buffer=10
and update scrcpy version to 2.3.1.
They couldn't even solve it

@songzt
Copy link
Author

songzt commented Feb 21, 2024

device is huawei mate 50. harmonyOS
Is it related to this?

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

Could you try with another device to determine if the problem is on the device side or on the computer side.

My guess is that it is on the device side.

@songzt
Copy link
Author

songzt commented Feb 21, 2024

change the device, Still the same issue.

run scrcpy

scrcpy 2.1.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)              78ce69cc            device  M2102K1C
D:\scrcpy-win64-v2.1.1\scrcpy-server: 1 file pushed, 0 skipped. 2.4 MB/s (56995 bytes in 0.023s)
[server] INFO: Device: [Xiaomi] Xiaomi M2102K1C (Android 13)
INFO: Renderer: direct3d
INFO: Texture: 1440x3200

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

scrcpy 2.1.1

Please run 2.3.1 and scrcpy -Vverbose and also scrcpy -Vverbose --audio-output-buffer=20.

@songzt
Copy link
Author

songzt commented Feb 21, 2024

run scrcpy -Vverbose --audio-output-buffer=20

scrcpy 2.3.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO:     -->   (usb)              78ce69cc            device  M2102K1C
DEBUG: Device serial: 78ce69cc
DEBUG: Using server (portable): D:\scrcpy-win64-v2.3.1\scrcpy-server
D:\scrcpy-win64-v2.3.1\scrcpy-server: 1 file pushed, 0 skipped. 36.7 MB/s (66007 bytes in 0.002s)
[server] INFO: Device: [Xiaomi] Xiaomi M2102K1C (Android 13)
DEBUG: Server connected
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
[server] DEBUG: Using video encoder: 'c2.qti.avc.encoder'
[server] DEBUG: Using audio encoder: 'c2.android.opus.encoder'
INFO: Renderer: direct3d
DEBUG: Trilinear filtering disabled (not an OpenGL renderer
DEBUG: Using icon (portable): D:\scrcpy-win64-v2.3.1\icon.png
DEBUG: Demuxer 'video': starting thread
DEBUG: Demuxer 'audio': starting thread
INFO: Texture: 1440x3200
DEBUG: [Audio] Buffering threshold exceeded, skipping 240 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 960 samples
VERBOSE: [Audio] Buffering: target=2400 avg=12955.785156 cur=14160 compensation=-3840
VERBOSE: [Audio] Buffering: target=2400 avg=12643.312500 cur=13165 compensation=-3840
VERBOSE: [Audio] Buffering: target=2400 avg=11754.359375 cur=11245 compensation=-3840
VERBOSE: [Audio] Buffering: target=2400 avg=10809.761718 cur=10285 compensation=-3840
VERBOSE: [Audio] Buffering: target=2400 avg=9885.649414 cur=10304 compensation=-3840
VERBOSE: [Audio] Buffering: target=2400 avg=9918.323242 cur=10304 compensation=-3840
VERBOSE: [Audio] Buffering: target=2400 avg=9952.110351 cur=10304 compensation=-3840
VERBOSE: [Audio] Buffering: target=2400 avg=9939.317382 cur=10304 compensation=-3840
VERBOSE: [Audio] Buffering: target=2400 avg=9939.779296 cur=9344 compensation=-3840
VERBOSE: [Audio] Buffering: target=2400 avg=9916.636718 cur=9344 compensation=-3840
DEBUG: User requested to quit
DEBUG: quit...
DEBUG: Demuxer 'audio': end of fr[server] DEBUG: Controller stopped
ames
DEBUG: Demuxer 'video'[server] DEBUG: Device message sender stopped
: end of frames
DEBU[server] DEBUG: Screen streaming stopped
G: Receiver stopped
[server] DEBUG: Audio encoder stopped
DEBUG: Server disconnected
DEBUG: Server terminated

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

If you record your scrcpy session:

scrcpy --record=file.mp4

Then play the file with VLC, is audio working?

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

Also see #4268, it seems it's exactly your problem.

@songzt
Copy link
Author

songzt commented Feb 21, 2024

record video play with VLC is have audio.
but other player also no audio.(This is not important)
thank you very much!

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

record video play with VLC is have audio.

OK, so there is a problem with the SDL audio output.

Try with:

set SDL_AUDIODRIVER=directsound
scrcpy

#3799 (comment)

but other player also no audio.(This is not important)

These players probably do not support the OPUS format. It should work in Firefox too (or other browsers).
Alternatively, you can record in AAC (scrcpy --audio-codec=aac).

@songzt
Copy link
Author

songzt commented Feb 21, 2024

I have a question:
when i run scrcpy, the sound of the device will disappear, Is this normal?

@rom1v
Copy link
Collaborator

rom1v commented Feb 21, 2024

when i run `scrcpy`, the sound of the device will disappear, Is this normal?

Yes: #3875

@songzt
Copy link
Author

songzt commented Feb 21, 2024

OK, Thank you again ^_^

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