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

Window not opening on macOS with Onyx Boox Note Air 2 #3859

Open
2 tasks done
SjorsKamps opened this issue Mar 25, 2023 · 16 comments
Open
2 tasks done

Window not opening on macOS with Onyx Boox Note Air 2 #3859

SjorsKamps opened this issue Mar 25, 2023 · 16 comments

Comments

@SjorsKamps
Copy link

SjorsKamps commented Mar 25, 2023

  • I have read the FAQ.
  • 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

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
@SjorsKamps
Copy link
Author

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.

@rom1v
Copy link
Collaborator

rom1v commented Mar 25, 2023

There is an encoder issue on the device.

scrcpy --list-encoders

@SjorsKamps
Copy link
Author

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
Copy link
Author

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

@rom1v
Copy link
Collaborator

rom1v commented Mar 25, 2023

[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'

@SjorsKamps
Copy link
Author

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

@GilgameshxZero
Copy link

GilgameshxZero commented Mar 31, 2023

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

@GilgameshxZero
Copy link

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

@rfguimaraes
Copy link

rfguimaraes commented Apr 28, 2023

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.

@rom1v
Copy link
Collaborator

rom1v commented May 5, 2023

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?

@GilgameshxZero
Copy link

GilgameshxZero commented May 8, 2023

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.

@rom1v
Copy link
Collaborator

rom1v commented May 16, 2023

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

scrcpy --no-video

@rom1v
Copy link
Collaborator

rom1v commented May 30, 2023

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 :)

@mscastanho
Copy link

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.

@rom1v
Copy link
Collaborator

rom1v commented Jun 10, 2023

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

mustFillAppInfo |= audio && Build.VERSION.SDK_INT == Build.VERSION_CODES.R;

@rom1v
Copy link
Collaborator

rom1v commented Jun 10, 2023

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

EDIT: you could try this binary #3862 (comment) it includes the commit I mentionned.

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

5 participants