Rocket Division Software
http://www.starburnsoftware.com/forum/

Disk doesn't burn
http://www.starburnsoftware.com/forum/starburn-sdk-f3/disk-doesn-burn-t1979.html
Page 1 of 1

Author:  rsj [ Wed Oct 21, 2009 5:51 pm ]
Post subject:  Disk doesn't burn

I am using the StarBurnX COM object to burn CDs. The code had been working, but I went in and was adjusting it to fit StyleCop and FxCop format and now it does not work. I have used the sample CD Burning project to verify that my CD burner is working. The burn produces progress, and even verifies, but the file is not being written to disk. I am not burning a test track (I don't think. I hard-coded that to false).

The setup code is as follows:

private void BurnBackup()
{
_dataBurner.AddFile("C:\\Temp\\Test.bak");

// Collect information about the current selected drive
_dataBurner.NextSessionAllowed = false;

DriveInfo driveInfo = _dataBurner.Drive.DriveInfo;

driveInfo.Refresh();

// Set the selected write speed
_dataBurner.WriteSpeed = driveInfo.WriteSpeed;

// Test, whether drive is ready to burn
if (_dataBurner.Drive.State != STARBURN_DRIVE_STATE.STARBURN_DRIVE_STATE_READY)
{

MessageBox.Show("Not ready to burn!");
return;
}

// Set the burn method
_dataBurner.Mode = STARBURN_WRITE_MODE.STARBURN_WRITE_MODE_AUTO;

// Lock Tray
_dataBurner.LockTray = true;

// Start thread
Thread burningThread = new Thread(new ThreadStart(DoBurn));
burningThread.Start();
}

the DoBurn is as follows:


protected void DoBurn()
{
// Do burning
try
{
_dataBurner.Burn(false, DEF_VOLUME_NAME, "StarBurnX", "StarBurnX Data Burner");
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}

I receive progress, and the CD verifies, but the file is not written to the CD.

Any help would be appreciated. Thanks.

Author:  anton (staff) [ Wed Oct 21, 2009 6:44 pm ]
Post subject:  Re: Disk doesn't burn

I'm not a big StarBurnX expert so please provide us with StarBurn debug log. It's gonna help more then your source snippet ))

Author:  rsj [ Thu Oct 22, 2009 11:39 am ]
Post subject:  Re: Disk doesn't burn

Log file:
=================================================

< Junk removed by Moderator >

=======================================================
With logging enabled, the process will not exit. Without logging, I get a COM exception when the process exits (after burning is supposedly done).

Thanks.

Author:  anton (staff) [ Thu Oct 22, 2009 11:45 am ]
Post subject:  Re: Disk doesn't burn

starburn-sdk-f3/logs-forum-messages-please-t741.html

Author:  rsj [ Thu Oct 22, 2009 12:04 pm ]
Post subject:  Re: Disk doesn't burn

I am going to try to attach the file. It is too large to paste into a reply.

Attachments:
StarBurn.zip [8.77 KiB]
Downloaded 712 times

Author:  anton (staff) [ Thu Oct 22, 2009 12:15 pm ]
Post subject:  Re: Disk doesn't burn

I see a lot of strange things you do... You burn then you try to verify (w/o closing session) then you close session. It's not gonna work... Did you manage to build any shipped with StarBurn SDK samples (StarBurnX ones) and burn with them?

Author:  rsj [ Thu Oct 22, 2009 2:02 pm ]
Post subject:  Re: Disk doesn't burn

I am doing the verify synchronously. I can make that asynchronous if it needs to be. I commented out the entire verify code, and I am still not getting my file to burn properly. I have another issue that has cropped up since I enabled logging. The process that I've written will not terminate after I burn the backup. I have to stop the process using the debugger. I think that this is simply another symptom to the problem, as the C# example that comes with the StarBurn SDK will terminate properly.

Any assistence would be appreciated. Thanks.

Author:  anton (staff) [ Thu Oct 22, 2009 4:10 pm ]
Post subject:  Re: Disk doesn't burn

You cannot verify content before you finalize the disc. So you need to:

1) Burn data
2) Close the disc
3) Run verify sequence (does not matter sync or async)

Please check your code and I'll ask Dima to make sure it's not StarBurnX wrapper issue.

Thanks!

Author:  rsj [ Thu Oct 22, 2009 5:31 pm ]
Post subject:  Re: Disk doesn't burn

I have looked in both the C# example and VB.Net example and I can't find in either where the data burner explicitly closes the disk. Both examples use asynchronous threads to write and verify the disks. I have modified my code to follow this pattern and it is working, but I want to make sure there isn't something that I am missing.

Something is keeping the file that I am writing to disk in use. I can't overwrite it or delete it after I've burned the disk until I close the process down. That would potentially be caused by the same thing, not explicitly closing the disk.

Thanks.

Author:  anton (staff) [ Thu Oct 22, 2009 10:57 pm ]
Post subject:  Re: Disk doesn't burn

1) I'll ask Dima (StarBurnX & .NET wrapper and samples developer) to check your project source this Monday.

2) If you have files locked this means component tree object was not destroyed.

Author:  dima (staff) [ Mon Oct 26, 2009 4:36 pm ]
Post subject:  Re: Disk doesn't burn

Hello,

1) Yes, you cannot delete/modify files after you have burned these files on disc but you can burn these files on different discs ( many times)!
2) Files will stay locked until the DataBurner instance is not destroyed!
3) Do not call the Verify process until the burner thread is not finished! Session will be closed automatically! ( see the OnCloseSessionBegin & OnCloseSessionEnd events ).
4) Disc will be finalized if value of the property NextSessionAllowed is false!

Regards,

Dmitry

Author:  rsj [ Mon Oct 26, 2009 5:50 pm ]
Post subject:  Re: Disk doesn't burn

Dmitry,

Hello. I think we are missing each other's meanings somehow. What I am trying to do is close the session. I need to be able to use this instance of the databurner (or another instance, I don't care) to add new files and burn new disks. Think of a system that occasionally will burn a database backup to CD. The system will continue to operate while the backup is burned and when it is finished. The burning process itself will not close. I am using the DataBurner class to do my burning with. I can add files, but only when the class is first instanciated. It will burn the first time through just fine. Then I need to verify that the files successfully burned. It is fine if this finalizes the disk as well. Nothing more will be burned on this disk.

If I need to dispose of the databurner class I can, but it does not implement the Dispose pattern or IDisposible. Do I need to do anything other than set it to null to dispose of it?

Nothing that I am working with has an OnCloseSessionBegin event to tie into. What class are you referring to? Should I be using a different class? I have to admit, I am somewhat confused. These seem like reasonable events for me to tap into, but the DataBurned class does not expose any such event, nor is such an event present in your help files. Your help file references an IUDFDataBurnerEvents::OnCloseSessionBegin, but all it says is "Do not modify the target object inside of this handler because it may cause deadlock !!"

In any event, what I need to be able to do is close out the session and be able to add files again. When I try right now I get an error "Wrong image State: Operation cannot be performed because the image tree is built!" Would destroying the databurner object help this? If so, how should I destroy it?

Thanks,

--Steve

Author:  dima (staff) [ Tue Oct 27, 2009 5:13 pm ]
Post subject:  Re: Disk doesn't burn

Hello,

1) StarBurnX objects don't implement IDisposable interface because the StarBurnX is COM! You work with StarBurnX through the "Interop" technique!

2) You MUST destroy the "dirty" DataBurner object ...

Marshal.ReleaseComObject(m_dataBurner);

m_dataBurner = null;

... and create new DataBurner object!!

3) The OnCloseSessionBegin & OnCloseSessionEnd events were recently added. You may try to load latest update of StarBurnX from our ftp site:

link was removed

1) Unpack & register new version of StarBurnX
2) Remove the RocketDivision.StarBurnX.Interop2 referense from you .NET application
3) Add reference on newly registered StarBurnX component :
[Add Reference ...]->[COM]->StarBurnX 10.0 Type library

Regards,

Dmitry

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/