I have been developing a Panda3D/Python app on a standalone machine for quite some time. The other day I connected it to the Internet, and got a shock when my app hung for up to a minute on startup before displaying the GUI. I checked my code for recent bugs, but it was absolutely perfect in every way . Finally I realized the Ethernet cable was still in, and removed it. The app launched in seconds, as before.
OS: WIndows XP
Panda3D: 1.6.2 [EDIT: also 1.7.0]
Command line output:
C:\Workspace\...\src>python app.py
DirectStart: Starting the game.
Known pipe types:
wdxGraphicsPipe8
(all display modules loaded.)
[hangs here]
Hmm, if youâre not using the p3d systemâand youâre not, since youâre just running âpython origame.pyââthen I know of know reason Panda would be attempting to contact anything on the internet at startup. Certainly thereâs nothing built into Panda that does this automatically.
How about pview? Does the same thing happen there?
I know nothing about pview, but running âpviewâ with no arguments works⌠It has the same problem, though. The console window opens and the lines from my last post are printed, then it hangs for 23 seconds before showing a Panda screen with a little triangle.
When I pull the Ethernet cable (there is no wifi whatsoever within range btw, and the adapter is off), running âpviewâ opens the console window, immediately followed by the Panda screen with the triangle.
Ah, I have an idea what this is. I bet itâs trying to contact a pstats server. Check your Config.prc file, you probably have âwant-pstats 1â and/or âpstats-hostâ configured on. Comment it out with a hash mark, or remove these lines altogether.
Sorry it doesnât seem to work, and I donât see any useful suggestions about how to use ConfigVariableBool on GoogleâŚ
C:\Workspace\...\src>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print ConfigVariableBool('want-pstats')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ConfigVariableBool' is not defined
C:\Workspace\...\src>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pandac.PandaModules import *
>>> print ConfigVariableBool('want-pstats')
ConfigVariable want-pstats:
want-pstats #f (from /c/Panda3D-1.6.2/etc/Config.prc)
>>>
And here is the contents of that Config.prc (with comment lines removed):
Well well, that works! What could be wrong with pandadx8? And are there any downsides to using tinydisplay permanently?
Also, I had previously tried using pandadx9 and pandagl one at a time, but both made startup horribly slow. Any thoughts?
Thanks in the meantime!
Alex
UPDATE: I seem to have found the lost time by looking through the spam-level log output. Kindly observe the last line in the following segment of output:
:display(debug): DisplayRegion::do_compute_pixels(800, 600)
:display(debug): DisplayRegion::do_compute_pixels(800, 600)
:display(debug): Creating new window window1
:display(debug): Created wdxGraphicsWindow8 016CA22C
:display(debug): Windows resorted: window1(0) window1(0)
:task(debug): AsyncTaskManager TaskManager task chain loader; 0 tasks: set_num_threads(1)
:display:wdxdisplay8: D3D8.1 Adapter[0]: Mobile Intel(R) 4 Series Express Chipset Family, Driver: igxprd32.dll, DriverVersion: (6.14.10.4953)
VendorID: 0x00008086 DeviceID: 0x00002A42 SubsysID: 0x30DB103C Revision: 0x00000007
:display:wdxdisplay8(debug): _wcontext._window is 00000000
:express:clock(debug): Clock error detected; elapsed time 12.8724s on high-resolution counter, and 22.8434s on time-of-day clock.
Well, that suggests that itâs something in your graphics driver, not Panda3D itself. Maybe the graphics driver is trying to contact its host to look for updates or something freaky? Iâve never heard of graphics drivers that attempt to make an internet connection at startup, though. Might be worth checking for a newer version of your graphics driver from nvidia.com or ati.com or intel.com or whoever provides your card.
You could continue to use tinydisplay, of course, but visual quality and performance will suffer.
What do you mean âhorribly slowâ for pandadx9 and pandagl? More than seconds? Could it be the same issue?
Hmm, thatâs interesting, though Iâm not sure if itâs related to the problem. You shouldnât be seeing this kind of message unless âparanoid-clockâ is set on in some config.prc file. I donât see it mentioned above, though. Could it be set somewhere else? What do you get for âprint ConfigVariableBool(âparanoid-clockâ)â?
Err I just tried it again, and it seems to have gotten much better. pandagl is instantaneous, and pandadx9 takes ten seconds. Seems doubtful now whether itâs related to the main issue.
EDIT: So to summarize, pandagl/tinydisplay work well, pandadx9 takes 10 seconds, and pandadx8 takes 23 seconds. These numbers are all for when the Internet is connected. END EDIT
Cool-sounding idea. Two copy/pastes later:
C:\Workspace\...\src>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from pandac.PandaModules import *
>>> print ConfigVariableBool('paranoid-clock')
ConfigVariable paranoid-clock:
paranoid-clock 1 (from /c/Panda3D-1.6.2/etc/Confauto.prc)
paranoid-clock 0 (default value)
Here is the relevant section of Confauto.prc:
# The following two lines are a fix for flaky hardware clocks.
lock-to-one-cpu #t
paranoid-clock 1
I changed the value of paranoid-clock to 0, #f, and finally commented out the whole line, but with no luck. Note that I ran it using pandadx8.
Right, removing the paranoid-clock line would remove that error message from your output (and remove the corresponding clock fix-up that happens internally), but probably that wasnât related to your lockup. Although the fact that it does produce an error message is interesting, and means your clock is doing something wonky there.
I wonder if (with paranoid-clock back in) you would still get that clock error message when running with tinydisplay? If you donât, it does suggest that something in your graphics driver is doing something funny not only with the network, but with the clock, which would be weird.