scrcpy icon indicating copy to clipboard operation
scrcpy copied to clipboard

Window not opening on macOS with Onyx Boox Note Air 2

Open SjorsKamps opened this issue 1 year ago • 9 comments

  • [x] I have read the FAQ.
  • [x] I have searched in existing issues.

Environment

  • OS: macOS.
  • scrcpy version: 2.0
  • installation method: brew
  • device model: Onyx Boox Note Air 2
  • Android version: 11

Describe the bug Window does not open

On errors, please provide the output of the console (and adb logcat if relevant). If i try to run it with scrcpy -m1024 or scrcpy -800 the error is gone but still no scree

Please paste terminal output in a code block.

scrcpy 2.0 https://github.com/Genymobile/scrcpy /opt/homebrew/Cellar/scrcpy/2.0/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 184.8 MB/s (52867 bytes in 0.000s) [server] INFO: Device: ONYX NoteAir2 (Android 11) INFO: Renderer: metal [server] ERROR: Encoding error: android.media.MediaCodec$CodecException: Error 0xfffffff4 [server] INFO: newMaxSize = 1600 [server] INFO: Retrying with -m1600... [server] INFO: Retrying... INFO: Initial texture: 1400x1872 1 HIToolbox 0x000000019c6b45c8 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 120 2 HIToolbox 0x000000019c6b4188 _ZN15MenuBarInstance14EnableAutoShowEv + 60 3 HIToolbox 0x000000019c657310 SetMenuBarObscured + 372 4 HIToolbox 0x000000019c656ee8 _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 172 5 HIToolbox 0x000000019c650fcc _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 296 6 HIToolbox 0x000000019c617cd0 _NotifyEventLoopObservers + 176 7 HIToolbox 0x000000019c65096c AcquireEventFromQueue + 432 8 HIToolbox 0x000000019c63fc84 ReceiveNextEventCommon + 320 9 HIToolbox 0x000000019c63fb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72 10 AppKit 0x00000001961ec424 _DPSNextEvent + 632 11 AppKit 0x00000001961eb5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728 12 libSDL2-2.0.0.dylib 0x000000010366f02c Cocoa_PumpEventsUntilDate + 84 13 libSDL2-2.0.0.dylib 0x000000010366f1dc Cocoa_PumpEvents + 56 14 libSDL2-2.0.0.dylib 0x00000001035eab70 SDL_PumpEventsInternal + 64 15 libSDL2-2.0.0.dylib 0x00000001035eae34 SDL_WaitEventTimeout_REAL + 564 16 scrcpy 0x0000000102ee3ec8 scrcpy + 2112 17 scrcpy 0x0000000102eda6ac main_scrcpy + 196 18 dyld 0x0000000192b63e50 start + 2544 1 HIToolbox 0x000000019c63f90c _ZN15MenuBarInstance22RemoveAutoShowObserverEv + 44 2 HIToolbox 0x000000019c657214 SetMenuBarObscured + 120 3 HIToolbox 0x000000019c65e390 _ZN13HIApplication11FrontUILostEv + 44 4 HIToolbox 0x000000019c65704c _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 528 5 HIToolbox 0x000000019c650f70 _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 204 6 HIToolbox 0x000000019c617cd0 _NotifyEventLoopObservers + 176 7 HIToolbox 0x000000019c65096c AcquireEventFromQueue + 432 8 HIToolbox 0x000000019c63fe0c ReceiveNextEventCommon + 712 9 HIToolbox 0x000000019c63fb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72 10 AppKit 0x00000001961ec424 _DPSNextEvent + 632 11 AppKit 0x00000001961eb5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728 12 libSDL2-2.0.0.dylib 0x000000010366f02c Cocoa_PumpEventsUntilDate + 84 13 libSDL2-2.0.0.dylib 0x000000010366f15c Cocoa_WaitEventTimeout + 144 14 libSDL2-2.0.0.dylib 0x00000001035eaec8 SDL_WaitEventTimeout_REAL + 712 15 scrcpy 0x0000000102ee3ec8 scrcpy + 2112 16 scrcpy 0x0000000102eda6ac main_scrcpy + 196 17 dyld 0x0000000192b63e50 start + 2544


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

SjorsKamps avatar Mar 25 '23 06:03 SjorsKamps

adb shell screenrecord /sdcard/file.mp4

gives; ERROR: unable to configure video/avc codec at 1404x1872 (err=-1010) WARNING: failed at 1404x1872, retrying at 720x1280

According to the internet the resolution of the screen is: Screen Resolution, 1,872 by 1,404 pixels.

