From d4a3d303a62a13df802aff4c549efe94dad4b192 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Fri, 30 Oct 2009 13:45:26 +0000 Subject: [PATCH] Test macros for finding reason of stall problem with Pioneer DVD-216D on DVD-R --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/libburn.h | 22 ++++++++++++++++++++++ libburn/trunk/libburn/mmc.c | 7 +++++++ libburn/trunk/libburn/sg-linux.c | 6 ++++++ libburn/trunk/libburn/spc.c | 22 +++++++--------------- 5 files changed, 43 insertions(+), 16 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index e49304a1..5a2b37a4 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2009.10.27.101031" +#define Cdrskin_timestamP "2009.10.30.134640" diff --git a/libburn/trunk/libburn/libburn.h b/libburn/trunk/libburn/libburn.h index 545e38b5..f579c7a5 100644 --- a/libburn/trunk/libburn/libburn.h +++ b/libburn/trunk/libburn/libburn.h @@ -2749,4 +2749,26 @@ BURN_END_DECLS #endif + +/* Temporary facility for exploring Problems with Pioneer DVR-216D which + does not end writing of DVD-R. + This code does not hamper normal operations but causes some extra + messages to stderr and lots of text lines in File + /tmp/libburn_sg_command_log + + Move the next line outside this remark and remove all blanks up to "define". + # define Libburn_pioneer_dvr_216d_tesT 1 +*/ + +/* Temporary facility to disable asynchronous execution of the final buffer + flush command SYNCHRONIZE CACHE. This is suspected to cycle endlessly + on Pioneer DVR-216D. + On the other hand, synchronous execution of the command blocks a P-ATA + controller for both eventually connected devices. + + Move the next line outside this remark and remove all blanks up to "define". + # Libburn_pioneer_dvr_sync_not_immeD 1 +*/ + + #endif /*LIBBURN_H*/ diff --git a/libburn/trunk/libburn/mmc.c b/libburn/trunk/libburn/mmc.c index f7884d01..cc703879 100644 --- a/libburn/trunk/libburn/mmc.c +++ b/libburn/trunk/libburn/mmc.c @@ -2823,7 +2823,9 @@ void mmc_sync_cache(struct burn_drive *d) */ c.retry = 1; +#ifndef Libburn_pioneer_dvr_sync_not_immeD c.opcode[1] |= 2; /* ts A70918 : Immed */ +#endif c.page = NULL; c.dir = NO_TRANSFER; @@ -2852,7 +2854,12 @@ void mmc_sync_cache(struct burn_drive *d) d->cancel = 1; return; } + +#ifdef Libburn_pioneer_dvr_216d_tesT + if (spc_wait_unit_attention(d, 300, "SYNCHRONIZE CACHE", 0) <= 0) +#else if (spc_wait_unit_attention(d, 3600, "SYNCHRONIZE CACHE", 0) <= 0) +#endif d->cancel = 1; else d->needs_sync_cache = 0; diff --git a/libburn/trunk/libburn/sg-linux.c b/libburn/trunk/libburn/sg-linux.c index 622dafd8..99a3bd61 100644 --- a/libburn/trunk/libburn/sg-linux.c +++ b/libburn/trunk/libburn/sg-linux.c @@ -1655,6 +1655,12 @@ int sg_release(struct burn_drive *d) #define Libburn_log_sg_command_stderR 1 */ +#ifdef Libburn_pioneer_dvr_216d_tesT +#define Libburn_log_sg_commandS 1 +#define Libburn_fflush_log_sg_commandS 1 +#endif + + #ifdef Libburn_log_sg_commandS /** Logs command (before execution) */ diff --git a/libburn/trunk/libburn/spc.c b/libburn/trunk/libburn/spc.c index 73d8bb6e..0f66ebbc 100644 --- a/libburn/trunk/libburn/spc.c +++ b/libburn/trunk/libburn/spc.c @@ -113,11 +113,13 @@ int spc_wait_unit_attention(struct burn_drive *d, int max_sec, char *cmd_text, for(i = !(flag & 1); i < max_sec * 10; i++) { ret = spc_test_unit_ready_r(d, &key, &asc, &ascq); -/* <<< - fprintf(stderr, +#ifdef Libburn_pioneer_dvr_216d_tesT + if ((i % 100) == 1) + fprintf(stderr, "libburn_EXPERIMENTAL: i= %d ret= %d key= %X asc= %2.2X ascq= %2.2X\n", - i, ret, (unsigned) key, (unsigned) asc, (unsigned) ascq); -*/ + i, ret, (unsigned) key, + (unsigned) asc, (unsigned) ascq); +#endif /* Libburn_pioneer_dvr_216d_tesT */ if (ret > 0) /* ready */ break; @@ -140,24 +142,14 @@ int spc_wait_unit_attention(struct burn_drive *d, int max_sec, char *cmd_text, /* media change notice = try again */ goto slumber; -#ifdef NIX - sprintf(msg, - "Asynchromous SCSI error on %s: key=%X asc=%2.2Xh ascq=%2.2Xh", - cmd_text, (unsigned) key, (unsigned) asc, - (unsigned) ascq); -#else - /* ts A90213 */ sprintf(msg, - "Asynchromous SCSI error on %s: ", cmd_text); + "Asynchronous SCSI error on %s: ", cmd_text); sense[2] = key; sense[12] = asc; sense[13] = ascq; resp = scsi_error_msg(d, sense, 14, msg + strlen(msg), &key, &asc, &ascq); - -#endif /* ! NIX */ - libdax_msgs_submit(libdax_messenger, d->global_index, 0x0002014d, LIBDAX_MSGS_SEV_SORRY, LIBDAX_MSGS_PRIO_HIGH,