diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index 62242d06..d7f5d7ab 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2011.12.28.152153" +#define Cdrskin_timestamP "2011.12.30.142742" diff --git a/libburn/trunk/libburn/mmc.c b/libburn/trunk/libburn/mmc.c index b4550ecd..9d378806 100644 --- a/libburn/trunk/libburn/mmc.c +++ b/libburn/trunk/libburn/mmc.c @@ -873,6 +873,30 @@ void mmc_write_12(struct burn_drive *d, int start, struct buffer *buf) } +#ifdef Libburn_write_time_debuG + +static int print_time(int flag) +{ + static struct timeval prev = {0, 0}; + struct timeval now; + struct timezone tz; + int ret, diff; + + ret = gettimeofday(&now, &tz); + if (ret == -1) + return 0; + if (now.tv_sec - prev.tv_sec < Libburn_scsi_write_timeouT) { + diff = (now.tv_sec - prev.tv_sec) * 1000000 + + ((int) (now.tv_usec) - (int) prev.tv_usec); + fprintf(stderr, "\nlibburn_DEBUG: %d.%-6d : %d\n", (int) now.tv_sec, (int) now.tv_usec, diff); + } + memcpy(&prev, &now, sizeof(struct timeval)); + return 1; +} + +#endif /* Libburn_write_time_debuG */ + + int mmc_write(struct burn_drive *d, int start, struct buffer *buf) { int cancelled; @@ -880,6 +904,10 @@ int mmc_write(struct burn_drive *d, int start, struct buffer *buf) int len, key, asc, ascq; char *msg = NULL; +#ifdef Libburn_write_time_debuG + extern int burn_sg_log_scsi; +#endif + c = &(d->casual_command); #ifdef Libburn_log_in_and_out_streaM @@ -925,6 +953,11 @@ int mmc_write(struct burn_drive *d, int start, struct buffer *buf) if(d->wait_for_buffer_free) mmc_wait_for_buffer_free(d, buf); +#ifdef Libburn_write_time_debuG + if (burn_sg_log_scsi & 3) + print_time(0); +#endif + /* ts A80412 */ if(d->do_stream_recording > 0 && start >= d->stream_recording_start) { diff --git a/libburn/trunk/libburn/spc.c b/libburn/trunk/libburn/spc.c index cc58f0d9..d2925374 100644 --- a/libburn/trunk/libburn/spc.c +++ b/libburn/trunk/libburn/spc.c @@ -1671,8 +1671,18 @@ int scsi_eval_cmd_outcome(struct burn_drive *d, struct command *c, void *fp, if (outcome == RETRY && c->retry && !(flag & 1)) { /* Calming down retries and breaking up endless cycle */ - usleep_time = Libburn_scsi_retry_usleeP + - loop_count * Libburn_scsi_retry_incR; + if (c->opcode[0] == 0x2A || c->opcode[0] == 0xAA) { + /* WRITE(10) , WRITE(12) */ + usleep_time = Libburn_scsi_write_retry_usleeP + + loop_count * Libburn_scsi_write_retry_incR; + if (usleep_time > Libburn_scsi_write_retry_umaX) + usleep_time = Libburn_scsi_write_retry_umaX; + } else { + usleep_time = Libburn_scsi_retry_usleeP + + loop_count * Libburn_scsi_retry_incR; + if (usleep_time > Libburn_scsi_retry_umaX) + usleep_time = Libburn_scsi_retry_umaX; + } if (time(NULL) + usleep_time / 1000000 - start_time > timeout_ms / 1000 + 1) { BURN_ALLOC_MEM(msg, char, 320); @@ -1688,7 +1698,8 @@ int scsi_eval_cmd_outcome(struct burn_drive *d, struct command *c, void *fp, } if (d->cancel) {done = 1; goto ex;} - usleep(usleep_time); + if (usleep_time > 0) + usleep(usleep_time); if (d->cancel) {done = 1; goto ex;} if (burn_sg_log_scsi & 3) diff --git a/libburn/trunk/libburn/spc.h b/libburn/trunk/libburn/spc.h index 28467d6c..bf51517a 100644 --- a/libburn/trunk/libburn/spc.h +++ b/libburn/trunk/libburn/spc.h @@ -111,12 +111,20 @@ int scsi_eval_cmd_outcome(struct burn_drive *d, struct command *c, void *fp_in, int duration, time_t start_time, int timeout_ms, int loop_count, int flag); + /* The waiting time before eventually retrying a failed SCSI command. Before each retry wait Libburn_scsi_retry_incR longer than with - the previous one. + the previous one. At most wait for Libburn_scsi_retry_umaX microseconds. */ #define Libburn_scsi_retry_usleeP 100000 #define Libburn_scsi_retry_incR 100000 +#define Libburn_scsi_retry_umaX 500000 + +/* The retry waiting time for commands WRITE(10) and WRITE(12). +*/ +#define Libburn_scsi_write_retry_usleeP 0 +#define Libburn_scsi_write_retry_incR 2000 +#define Libburn_scsi_write_retry_umaX 25000 /* ts B11124 */