SjorsKamps avatar Mar 25 '23 06:03 SjorsKamps

There is an encoder issue on the device.

scrcpy --list-encoders

rom1v avatar Mar 25 '23 07:03 rom1v

What do I have to do to fix it?

scrcpy 2.0 https://github.com/Genymobile/scrcpy /opt/homebrew/Cellar/scrcpy/2.0/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 219.3 MB/s (52867 bytes in 0.000s) [server] INFO: List of video encoders: --video-codec=h264 --video-encoder='OMX.qcom.video.encoder.avc' --video-codec=h264 --video-encoder='c2.android.avc.encoder' --video-codec=h264 --video-encoder='OMX.google.h264.encoder' --video-codec=h265 --video-encoder='OMX.qcom.video.encoder.hevc' --video-codec=h265 --video-encoder='OMX.qcom.video.encoder.hevc.cq' --video-codec=h265 --video-encoder='c2.android.hevc.encoder' [server] INFO: List of audio encoders: --audio-codec=opus --audio-encoder='c2.android.opus.encoder' --audio-codec=aac --audio-encoder='c2.android.aac.encoder' --audio-codec=aac --audio-encoder='OMX.google.aac.encoder' sjorskamps@Sjorss-MBP ~ %

SjorsKamps avatar Mar 25 '23 11:03 SjorsKamps

Whe nI do scrcpy -V debug

scrcpy 2.0 https://github.com/Genymobile/scrcpy DEBUG: ADB device found: DEBUG: --> (usb) 8E635657 device NoteAir2 DEBUG: Device serial: 8E635657 DEBUG: Using server: /opt/homebrew/Cellar/scrcpy/2.0/share/scrcpy/scrcpy-server /opt/homebrew/Cellar/scrcpy/2.0/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 164.6 MB/s (52867 bytes in 0.000s) [server] INFO: Device: ONYX NoteAir2 (Android 11) [server] DEBUG: Using encoder: 'OMX.qcom.video.encoder.avc' DEBUG: Server connected DEBUG: Starting controller thread DEBUG: Starting receiver thread [server] DEBUG: Using audio encoder: 'c2.android.opus.encoder' [server] ERROR: Encoding error: android.media.MediaCodec$CodecException: Error 0xfffffff4 [server] INFO: newMaxSize = 1600 [server] INFO: Retrying with -m1600... [server] INFO: Retrying... INFO: Renderer: metal DEBUG: Trilinear filtering disabled (not an OpenGL renderer) DEBUG: Using icon: /opt/homebrew/Cellar/scrcpy/2.0/share/icons/hicolor/256x256/apps/scrcpy.png DEBUG: Demuxer 'video': starting thread DEBUG: Demuxer 'audio': starting thread INFO: Initial texture: 1400x1872

SjorsKamps avatar Mar 25 '23 11:03 SjorsKamps

[server] DEBUG: Using encoder: 'OMX.qcom.video.encoder.avc'

Try the 2 other available h264 encoders listed by --list-encoders:

scrcpy --video-encoder='c2.android.avc.encoder'
scrcpy --video-encoder='OMX.google.h264.encoder'

rom1v avatar Mar 25 '23 11:03 rom1v

No window opens, it also says no available windows

