Skip to content

Error: SDL failed to get a vertex buffer for this Direct3D 9 rendering batch #1441

Closed

Description

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

Environment

  • OS: Windows 10
  • scrcpy version: 1.14
  • installation method: Win64 Zip
  • device model: Xiaomi MI 8 (Android 10)
  • Android version: 10

Describe the bug

Whenever I started the scrcpy.exe, the following error shows on the console. The scrcpy itself works as usual, although a little slow. I'm not sure if the slowness is related to this error.

[server] INFO: Device: Xiaomi MI 8 (Android 10)
INFO: Created renderer: direct3d
INFO: Renderer: direct3d
INFO: Initial texture: 1080x2248
ERROR: SDL failed to get a vertex buffer for this Direct3D 9 rendering batch!
ERROR: Dropping back to a slower method.
ERROR: This might be a brief hiccup, but if performance is bad, this is probably why.
ERROR: This error will not be logged again for this renderer.

Activity

  1. rom1v commented on May 28, 2020

    @rom1v
    Collaborator

    Might be related to SDL 2.0.12.

    Try to replace SDL2.dll in your v1.14 release by the one released in v1.12 (SDL 2.0.10).

  2. StephenW789 commented on May 28, 2020

    @StephenW789

    I have encountered the same problem. How do we obtain the SDL2.dll file in the v1.12?

  3. mrplumber commented on May 28, 2020

    @mrplumber

    I have the same issue:

    <...>\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 45.5 MB/s (33142 bytes in 0.001s)
    [server] INFO: Device: LGE Nexus 5X (Android 8.1.0)
    INFO: Created renderer: direct3d
    INFO: Renderer: direct3d
    INFO: Initial texture: 1080x1920
    ERROR: SDL failed to get a vertex buffer for this Direct3D 9 rendering batch!
    ERROR: Dropping back to a slower method.
    ERROR: This might be a brief hiccup, but if performance is bad, this is probably why.
    ERROR: This error will not be logged again for this renderer.
    

    As per @rom1v recommendation replaced SDL2.dll from v1.14 package with the one from v1.12 package, but get still get the same error.

  4. StephenW789 commented on May 28, 2020

    @StephenW789

    Yes, same as @mrplumber, I have replaced the file, but still encounters the same error.

  5. rom1v commented on May 28, 2020

    @rom1v
    Collaborator

    OK. Do you encounter this error on scrcpy v1.13?

    If not, i'll have to bisect to find the culprit. Maybe something in #1408.

  6. mrplumber commented on May 28, 2020

    @mrplumber

    @rom1v this the console output when I start v1.13:

    <...>\scrcpy\scrcpy-server: 1 file pushed. 1.8 MB/s (27694 bytes in 0.014s)
    [server] INFO: Device: LGE Nexus 5X (Android 8.1.0)
    INFO: Renderer: direct3d
    WARN: Trilinear filtering disabled (not an OpenGL renderer)
    INFO: Initial texture: 1080x1920
    
  7. StephenW789 commented on May 28, 2020

    @StephenW789

    Using the link: https://github.com/Genymobile/scrcpy/releases/download/v1.13/scrcpy-win64-v1.13.zip,

    I have still encountered the same error with v1.13,

    C:\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 31.1 MB/s (33142 bytes in 0.001s)
    [server] INFO: Device: motorola moto g(6) (Android 8.0.0)
    INFO: Created renderer: direct3d
    INFO: Renderer: direct3d
    INFO: Initial texture: 2160x1080
    ERROR: SDL failed to get a vertex buffer for this Direct3D 9 rendering batch!
    ERROR: Dropping back to a slower method.
    ERROR: This might be a brief hiccup, but if performance is bad, this is probably why.
    ERROR: This error will not be logged again for this renderer.
    INFO: New texture: 1080x2160
    
  8. rom1v commented on May 28, 2020

    @rom1v
    Collaborator

    this the console output when I start v1.13:

    OK, I bisected, bisect/bad is a3ef461.

    Therefore, this is just due to a change in internal SDL logs that have been enabled.

    I will investigate and do not enable them all, but there is no change in behavior.

  9. StephenW789 commented on May 28, 2020

    @StephenW789

    @rom1v, When I switched to the former v1.12, I encountered much less keyboard and screen lag on the device. I was running minecraft on the phone and controlling the phone with the keyboard.

    Is the lag due to the vertex buffer? Also, on v1.12, I still encounter some lag. Is there any way to improve responsiveness?

  10. rom1v commented on May 28, 2020

    @rom1v
    Collaborator

    When I switched to the former v1.12, I encountered much less keyboard and screen lag on the device. I was running minecraft on the phone and controlling the phone with the keyboard.

    If you switch back and forth between v1.12 and v1.14, do you actually always see a difference?

    Also, on v1.12, I still encounter some lag.

    Is the lag on the device or on the computer?

    If you record with scrcpy --record file.mkv, and play the file, is the lag recorded/visible? (if yes, it's on the device, if no, it's on the computer when rendering).

    Is there any way to improve responsiveness?

    Reduce definition:

    scrcpy -m1024
    
  11. StephenW789 commented on May 28, 2020

    @StephenW789

    @rom1v Copying the SDL2.dll file from v1.12 into the v1.14 did not alleviate the problem. Rather, I had to run the older v1.12 version entirely by itself.

    The lag is on both the phone and the computer. I haven't tried usingscrcpy --record file.mkv yet, but I may try later. The lag often occurs from pressing a key on the keyboard, where once I let go of the key, the movement on both the phone and the computer screen will continue to occur.

    If I use the phone screen instead, the movement on the phone does not lag. Instead, the lag is only on the computer screen. If I were to let go of the key on the phone, all movement immediately comes to a stop.

  12. rom1v commented on May 28, 2020

    @rom1v
    Collaborator

    Try reducing the definition:

    scrcpy -m1024
    

    Does the lag still happen?

  13. StephenW789 commented on May 28, 2020

    @StephenW789

    Unfortunately, the lag still occurs on v1.14 even with the reduced definition.

  14. StephenW789 commented on May 28, 2020

    @StephenW789

    On v1.12, with the reduced definition, there also is still lag. But it is noticably less than v1.14

  15. 31 remaining items

  16. tamkmutnb commented on Jul 23, 2020

    @tamkmutnb

    Which issue? The error message or an actual performance issue?

    I did solver my issue by unplug the cable and re-plug it and do the whole command again.

  17. tamkmutnb commented on Jul 23, 2020

    @tamkmutnb

    After I upgrade adb to 30.0.1, there are no errors anymore.

    how to update my scrcpy.

  18. Artanisx commented on Jul 26, 2020

    @Artanisx

    Hello!
    Loving your program :-)

    I wanted to report I have the same issue.

    OS: Windows 10
    scrcpy version: 1.14
    installation method: scoop install
    device model: Samsung Galaxy S9 (Android 10)
    Android version: 10
    adb version: 30.0.3

    Performance is a bit sluggish, probably because of this issue. Thanks for the help :)

  19. rom1v commented on Jul 26, 2020

    @rom1v
    Collaborator

    Does it work better in scrcpy v1.9 or v1.10?

    If so, just take the SDL2.dll from these versions, and replace them in your v1.14 folder.

  20. Artanisx commented on Jul 26, 2020

    @Artanisx

    1.14 is the first version I tried. I'll try some older versions and I'll report back :)

  21. daniedev commented on Jul 27, 2020

    @daniedev

    its the problem with the Android home screen just open an application and run scrcpy.exe
    D:#downloads\scrcpy\scrcpy-server: 1 file pushed, 0 skipped. 40.0 MB/s (33142 bytes in 0.001s)
    [server] INFO: Device: OnePlus ONEPLUS A6000 (Android 10)
    INFO: Created renderer: direct3d
    INFO: Renderer: direct3d
    INFO: Initial texture: 2280x1080

    I tried your way but the issue still exists!!

  22. daniedev commented on Jul 27, 2020

    @daniedev

    In my case, i face the error only when i connect my device to ADB via WIFI.
    When I tried plugging my device via USB, everything seems to work fine. (My wifi router, desktop and mobile all are in the same table).

    Could this be fixed?

  23. rom1v commented on Jul 27, 2020

    @rom1v
    Collaborator

    Oh, the lag is expected then, on wifi you typically need to decrease the definition/bitrate:

    scrcpy -m1024 -b2m
    
  24. daniedev commented on Jul 27, 2020

    @daniedev

    Thank you for the reply 😍.. I have a dedicated GPU.. RTX 2060. But I am not sure which GPU is being used for rendering. Does it matter? If so could you help me make sure i use the right one?

    Thank you in advance ☺️

  25. Artanisx commented on Jul 27, 2020

    @Artanisx

    Reporting back as promised. The error disappeared if if used --render-driver=opengl so maybe direct3d is the issue.
    The performance looked a bit sluggish anyway and the FPS didn't improve much, but maybe it's just how it is :)

  26. daniedev commented on Jul 27, 2020

    @daniedev

    oh, Lets hope there will be a way to improve this. Thank you @Artanisx @rom1v for the support. 😃

  27. rom1v commented on Jul 27, 2020

    @rom1v
    Collaborator

    The performance looked a bit sluggish anyway

    On Windows, performance should be better with direct3d (but you may want opengl for mipmapping #40).

    If you press Ctrl+i in the scrcpy window, it will print framerate in the console. What do you get? (copy-paste the output)

    Note that a frame is produced by the device only when the device content change (so for example if you play a video at 25fps on your Android device, mirroring framerate will not be higher than 25fps).

  28. Artanisx commented on Jul 27, 2020

    @Artanisx

    If you press Ctrl+i in the scrcpy window, it will print framerate in the console. What do you get? (copy-paste the output)

    I get around 30 fps (sometime less). The numbers were similar with Direct3D though, I don't think there was much difference all in all. :)

  29. rom1v commented on Jul 27, 2020

    @rom1v
    Collaborator

    If you don't get any +n frames dropped, then there is globally no lag on the computer side (there might be jitter, but over USB it should be very small).

    So if it feels laggy, it's probably from the device.

    Try with a lower definition, the device might be faster (scrcmy -m800).

  30. Artanisx commented on Jul 27, 2020

    @Artanisx

    I get some +n frames dropped but indeed it's not that frequent.

    I'll try with a lower definition and report back :)

    EDIT:

    Using -m800 the framerate improved indeed (between 25-40), but it's too low res (text can't be read).

    Without -m800 I get:
    INFO: 25 fps
    INFO: 29 fps
    INFO: 29 fps
    INFO: 30 fps
    INFO: 29 fps
    INFO: 29 fps
    INFO: 29 fps
    INFO: 30 fps
    INFO: 20 fps
    INFO: 27 fps
    INFO: 20 fps
    INFO: 30 fps
    INFO: 29 fps
    INFO: 29 fps
    INFO: 29 fps
    INFO: 22 fps (+8 frames skipped)

    Last was before closing so probably it was a micro stutter.

    It's possible it's just my device (Samsung Galaxy S9) which is not powerful enough (or the game is too demanding: Legends of Runeterra)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions