Genymobile / scrcpy

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

Vivo no audio forwarding WARN: Demuxer 'audio': stream explicitly disabled by the device #4582

Closed Lirikana closed 10 months ago

Lirikana commented 11 months ago

Environment

Describe the bug No audio being forwarded from the phone after the latest OS update on the phone.

[server] INFO: Device: [vivo] vivo V2227A (Android 14)
[server] ERROR: Failed to invoke AudioRecord.<init>.
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)
        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:1042)
[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:1042)
INFO: Renderer: direct3d
WARN: Demuxer 'audio': stream explicitly disabled by the device
INFO: Texture: 1080x2400

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

rom1v commented 11 months ago

4492

Lirikana commented 10 months ago

The first fix was effective for the audio issues.

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.