Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
113.74k stars 10.83k forks source link

Audio not working on Vivo V2105 (Android 14) #4602

Closed Wintkoay closed 10 months ago

Wintkoay commented 10 months ago

Environment

Describe the bug Audio doesn't work when mirroring

Please paste terminal output in a code block.

scrcpy 2.3.1 https://github.com/Genymobile/scrcpy INFO: ADB device found: INFO: --> (usb) 1566414306000YS device V2105 C:\scrcpy-win64-v2.3.1\scrcpy-server: 1 file pushed, 0 skipped. 4.7 MB/s (66007 bytes in 0.013s) [server] INFO: Device: [vivo] vivo V2105 (Android 14) INFO: Renderer: direct3d INFO: Texture: 1080x2376 [server] ERROR: Failed to invoke AudioRecord.. java.lang.NoSuchMethodException: android.media.AudioRecord.native_setup [class java.lang.Object, class java.lang.Object, class [I, int, int, int, int, class [I, class android.os.Parcel, long, int] at java.lang.Class.getMethod(Class.java:2937) at java.lang.Class.getDeclaredMethod(Class.java:2914) at com.genymobile.scrcpy.Workarounds.createAudioRecord(Workarounds.java:293) at com.genymobile.scrcpy.AudioCapture.startRecording(AudioCapture.java:116) at com.genymobile.scrcpy.AudioCapture.start(AudioCapture.java:130) at com.genymobile.scrcpy.AudioEncoder.encode(AudioEncoder.java:190) W at com.genymobile.scrcpy.AudioEncoder.lambda$start$0$com-genymobile-scrcpy-AudioEncoder(AudioEncoder.java:121) at com.genymobile.scrcpy.AudioEncoder$$ExternalSyntheticLambda1.run(Unknown Source:4) at java.lang.Thread.run(Thread.java:1012) ARN: Demuxer 'audio': stream explicitly disabled by the device [server] ERROR: Exception on thread Thread[audio-encoder,5,main] java.lang.RuntimeException: Cannot create AudioRecord at com.genymobile.scrcpy.Workarounds.createAudioRecord(Workarounds.java:324) at com.genymobile.scrcpy.AudioCapture.startRecording(AudioCapture.java:116) at com.genymobile.scrcpy.AudioCapture.start(AudioCapture.java:130) at com.genymobile.scrcpy.AudioEncoder.encode(AudioEncoder.java:190) at com.genymobile.scrcpy.AudioEncoder.lambda$start$0$com-genymobile-scrcpy-AudioEncoder(AudioEncoder.java:121) at com.genymobile.scrcpy.AudioEncoder$$ExternalSyntheticLambda1.run(Unknown Source:4) at java.lang.Thread.run(Thread.java:1012)

Please do not post screenshots of your terminal, just post the content as text instead.

Wintkoay commented 10 months ago

In addition, the audio is completely fine in android 13, but it has failed since upgrading to 14.

rom1v commented 10 months ago

Thank you for your report.

Was already fixed on dev branch by #4492.

rom1v commented 4 months ago

Could you please test if audio still works with https://github.com/Genymobile/scrcpy/pull/5154?

I would like to avoid a regression for Vivo devices with that change.