scrcpy 2.0 https://github.com/Genymobile/scrcpy /opt/homebrew/Cellar/scrcpy/2.0/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 195.3 MB/s (52867 bytes in 0.000s) [server] INFO: Device: ONYX NoteAir2 (Android 11) INFO: Renderer: metal INFO: Initial texture: 1400x1872 1 HIToolbox 0x000000019c6b45c8 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 120 2 HIToolbox 0x000000019c6b4188 _ZN15MenuBarInstance14EnableAutoShowEv + 60 3 HIToolbox 0x000000019c657310 SetMenuBarObscured + 372 4 HIToolbox 0x000000019c656ee8 _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 172 5 HIToolbox 0x000000019c650fcc _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 296 6 HIToolbox 0x000000019c617cd0 _NotifyEventLoopObservers + 176 7 HIToolbox 0x000000019c65096c AcquireEventFromQueue + 432 8 HIToolbox 0x000000019c63fe0c ReceiveNextEventCommon + 712 9 HIToolbox 0x000000019c63fb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72 10 AppKit 0x00000001961ec424 _DPSNextEvent + 632 11 AppKit 0x00000001961eb5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728 12 libSDL2-2.0.0.dylib 0x0000000100a6302c Cocoa_PumpEventsUntilDate + 84 13 libSDL2-2.0.0.dylib 0x0000000100a631dc Cocoa_PumpEvents + 56 14 libSDL2-2.0.0.dylib 0x00000001009deb70 SDL_PumpEventsInternal + 64 15 libSDL2-2.0.0.dylib 0x00000001009dee34 SDL_WaitEventTimeout_REAL + 564 16 scrcpy 0x00000001002d7ec8 scrcpy + 2112 17 scrcpy 0x00000001002ce6ac main_scrcpy + 196 18 dyld 0x0000000192b63e50 start + 2544 1 HIToolbox 0x000000019c63f90c _ZN15MenuBarInstance22RemoveAutoShowObserverEv + 44 2 HIToolbox 0x000000019c657214 SetMenuBarObscured + 120 3 HIToolbox 0x000000019c65e390 _ZN13HIApplication11FrontUILostEv + 44 4 HIToolbox 0x000000019c65704c _ZN13HIApplication15HandleActivatedEP14OpaqueEventRefhP15OpaqueWindowPtrh + 528 5 HIToolbox 0x000000019c650f70 _ZN13HIApplication13EventObserverEjP14OpaqueEventRefPv + 204 6 HIToolbox 0x000000019c617cd0 _NotifyEventLoopObservers + 176 7 HIToolbox 0x000000019c65096c AcquireEventFromQueue + 432 8 HIToolbox 0x000000019c63fe0c ReceiveNextEventCommon + 712 9 HIToolbox 0x000000019c63fb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72 10 AppKit 0x00000001961ec424 _DPSNextEvent + 632 11 AppKit 0x00000001961eb5b4 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728 12 libSDL2-2.0.0.dylib 0x0000000100a6302c Cocoa_PumpEventsUntilDate + 84 13 libSDL2-2.0.0.dylib 0x0000000100a6315c Cocoa_WaitEventTimeout + 144 14 libSDL2-2.0.0.dylib 0x00000001009deec8 SDL_WaitEventTimeout_REAL + 712 15 scrcpy 0x00000001002d7ec8 scrcpy + 2112 16 scrcpy 0x00000001002ce6ac main_scrcpy + 196 17 dyld 0x0000000192b63e50 start + 2544

SjorsKamps avatar Mar 25 '23 15:03 SjorsKamps

Getting this issue as well, on Windows, after the Boox firmware update to V3.3.2.

GilgameshxZero avatar Mar 31 '23 23:03 GilgameshxZero

Looks like only audio is broken, none of the audio encoder options work, but scrcpy --no-audio does work!

GilgameshxZero avatar Apr 02 '23 01:04 GilgameshxZero

Looks like only audio is broken, none of the audio encoder options work, but scrcpy --no-audio does work!

Thanks! This also fixed it for me on Ubuntu 20.04 with scrcpy 2.0 compiled from source and using the pre-build server.

rfguimaraes avatar Apr 28 '23 11:04 rfguimaraes

but scrcpy --no-audio does work!

There is definitely a problem here. It should work even without --no-audio, but I can't understand what's wrong.

Refs https://www.reddit.com/r/scrcpy/comments/138zt3o/scrcpy_not_launching/

It seems that running a second encoder (for audio) prevents video encoding from working. I don't understand why you get a stacktrace, it suggests that it crashes the client, I don't know why.

Could you compile scrcpy with ASAN enabled, and run:

meson setup d -Db_sanitize=address -Dprebuilt_server=/path/to/scrcpy-server # adapt the path
ninja -Cd
./run d

What's the error?

Also, does it work with scrcpy --audio-codec=raw?

rom1v avatar May 05 '23 21:05 rom1v

I don’t have build routines setup yet, but I can probably get to it in the next two weeks and report back. Thanks for helping!

Here is the output for the commands you requested.

`audio-codec=raw`:
C:\Users\0>C:\Users\0\main.syncthing\monochrome\bin\/../apps/scrcpy-win64-v2.0/scrcpy.exe -V debug --select-usb --audio-codec=raw
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
DEBUG: ADB device found:
DEBUG:     -->   (usb)              5F56C44D            device  NoteAir2P
DEBUG:         (tcpip)    192.168.0.110:5555            device  NoteAir2P
DEBUG: Device serial: 5F56C44D
DEBUG: Using server (portable): C:\Users\0\main.syncthing\monochrome\apps\scrcpy-win64-v2.0\scrcpy-server
C:\Users\0\main.syncthing\monochrome\apps\scrcpy-win64-v2.0\scrcpy...erver: 1 file pushed, 0 skipped. 92.6 MB/s (52867 bytes in 0.001s)
[server] INFO: Device: ONYX NoteAir2P (Android 11)
DEBUG: Server connected
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
[server] DEBUG: Using encoder: 'OMX.qcom.video.encoder.avc'
INFO: Renderer: direct[server] ERROR: Encoding error: android.media.MediaCodec$CodecException: Error 0xfffffff4
3d[server] INFO: newMaxSize = 1600

