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

pygame.error: No available video device #31

Closed
illume opened this issue Aug 22, 2011 · 7 comments
Closed

pygame.error: No available video device #31

illume opened this issue Aug 22, 2011 · 7 comments
Milestone

Comments

@illume
Copy link
Member

illume commented Aug 22, 2011

Originally reported by: René Dudfield (Bitbucket: illume, GitHub: illume)


== , 2009-04-15 21:42:14 -0700

Traceback (most recent call last):
  File "C:\dpf\AssemblyLine-0.4\run_game.py", line 13, in <module>
    main.main()
  File "C:\dpf\AssemblyLine-0.4\Game\Code\main.py", line 19, in main
    display = pygame.display.set_mode(settings.screen_size, settings.flags)
pygame.error: No available video device

all pygame dependencies installed

== illume, 2009-05-27 00:44:41 -0700

Hi,

looks possibly related to this bug report:
http://groups.google.com/group/pygame-mirror-on-google-groups/browse_thread/thread/423f1d7f3e909c38

Are you able to confirm which version of windows you're on?  


cu,

== Pygame XP, 2011-03-25 06:38:46 -0700

(In reply to comment #1)
> Hi,
> looks possibly related to this bug report:
> http://groups.google.com/group/pygame-mirror-on-google-groups/browse_thread/thread/423f1d7f3e909c38
> Are you able to confirm which version of windows you're on?  
> cu,

Hi cu,

I'm having the same issue on an XP machine.  When I execute
pygame.display.init() in the shell, I receive (5,1) rather than (6,0)
and when I try to execute pygame.display.set_mode I receive
pygame.error: No available video device.

Is there a way to determine what module is failing in the init() call?

tu,

Pygame XP


@illume
Copy link
Member Author

illume commented Sep 7, 2011

Original comment by René Dudfield (Bitbucket: illume, GitHub: illume):


import os
os.environ['SDL_VIDEODRIVER']='windib'

I think maybe we should finally switch to windib being the default even on XP. We could try some complicated scheme to try to init the display with directx first in a separate process and if that fails we try windib... but I guess that might be failure prone too.

@illume
Copy link
Member Author

illume commented Sep 13, 2011

Original comment by Lenard Lindstrom (Bitbucket: llindstrom, GitHub: llindstrom):


The SDL Direct X driver is unreliable. 'windib' is the SDL default. How 'directx' behaves probably depends on which version of Direct X is installed. It would seem Microsoft has given up maintaining compatibility with Direct X 5.

@illume
Copy link
Member Author

illume commented Dec 14, 2011

Original comment by Anonymous:


Its a miracle! lol thanks illume for the code! I had issues getting my game working using the pygame library, and this fixed it!

@illume
Copy link
Member Author

illume commented Jan 25, 2012

Original comment by Anonymous:


**i was having the same problem too, can somebody help me out, i was working for a pygame project, a lil bit explanation for me to understand it well.. plzzzzz and thanks!!

@illume
Copy link
Member Author

illume commented Jul 12, 2012

Original comment by Jason Marshall (Bitbucket: jmm0, GitHub: jmm0):


I think it's time to make windib the default renderer for Windows XP. With that change, we'll be able to close this issue. In my opinion, the productivity losses due to directx renderer bugs outweigh the performance advantage of the directx renderer on some hardware.

Complicated try-directx-except-windib logic would not be a good idea because sometimes after the directx renderer fails, only a system reboot can restore the PC to proper working order.
http://article.gmane.org/gmane.comp.python.pygame/17527/match=%22system%20reboot%20cleared%22

This is how I think the renderer-choosing logic should work:

Windows 95/98/Me without DirectX 5 or greater → windib

Windows 95/98/Me with DirectX 5 or greater → directx

Windows NT/2000/XP/Vista/7/8... → windib

I'll implement the change if @illume doesn't object to my approach.

@illume
Copy link
Member Author

illume commented Jul 16, 2012

Original comment by René Dudfield (Bitbucket: illume, GitHub: illume):


Sounds good to me :)

@illume
Copy link
Member Author

illume commented Jul 25, 2012

Original comment by Jason Marshall (Bitbucket: jmm0, GitHub: jmm0):


I have changed pygame/_ init _.py so that windib is the default video driver for almost all Windows users.

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

No branches or pull requests

1 participant