CD Drive refuses to read CD's while Runtime active

Hi guys,
I just noticed today that while Blender runtimes are active, Windows can’t read a newly inserted disk. This is a big problem for me since my software requires the disk in to run. When the disk isn’t in, it prompts the user to insert it, but thats not a lot of use if they have to restart my program to read the disk. I’ve replicated the issue on XP too.

I didn’t notice the bug earlier because I’ve always used ISO’s on my development computer. For some reason, ISO’s do get picked up and read while the runtimes are active.

I’m using Blender 2.45 on Vista Business and XP Pro. Does anyone know what might be causing this or how I could fix it?

I’m positive it’s not the CD drive being broken because the CD becomes readable the moment I close the runtime. That and it did it on another computer too.

I’ve posted before about weird errors (that make no difference to the way it runs) testing Blender sims while the CD drive was burning, I’m wondering if its related.

Cheers,
Dave

PS
If anyone using 2.49 could try running a runtime, then try inserting a disk and being able to read it while the runtime is still running then please tell me, it could well be the last straw that forces us to update.

Why don’t you want to use 2.49? It has alot of new features and the bug might be solved

My project has over 20,000 lines of code in it with 52 scenes. That’s a bit much to change on the chance that this bug might be solved.

You could always make a test case that isolates the bug, then try running that on 2.49. I can understand not wanting to update, it can be a lot of work at times.

So, just to make sure I’m understanding you, you want to read the cd drive while a runtime is going to check and see if there is the right disc in it? I don’t know how much you can reveal, but could you at least explain the process you go through or show the code for the cd check? I think this would help. Or, make that test case and share the blend so we can play with it and find a way to get it working for you.

Cheers,
Moguri

Sure, I’ll go through it in more detail =) My disk check is quite simple really, it just checks the CD Label, its format, and if a hidden file is on it. Blender can read CD’s, and works fine if the disk is in the drive before starting the runtime.

My problem is when Blender is running, and then the disk is put in. You can try it yourself, try running a runtime and open up My Computer on another screen (or just over the top of the runtime). Then place a disk in the drive. If you’re getting the same issue as me then your CD will report an unreadable, unlabelled disk is there that can’t be viewed at all. Once the runtime closes the CD instantly reads like normal and aquires its correct label and icon. In other words its not my script not being able to read CD’s, not even Windows can.

I don’t mind updating if I can be 100% positive it’ll fix this issue. I’ll start making up a test for 2.49.

As requested, here is the code from the CD drive check.


def cd_drive_check():
 found = 0
 import os
 import win32api
 drives = win32api.GetLogicalDriveStrings().split(":")
 for i in drives:
  dr = i[-1].lower()
  if dr.isalpha():
   dr += ":\\"
   try:
    if win32api.GetVolumeInformation(dr)[-1].lower().endswith("cdfs") and win32api.GetVolumeInformation(dr)[0] == "CD_Name":
     path = dr[:1] + ":\XX.file"
     path2 = dr[:1] + ":\XY.file"
     path3 = dr[:1] + ":\XZ.file"
     if os.path.exists(path):
      found = 1  
     if os.path.exists(path2):
      found = 2
     if os.path.exists(path3):
      found = 3
   except:
    ignore = 1
 return found

We have 3 different editions of the software, thats why it checks if any of the three files are there. Simple I know… but it does the job. As I said before, that code functions fine if the disk is already in the drive before starting so I think its unlikely that it is the fault.

-edit-
I’ve tried it on 2.49 by just running the default scene, same issue.

Here are the steps I followed:

  • Opened Blender 2.49a on Windows7 RC
  • Using the default scene I press “p” to start the ge
  • I then put a cd into my drive and go to my computer
  • The disc loads up and I can read the contents

So, did I miss something, or is it just working for me? Have you tried this on other computers. Also, the Python looks okay. Except, instead of “ignore = 1”, why not just use “pass”?

Those are the right steps. Maybe I’m just unlucky with the hardware I’ve got here. I’ve only tried it in the two machines. This ones a Dell box with fairly new hardware (about a year old), Vista Business SP2. The other a Toshiba laptop running XP Pro, SP3 (about 4 years old). Both respond in exactly the same way. Sadly I can’t test it on Windows 7, but I’ll try to convince my work colleges to take it home and do trials too.

As for your question about my python… I didn’t know about ‘pass’ when I wrote it :slight_smile: I keep meaning to update the older code like that but there are other things higher on my todo list.