[server] INFO: Retrying with -m1600...
D[server] INFO: Retrying...
EBUG: Trilinear filtering disabled (not an OpenGL renderer)
DEBUG: Using icon (portable): C:\Users\0\main.syncthing\monochrome\apps\scrcpy-win64-v2.0\icon.png
DEBUG: Demuxer 'video': starting thread
DEBUG: Demuxer 'audio': starting thread
INFO: Initial texture: 1400x1872
DEBUG: [Audio] Buffering threshold exceeded, skipping 240 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 240 samples
DEBUG: [Audio] Buffering threshold exceeded, skipping 240 samples
...

This continues until I CTRL-C. One time, the program stalls indefinitely after INFO: Initial texture: 1400x1872. Not sure if I just didn’t wait long enough, but I couldn’t recreate this later.

Using audio-codec=aac results in similar behavior.

`--no-audio` (success):
C:\Users\0>C:\Users\0\main.syncthing\monochrome\bin\/../apps/scrcpy-win64-v2.0/scrcpy.exe -V debug --select-usb --no-audio
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
DEBUG: ADB device found:
DEBUG:     -->   (usb)              5F56C44D            device  NoteAir2P
DEBUG:         (tcpip)    192.168.0.110:5555            device  NoteAir2P
DEBUG: Device serial: 5F56C44D
DEBUG: Using server (portable): C:\Users\0\main.syncthing\monochrome\apps\scrcpy-win64-v2.0\scrcpy-server
C:\Users\0\main.syncthing\monochrome\apps\scrcpy-win64-v2.0\scrcpy...erver: 1 file pushed, 0 skipped. 93.8 MB/s (52867 bytes in 0.001s)
[server] INFO: Device: ONYX NoteAir2P (Android 11)
DEBUG: Server connected
DEBUG: Starting controller thread
DEBUG: Starting receiver thread
[server] DEBUG: Using encoder: 'OMX.qcom.video.encoder.avc'
[server] ERROR: Encoding error: android.media.MediaCodec$CodecException: Error 0xfffffff4
[server] INFO: newMaxSize = 1600
[server] INFO: Retrying with -m1600...
[server] INFO: Retrying...
INFO: Renderer: direct3d
DEBUG: Trilinear filtering disabled (not an OpenGL renderer)
DEBUG: Using icon (portable): C:\Users\0\main.syncthing\monochrome\apps\scrcpy-win64-v2.0\icon.png
DEBUG: Demuxer 'video': starting thread
INFO: Initial texture: 1400x1872
INFO: New texture: 1200x1600
DEBUG: User requested to quit
DEBUG: quit...
DEBUG: Demuxer 'video': end of frames
DEBUG: Receiver stopped
[server] DEBUG: Controller stopped
WARN: Killing the server...
DEBUG: Server disconnected
DEBUG: Server terminated

Behavior seems identical over TCP/IP.

GilgameshxZero avatar May 08 '23 07:05 GilgameshxZero

What is the behavior if you run with audio only (using #3978, merged on dev branch)?

scrcpy --no-video

rom1v avatar May 16 '23 06:05 rom1v

I don’t have build routines setup yet, but I can probably get to it in the next two weeks and report back.

I'm interested :)

rom1v avatar May 30 '23 19:05 rom1v

Just for the record, I had the same problem with an Onyx Boox Nova Air C, and using scrcpy --no-audio the extra window finally opened and I was able to cast video flawlessly.

mscastanho avatar Jun 10 '23 18:06 mscastanho

Oh, it might be related to this line on Android 11 (that would explain why when audio is enabled it does not work):

https://github.com/Genymobile/scrcpy/blob/4ad74794255b7669a89c023afc7ae7a2c0da4dc3/server/src/main/java/com/genymobile/scrcpy/Server.java#L89

rom1v avatar Jun 10 '23 20:06 rom1v

Could you also retry on current dev branch? (6ba99a62ff51c0ce209db78a9ed17f1633170027 merged on dev might help)

EDIT: you could try this binary https://github.com/Genymobile/scrcpy/pull/3862#issuecomment-1561871804 it includes the commit I mentionned.

rom1v avatar Jun 10 '23 20:06 rom1v