scrcpy: Audio not working on Vivo(Iqoo) Android 13 device
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 4.8 MB/s (52867 bytes in 0.010s)
[server] INFO: Device: vivo I2202 (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 3.1 Mesa 21.2.6
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x2400
WARN: Demuxer 'audio': stream explicitly disabled by the device
[server] ERROR: Exception on thread Thread[Thread-4,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.content.Context.getOpPackageName()' on a null object reference
at android.media.VivoAudioRecordImpl.isSupportSubMixRecording(VivoAudioRecordImpl.java:133)
at android.media.AudioRecord.<init>(AudioRecord.java:493)
at android.media.AudioRecord.<init>(Unknown Source:0)
at android.media.AudioRecord$Builder.build(AudioRecord.java:999)
at com.genymobile.scrcpy.AudioCapture.createAudioRecord(AudioCapture.java:58)
at com.genymobile.scrcpy.AudioCapture.start(AudioCapture.java:90)
at com.genymobile.scrcpy.AudioEncoder.encode(AudioEncoder.java:183)
at com.genymobile.scrcpy.AudioEncoder.lambda$start$0$com-genymobile-scrcpy-AudioEncoder(AudioEncoder.java:120)
at com.genymobile.scrcpy.AudioEncoder$$ExternalSyntheticLambda0.run(Unknown Source:2)
at java.lang.Thread.run(Thread.java:1012)
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 35 (7 by maintainers)
Commits related to this issue
- Create AudioRecord by reflection as a fallback Some devices (Vivo phones) fail to create an AudioRecord from an AudioRecord.Builder (which throw a NullPointerException). In that case, create an Audi... — committed to Genymobile/scrcpy by yume-chan a year ago
- Create AudioRecord by reflection as a fallback Some devices (Vivo phones) fail to create an AudioRecord from an AudioRecord.Builder (which throw a NullPointerException). In that case, create an Audi... — committed to Genymobile/scrcpy by yume-chan a year ago
- Create AudioRecord by reflection as a fallback Some devices (Vivo phones) fail to create an AudioRecord from an AudioRecord.Builder (which throws a NullPointerException). In that case, create an Aud... — committed to Genymobile/scrcpy by yume-chan a year ago
- Add workarounds for Honor devices Audio did not work on Honor devices. Two workarounds are necessary: - a system context must be set as a base context of FakeContext (so that a PackageManager is... — committed to Genymobile/scrcpy by rom1v a year ago
- Add workarounds for Honor devices Audio did not work on Honor devices. To make it work, a system context must be set as a base context of FakeContext (so that a PackageManager is available), and a c... — committed to Genymobile/scrcpy by rom1v a year ago
- Add workarounds for Honor devices Audio did not work on Honor devices. To make it work, a system context must be set as a base context of FakeContext (so that a PackageManager is available), and a c... — committed to Genymobile/scrcpy by rom1v a year ago
- Add workarounds for Honor devices Audio did not work on Honor devices. To make it work, a system context must be set as a base context of FakeContext (so that a PackageManager is available), and a c... — committed to Genymobile/scrcpy by rom1v a year ago
- Add workarounds for Honor devices Audio did not work on Honor devices. To make it work, a system context must be set as a base context of FakeContext (so that a PackageManager is available), and a c... — committed to Genymobile/scrcpy by rom1v a year ago
- Add workarounds for Honor devices Audio did not work on Honor devices. To make it work, a system context must be set as a base context of FakeContext (so that a PackageManager is available), and a c... — committed to Genymobile/scrcpy by rom1v a year ago
- Always assign a system context as base context FakeContext used ActivityThread.getSystemContext() as base context only in some cases, because it caused problems on some devices: - warnings on Xiaomi... — committed to Genymobile/scrcpy by rom1v 8 months ago
Please try this: scrcpy-server.zip
diff
@rom1v It works fine.
C:\Users\mr.song\Downloads\scrcpy-win64-honor_6\scrcpy-win64-v2.0-94-g9f9b852ae>scrcpy -Vdebug scrcpy 2.0 https://github.com/Genymobile/scrcpy DEBUG: ADB device found: DEBUG: --> (usb) 3468348101003D0 device V2157A DEBUG: Device serial: 3468348101003D0 DEBUG: Using server (portable): C:\Users\mr.song\Downloads\scrcpy-win64-honor_6\scrcpy-win64-v2.0-94-g9f9b852ae\scrcpy-server C:\Users\mr.song\Downloads\scrcpy-win64-honor_6\scrcpy-win…file pushed, 0 skipped. 125.7 MB/s (56935 bytes in 0.000s) [server] INFO: Device: [vivo] vivo V2157A (Android 13) DEBUG: Server connected DEBUG: Starting controller thread DEBUG: Starting receiver thread [server] DEBUG: Using audio encoder: ‘c2.android.opus.encoder’ [server] DEBUG: Using video encoder: ‘OMX.qcom.video.encoder.avc’ INFO: Renderer: direct3d DEBUG: Trilinear filtering disabled (not an OpenGL renderer DEBUG: Using icon (portable): C:\Users\mr.song\Downloads\scrcpy-win64-honor_6\scrcpy-win64-v2.0-94-g9f9b852ae\icon.png DEBUG: Demuxer ‘video’: starting thread DEBUG: Demuxer ‘audio’: starting thread INFO: Texture: 1080x2400 DEBUG: [Audio] Buffering threshold exceeded, skipping 240 samples DEBUG: [Audio] Buffering threshold exceeded, skipping 480 samples DEBUG: [Audio] Buffer underflow, inserting silence: 87 samples DEBUG: [Audio] Buffer underflow, inserting silence: 240 samples DEBUG: [Audio] Buffer underflow, inserting silence: 240 samples
@rom1v
I can create a PR this weekend.