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

Nvidia Shield audio problem on MacOS #4118

Closed
2 tasks
StefanToi opened this issue Jun 27, 2023 · 1 comment
Closed
2 tasks

Nvidia Shield audio problem on MacOS #4118

StefanToi opened this issue Jun 27, 2023 · 1 comment

Comments

@StefanToi
Copy link

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: MacOS 13.4.1
  • scrcpy version: 2.1, I don't know why is show 2.0 in terminal
  • installation method: brew
  • device model: Nvidia Shield Pro 2017
  • Android version: 11

Describe the bug
Nvidia Shield audio problem on MacOS. Same Nvidia Shield Pro in same network but on Windows is working fine.

Command: scrcpy, gives this:

scrcpy 2.0 https://github.com/Genymobile/scrcpy
/opt/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 194.4 MB/s (52867 bytes in 0.000s)
[server] INFO: Device: NVIDIA SHIELD Android TV (Android 11)
INFO: Renderer: metal
WARN: Demuxer 'audio': stream explicitly disabled by the device
[server] ERROR: Exception on thread Thread[Thread-4,5,main]
java.lang.IllegalArgumentException: Failed to initialize audio/opus, error 0xfffffffe
at android.media.MediaCodec.native_setup(Native Method)
at android.media.MediaCodec.(MediaCodec.java:2117)
at android.media.MediaCodec.createEncoderByType(MediaCodec.java:2042)
at com.genymobile.scrcpy.AudioEncoder.createMediaCodec(AudioEncoder.java:278)
at com.genymobile.scrcpy.AudioEncoder.encode(AudioEncoder.java:174)
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:923)
ERROR: Demuxer 'video': stream disabled due to connection error
ERROR: Demuxer error
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.createPackageContext(java.lang.String, int)' on a null object reference
at android.content.ContextWrapper.createPackageContext(ContextWrapper.java:927)
at android.content.ContextWrapper.createPackageContext(ContextWrapper.java:927)
at android.media.MediaCodec.isSupported(MediaCodec.java:1892)
at android.media.MediaCodec.checkAppForAutoFrc(MediaCodec.java:1922)
at android.media.MediaCodec.configureCodecParams(MediaCodec.java:2084)
at android.media.MediaCodec.(MediaCodec.java:2118)
at android.media.MediaCodec.createEncoderByType(MediaCodec.java:2042)
at com.genymobile.scrcpy.ScreenEncoder.createMediaCodec(ScreenEncoder.java:209)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:64)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:133)
at com.genymobile.scrcpy.Server.main(Server.java:381)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
WARN: Killing the server...


Command: scrcpy --audio-codec=aac, gives this:

scrcpy 2.0 https://github.com/Genymobile/scrcpy
/opt/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 218.7 MB/s (52867 bytes in 0.000s)
[server] INFO: Device: NVIDIA SHIELD Android TV (Android 11)
[server] ERROR: Exception on thread Thread[Thread-4,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.createPackageContext(java.lang.String, int)' on a null object reference
at android.content.ContextWrapper.createPackageContext(ContextWrapper.java:927)
at android.content.ContextWrapper.createPackageContext(ContextWrapper.java:927)
at android.media.MediaCodec.isSupported(MediaCodec.java:1892)
at android.media.MediaCodec.checkAppForAutoFrc(MediaCodec.java:1922)
at android.media.MediaCodec.configureCodecParams(MediaCodec.java:2084)
at android.media.MediaCodec.(MediaCodec.java:2118)
at android.media.MediaCodec.createEncoderByType(MediaCodec.java:2042)
at com.genymobile.scrcpy.AudioEncoder.createMediaCodec(AudioEncoder.java:278)
at com.genymobile.scrcpy.AudioEncoder.encode(AudioEncoder.java:174)
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:923)
[server] ERROR: Exception on thread Thread[main,5,main]
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.content.Context.createPackageContext(java.lang.String, int)' on a null object reference
at android.content.ContextWrapper.createPackageContext(ContextWrapper.java:927)
at android.content.ContextWrapper.createPackageContext(ContextWrapper.java:927)
at android.media.MediaCodec.isSupported(MediaCodec.java:1892)
at android.media.MediaCodec.checkAppForAutoFrc(MediaCodec.java:1922)
at android.media.MediaCodec.configureCodecParams(MediaCodec.java:2084)
at android.media.MediaCodec.(MediaCodec.java:2118)
at android.media.MediaCodec.createEncoderByType(MediaCodec.java:2042)
at com.genymobile.scrcpy.ScreenEncoder.createMediaCodec(ScreenEncoder.java:209)
at com.genymobile.scrcpy.ScreenEncoder.streamScreen(ScreenEncoder.java:64)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:133)
at com.genymobile.scrcpy.Server.main(Server.java:381)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:399)
INFO: Renderer: metal
ERROR: Demuxer 'video': stream disabled due to connection error
WARN: Demuxer 'audio': stream explicitly disabled by the device
ERROR: Demuxer error
WARN: Killing the server...


Command: scrcpy --no-audio, working fine with no audio:
scrcpy 2.0 https://github.com/Genymobile/scrcpy
/opt/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 198.1 MB/s (52867 bytes in 0.000s)
[server] INFO: Device: NVIDIA SHIELD Android TV (Android 11)
INFO: Renderer: metal
INFO: Initial texture: 1920x1080

@rom1v
Copy link
Collaborator

rom1v commented Jun 27, 2023

Use scrcpy 2.1, this problem is fixed: #3801

@rom1v rom1v closed this as completed Jun 27, 2023
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