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

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

Closed
2 tasks done
laphylee opened this issue May 28, 2020 · 59 comments
Closed
2 tasks done

Comments

@laphylee
Copy link

  • 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.
@rom1v
Copy link
Collaborator

rom1v commented May 28, 2020

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

@StephenW789
Copy link

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

@rom1v
Copy link
Collaborator

rom1v commented May 28, 2020

@mrplumber
Copy link

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.

@StephenW789
Copy link

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

@rom1v
Copy link
Collaborator

rom1v commented May 28, 2020

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.

@mrplumber
Copy link

mrplumber commented May 28, 2020

@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

@StephenW789
Copy link

StephenW789 commented May 28, 2020

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

@rom1v
Copy link
Collaborator

rom1v commented May 28, 2020

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.

@StephenW789
Copy link

@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?

@rom1v
Copy link
Collaborator

rom1v commented May 28, 2020

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

@StephenW789
Copy link

@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.

@rom1v
Copy link
Collaborator

rom1v commented May 28, 2020

Try reducing the definition:

scrcpy -m1024

Does the lag still happen?

@StephenW789
Copy link

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

@StephenW789
Copy link

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

@culmencasa
Copy link

for me, only scrcpy-noconsole.exe will show these ERROR.

@StephenW789
Copy link

@rom1v

I suspect that the keyboard lag has nothing to do with the game Minecraft. I tested the lagging issue on google docs. On my Windows 10 PC, typing through the computer keyboard onto the phone still causes lag. The lag affects both the mirrored image and the phone screen.

However, when I typed with the phone keyboard, there was no lag on either the phone screen or the mirrored image on the PC.

I suspect this has nothing to do with screen resolution as well. Is there anyway to alleviate this?

@fabiorzfreitas
Copy link

I also got this error.

@rom1v could you please list every single debug step I should take in order to help you look into the issue? I intend to follow them all tomorrow and post the results as soon as possible.

By the way, I don't have an USB cable available, I established the adb through the following commands (on android terminal):

su
setprop service.adb.tcp.port 5555
stop adbd
start adbd

And then on Windows:

adb connect IP:5555

Which occurred successfully, the only issue was the one discussed in this topic.

@rom1v
Copy link
Collaborator

rom1v commented May 29, 2020

in order to help you look into the issue?

In fact, there is no issue: #1441 (comment) (except some internal SDL logs which are printed while they should not, but it's very minor)

IMO, the reported warning should not impact performance in scrcpy anyway, since there are only 4 vertexes (it's not a complex 3D scene).

https://github.com/spurious/SDL-mirror/blob/36ea2544f08508f42d5193e175d3a269c3b95bdf/src/render/direct3d/SDL_render_d3d.c#L1268-L1279

@rom1v
Copy link
Collaborator

rom1v commented May 29, 2020

I suspect that the keyboard lag has nothing to do with the game Minecraft.

For keyboard lag, please see #1013.

@dvishal485
Copy link

dvishal485 commented May 29, 2020

I also get the same error, and the display appears to be blurry in Portrait mode. But when I switch to landscape mode ( by Ctrl+R key or Ctrl+Arrow key ) the display is perfectly fine. I already tried changing SDL2.dll file and also tried lowering the resolution in hope of a much crisp display, but the efforts went worthless. Please provide the fix for this issue.

In portrait mode :

Scrcpy 1
Scrcpy 2

In landscape mode :
Scrcpy rotated

The error shown in v1.14 is :

[server] INFO: Device: motorola Moto G5 Plus (XT1686-DS) (Android 10)
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.
[server] INFO: Device screen turned off

While in version v1.13 the error shown was this :

[server] INFO: Device: motorola Moto G5 Plus (XT1686-DS) (Android 10)
INFO: Renderer: direct3d
WARN: Trilinear filtering disabled (not an OpenGL renderer)
INFO: Initial texture: 1080x1920

@rom1v
Copy link
Collaborator

rom1v commented May 29, 2020

I also get the same error, and the display appears to be blurry in Portrait mode. […] Please provide the fix for this issue.

The "ERROR" printed in the console is not a problem.

The "blurry" thing is unrelated, it's a problem with downscaling quality (se #40). Try scrcpy --render-driver=opengl.

@dvishal485
Copy link

dvishal485 commented May 29, 2020

I also get the same error, and the display appears to be blurry in Portrait mode. […] Please provide the fix for this issue.

The "ERROR" printed in the console is not a problem.

The "blurry" thing is unrelated, it's a problem with downscaling quality (se #40). Try scrcpy --render-driver=opengl.

Sorry sir, but the code

scrcpy --render-driver=opengl

resolved the thing displayed on console as error but the blurry part is still there.

Console now shows :

[server] INFO: Device: motorola Moto G5 Plus (XT1686-DS) (Android 10)
INFO: OpenGL shaders: ENABLED
INFO: Created renderer: opengl
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.13587 Compatibility Profile Context 20.4.2 26.20.15029.27016
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x1920

I have the issue of exactly what you described in #40 but I didn't get any part of fix for it. Can you please guide me to fix it ?

@rom1v
Copy link
Collaborator

rom1v commented May 29, 2020

resolved the thing displayed on console as error but the blurry part is still there.

Could you post a new screenshot with that configuration, please?
Could you also post a screenshot with v1.13, please?

@dvishal485
Copy link

dvishal485 commented May 29, 2020

resolved the thing displayed on console as error but the blurry part is still there.

Could you post a new screenshot with that configuration, please?
Could you also post a screenshot with v1.13, please?

Result of

scrcpy --render-driver=opengl

From v1.14,

Console -

[server] INFO: Device: motorola Moto G5 Plus (XT1686-DS) (Android 10)
INFO: OpenGL shaders: ENABLED
INFO: Created renderer: opengl
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.13587 Compatibility Profile Context 20.4.2 26.20.15029.27016
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x1920

Screenshot -
Scrcpy new 1

From v1.13,

Console -

[server] INFO: Device: motorola Moto G5 Plus (XT1686-DS) (Android 10)
INFO: Renderer: opengl
INFO: OpenGL version: 4.5.0 - Build 25.20.100.6518
INFO: Trilinear filtering enabled
INFO: Initial texture: 1080x1920

Screenshot -
scrcpy v13

@rom1v
Copy link
Collaborator

rom1v commented May 29, 2020

OK, your text is very small! The bigger letters take 5 pixels height, some letters 4 pixels height. And the text is rendered at another definition then downscaled, I'm not surprised that the result is awful (even with mipmapping).

@dvishal485
Copy link

OK, your text is very small! The bigger letters take 5 pixels height, some letters 4 pixels height. And the text is rendered at another definition then downscaled, I'm not surprised that the result is awful (even with mipmapping).

Sir, I tried increasing font size in phone but the quality doesn't improve.
What should I do then?

@rom1v
Copy link
Collaborator

rom1v commented May 29, 2020

Use a computer screen with a better definition :) To mirror a device in 1080×1920, your window content is 355×632, that's too small.

