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

Android 14 audio forwarding did not work as expected #5138

Closed
wrtppp opened this issue Jul 26, 2024 · 3 comments
Closed

Android 14 audio forwarding did not work as expected #5138

wrtppp opened this issue Jul 26, 2024 · 3 comments

Comments

@wrtppp
Copy link

wrtppp commented Jul 26, 2024

Environment

  • **OS: windows10
  • **Scrcpy version: 2.5
  • **Installation method: manual build
  • **Device model: xiaomi8se
  • **Android version: 13

Describe the bug

I'm sorry, I'm not proficient in English, the following is a machine translation
Hello developers.

The problem I have is that after starting scrcpy without adding any parameters, the computer side does not receive the content of the audio forwarding (no sound from the phone), the phone speaker is working properly, how can I fix it

##errors

[server] ERROR: Exception on thread Thread[audio-encoder,5,main]

Please paste terminal output in a code block.

F:\scrcpy-win64-v2.5\scrcpy-server: 1 file pushed, 0 skipped. 28.2 MB/s (69624 bytes in 0.002s)
[server] INFO: Device: [Xiaomi] Xiaomi MI 8 SE (Android 13)
INFO: Renderer: direct3d
INFO: Texture: 1080x2240
WARN: Demuxer 'audio': stream explicitly disabled by the device
[server] ERROR: Exception on thread Thread[audio-encoder,5,main]
java.lang.UnsupportedOperationException: Cannot create AudioRecord
at android.media.AudioRecord$Builder.build(AudioRecord.java:982)
at com.genymobile.scrcpy.FakeContext$$ExternalSyntheticApiModelOutline0.m(D8$$SyntheticClass:0)
at com.genymobile.scrcpy.AudioCapture.createAudioRecord(AudioCapture.java:68)
at com.genymobile.scrcpy.AudioCapture.startRecording(AudioCapture.java:111)
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$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
[server] INFO: Device screen turned off

@rom1v
Copy link
Collaborator

rom1v commented Jul 26, 2024

Hmmm, createAudioRecord() was modified on your vendor rom, it does not behave like AOSP.

Out of curiosity, could you test the new playback capture method in #5102?

@wrtppp
Copy link
Author

wrtppp commented Jul 27, 2024

嗯,在您的供应商 rom 上进行了修改,它的行为不像 AOSP。createAudioRecord()

出于好奇,您可以测试一下 #5102 中的新播放捕获方法吗?

Hello, I downloaded and used scrcpy-win64-v2.5-34-gb417c5441, and set the parameter playback, scrcpy still has no audio forwarding.

##error
[server] ERROR: Could not capture audio playback
Wjava.lang.RuntimeException: registerAudioPolicy() returned -1ARN: Demu
x at com.genymobile.scrcpy.audio.AudioPlaybackCapture.createAudioRecord(AudioPlaybackCapture.java:97)e
r 'au at com.genymobile.scrcpy.audio.AudioPlaybackCapture.start(AudioPlaybackCapture.java:119)d
at com.genymobile.scrcpy.audio.AudioEncoder.encode(AudioEncoder.java:202)i
o at com.genymobile.scrcpy.audio.AudioEncoder.lambda$start$0$com-genymobile-scrcpy-audio-AudioEncoder(AudioEncoder.java:131)
' at com.genymobile.scrcpy.audio.AudioEncoder$$ExternalSyntheticLambda3.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012):
stream explicitly disabled by the device

@wrtppp
Copy link
Author

wrtppp commented Jul 28, 2024

Hello, I changed to an Android 11 ROM, scrcpy can run normally, it is true that the previous ROM has a problem that causes it to not work normally

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