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

Request for some more callbacks
http://www.starburnsoftware.com/forum/starburn-sdk-f3/request-for-some-more-callbacks-t1478.html
Page 1 of 1

Author:  alpinesoft [ Tue Jun 24, 2008 7:39 pm ]
Post subject:  Request for some more callbacks

Hi,

Greetings from sunny Britain. It really is, actually, just for once. Anyway, is there any prospect of having some additional callbacks when burning a CD (or DVD):
- preparing, with the estimated number of blocks to be written
- closing a session, also with the estimated number of blocks to be written

And, when erasing, would it be possible to have the estimated number of blocks to be written notified to the callback routine.

My reason for asking for these is that I like to tell the user that these things are happening and roughly how long they will take.

Many thanks,

Author:  anton (staff) [ Wed Jun 25, 2008 5:17 pm ]
Post subject:  Re: Request for some more callbacks

With the close session and erase it's more or less possible, but I'm not sure what do you mean under "preparing"... Preparing for WHAT? :)

alpinesoft wrote:
Hi,

Greetings from sunny Britain. It really is, actually, just for once. Anyway, is there any prospect of having some additional callbacks when burning a CD (or DVD):
- preparing, with the estimated number of blocks to be written
- closing a session, also with the estimated number of blocks to be written

And, when erasing, would it be possible to have the estimated number of blocks to be written notified to the callback routine.

My reason for asking for these is that I like to tell the user that these things are happening and roughly how long they will take.

Many thanks,

Author:  alpinesoft [ Thu Jun 26, 2008 12:36 pm ]
Post subject: 

Hi,

Yes, good question, I'm not sure either. But IMAPI has a notification for it (IDiscMasterProgressEvents::NotifyPreparingBurn (long nEstimatedSeconds) (which does get called) and I noticed that when burning an SAO disc Starburn issues one CN_CDVD_WRITE_PROGRESS callback immediately but then does not issue another one for quite a while (several seconds). Perhaps you can educate me as to what might be going on here.

In fact, now I think things over a bit more, I'd like to modify my request slightly. I try to estimate the time that will be needed for all phases of a burn (including erase, if appropriate) before I start. I then add these up and display an 'approximate time to go' figure, and I then do my best to keep that up to date as things progress.

But to do this, I need to know how long each phase will take 'up front'. I currently guesstimate these, based on timings I have actually measured, but this varies from drive to drive, and also on whether you are burning a write-once or a rewriteable disc, whether the disc already contains data, whether you plan to finalise it, whether it is an audio disc or a data disc, etc. etc.

At the risk of boring you, here's a code snippet to try and explain what I am up to (my estimates are expressed in CD blocks, rather than seconds):

Code:
// As returned by GetBlockCounts
typedef struct
{
    int erase_blocks;               // for estimating burn times
    int prepare_blocks;
    int close_blocks;
} CDB_BLOCK_COUNTS;

// Returns timings (in blocks) for erase, prepare and close session
// Close blocks are a slight over-estimate
int CDBurnerStarBurn::GetBlockCounts (int image_type, int media_type,
    int burn_mode, bool multi_session, CDB_BLOCK_COUNTS *block_counts)
{

    ...

    if (image_type == CDB_AUDIO_CD)                     // Audio CD
    {                                                   // @ 4x (= 4 x 75 blks per sec)
        switch (burn_mode)
        {
            case CDB_BURNMODE_TAO:
                block_counts->close_blocks = 28000;
                break;
            case CDB_BURNMODE_SAO:
                block_counts->prepare_blocks = 13500;
                block_counts->close_blocks = 16000;
                break;
            case CDB_BURNMODE_DAO_PQ:
                block_counts->prepare_blocks = 16000;
                block_counts->close_blocks = 12000;
                break;
            case CDB_BURNMODE_DAO_RAWPW:
                block_counts->prepare_blocks = 13500;
                block_counts->close_blocks = 12000;
                break;
        }
    }
    else                                                // Joliet CD / DVD (always TAO)
    {
        if (is_cd)                                      // CDR(W) @ 4x (= 4 x 75 blks per sec)
            block_counts->close_blocks = (multi_session) ? 14000 : 28000;
        else
        {
            if (media_type == CDB_MEDIA_DVDR)           // DVDR @ 8x (= 72 x 75 blks per sec)
            {
                block_counts->prepare_blocks = 150000;
                block_counts->close_blocks = 100000;
            }
            else                                        // DVDRW @ 4x (= 36 x 75 blks per sec)
            {
                block_counts->prepare_blocks = 60000;
                block_counts->close_blocks = 100000;
            }
        }
    }
}


Perhaps I am trying a bit too hard with this. There are a lot of variables and actual (as opposed to promised) write speeds seem to vary a lot. But maybe StarBurn can provide better estimates than my hard-coded numbers as it knows a bit more about what is going on behind the scenes.

Anyway, what I have works, up to a point. Thanks for listening.

Author:  anton (staff) [ Fri Jun 27, 2008 9:51 am ]
Post subject: 

Actually you know both burning speed and burning data amount. So calculate erase (short and long) and close session (lead-in fixation) time is trivial.

Author:  alpinesoft [ Fri Jun 27, 2008 10:15 am ]
Post subject: 

Hi,

OK, but I have to guess burning amount so my figures are probably wrong. Perhaps you could consider adding an API similar to my 'GetBlockCounts' method to return this information for the currently loaded media at the currently selected write speed. I would think people would prefer times to be returned in seconds, rather than the slightly weird way I do it.

Thanks again for a great product.

Author:  anton (staff) [ Mon Jun 30, 2008 1:38 pm ]
Post subject: 

OK, sounds good.

alpinesoft wrote:
Hi,

OK, but I have to guess burning amount so my figures are probably wrong. Perhaps you could consider adding an API similar to my 'GetBlockCounts' method to return this information for the currently loaded media at the currently selected write speed. I would think people would prefer times to be returned in seconds, rather than the slightly weird way I do it.

Thanks again for a great product.

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