Press Ctrl+g, I bet the quality is perfect (but it's too big for your screen) :)

@StephenW789
Copy link

StephenW789 commented May 29, 2020

@rom1v

In terms of the keyboard lag, I think I found the resulting issue, under #109. I posted my results underneath that post.

I think the "keyboard lag" may result from fake keyboard events being sent after a key is held down repeatedly.

@rom1v
Copy link
Collaborator

rom1v commented Jun 7, 2020

This error is not related.

WARN: DEVICE DISCONNECTED

@bhavyabpk
Copy link

bhavyabpk commented Jun 12, 2020

Hello everyone, if you are getting the following 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.

Try running the Scrcpy using a dedicated GPU. I have one Intel HD graphics and a dedicated Nvidia 940mx. When I run directly using Intel HD I get this error, but when I run it using the dedicated GPU, I don't get this error and quality seems little better.

@xNickm
Copy link

xNickm commented Jun 14, 2020

Hello everyone, if you are getting the following 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.

Try running the Scrcpy using a dedicated GPU. I have one Intel HD graphics and a dedicated Nvidia 940mx. When I run directly using Intel HD I get this error, but when I run it using the dedicated GPU, I don't get this error and quality seems little better.

I assumed it would use my Dedicated gpu by default but is there something else I need to do to make sure? I'm also getting the same error as everyone else and the fps is extremely bad. I'm using a 2080 TI X_X.

@bhavyabpk
Copy link

Hello everyone, if you are getting the following 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.
Try running the Scrcpy using a dedicated GPU. I have one Intel HD graphics and a dedicated Nvidia 940mx. When I run directly using Intel HD I get this error, but when I run it using the dedicated GPU, I don't get this error and quality seems little better.

I assumed it would use my Dedicated gpu by default but is there something else I need to do to make sure? I'm also getting the same error as everyone else and the fps is extremely bad. I'm using a 2080 TI X_X.

As I noticed it doesn't use dedicated GPU by default. it uses integrated GPU first. you can change this from your dedicated GPU control panel or settings and choose to run the scrcpy.exe using dedicated GPU instead. or you may see if you get the option to choose GPU by right-clicking on scrcpy.exe on windows os.

@jpark006
Copy link

has this been resolved? if so, can you please point the answer?

@xNickm
Copy link

xNickm commented Jun 15, 2020 via email

@tamkmutnb
Copy link

I got the same issue in the morning it was running fine but when I turn off my PC go outside and came back this issue appears.
Is there any solution for this yet ?

@rom1v
Copy link
Collaborator

rom1v commented Jun 25, 2020

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

@xuyue4
Copy link

xuyue4 commented Jul 1, 2020

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

@crazytitan99
Copy link

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

@tamkmutnb
Copy link

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.

@tamkmutnb
Copy link

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

how to update my scrcpy.

@Artanisx
Copy link

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

@rom1v
Copy link
Collaborator

rom1v commented Jul 26, 2020

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.

@Artanisx
Copy link

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

@daniedev
Copy link

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!!

@daniedev
Copy link

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?

@rom1v
Copy link
Collaborator

rom1v commented Jul 27, 2020

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

scrcpy -m1024 -b2m

@daniedev
Copy link

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 ☺️

@Artanisx
Copy link

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

@daniedev
Copy link

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

@rom1v
Copy link
Collaborator

rom1v commented Jul 27, 2020

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

@Artanisx
Copy link

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

@rom1v
Copy link
Collaborator

rom1v commented Jul 27, 2020

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

@Artanisx
Copy link

Artanisx commented Jul 27, 2020

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests