From 4b30530f52353b0d309402f71799007fedffed9a Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Thu, 5 Nov 2009 17:03:01 +0000 Subject: [PATCH] Test macros for double START UNIT and SET CD SPEED --- libburn/trunk/cdrskin/cdrskin_timestamp.h | 2 +- libburn/trunk/libburn/libburn.h | 15 +++++++++++++++ libburn/trunk/libburn/mmc.c | 16 +++++++++++++++- libburn/trunk/libburn/sbc.c | 16 ++++++++++++++++ libburn/trunk/libburn/transport.h | 1 + libburn/trunk/libburn/write.c | 7 ++++++- 6 files changed, 54 insertions(+), 3 deletions(-) diff --git a/libburn/trunk/cdrskin/cdrskin_timestamp.h b/libburn/trunk/cdrskin/cdrskin_timestamp.h index eca80109..1bb980da 100644 --- a/libburn/trunk/cdrskin/cdrskin_timestamp.h +++ b/libburn/trunk/cdrskin/cdrskin_timestamp.h @@ -1 +1 @@ -#define Cdrskin_timestamP "2009.11.04.084506" +#define Cdrskin_timestamP "2009.11.05.170409" diff --git a/libburn/trunk/libburn/libburn.h b/libburn/trunk/libburn/libburn.h index 0da7b162..11f68882 100644 --- a/libburn/trunk/libburn/libburn.h +++ b/libburn/trunk/libburn/libburn.h @@ -2769,5 +2769,20 @@ BURN_END_DECLS # define Libburn_pioneer_dvr_216d_with_opC 1 */ +/* Experiment for problems with Pioneer DVR-216D: + After starting unit asynchronously issue again a synchronous START UNIT. + Issue an extra START UNIT pair before reserving the track. + + Move the next line outside this remark and remove all blanks up to "define". + # define Libburn_pioneer_dvr_216d_double_starT 1 +*/ + +/* Experiment for problems with Pioneer DVR-216D: + Set speed not only via SET STREAMING but also via SET CD SPEED. + + Move the next line outside this remark and remove all blanks up to "define". + # define Libburn_pioneer_dvr_216d_set_cd_speeD 1 +*/ + #endif /*LIBBURN_H*/ diff --git a/libburn/trunk/libburn/mmc.c b/libburn/trunk/libburn/mmc.c index b2e7b7ad..14c4a674 100644 --- a/libburn/trunk/libburn/mmc.c +++ b/libburn/trunk/libburn/mmc.c @@ -1766,11 +1766,16 @@ regard_as_blank:; return 0; } - /* ts A61217 : Note for future + /* ts A61217 : growisofs performs OPC if (data[0]<<8)|data[1]<=32 which indicates no OPC entries are attached to the reply from the drive. + ts A91104 : + Actually growisofs performs OPC only on DVD-R[W]. */ + d->num_opc_tables = 0; + if(((data[0] << 8) | data[1]) > 32) /* i.e. > 34 bytes are available */ + d->num_opc_tables = data[33]; /* ts A61219 : mmc5r03c.pdf 6.22.3.1.13 BG Format Status 0=blank (not yet started) @@ -2274,8 +2279,15 @@ void mmc_set_speed(struct burn_drive *d, int r, int w) /* ts A61221 : try to set DVD speed via command B6h */ if (strstr(d->current_profile_text, "DVD") == d->current_profile_text){ ret = mmc_set_streaming(d, r, w, end_lba); + +#ifdef Libburn_pioneer_dvr_216d_set_cd_speeD + if (ret < 0) + return; /* fatal failure */ +#else if (ret != 0) return; /* success or really fatal failure */ +#endif /* ! Libburn_pioneer_dvr_216d_set_cd_speeD */ + } /* ts A61112 : MMC standards prescribe FFFFh as max speed. @@ -3753,6 +3765,7 @@ int mmc_compose_mode_page_5(struct burn_drive *d, pd[4] = 8; +/* <<< did not help. A91104 */ #ifdef Libburn_pioneer_dvr_216d_lsv_onE pd[2] |= (1 << 5); /* LS_V = 1 */ pd[5] = 16; /* Link Size = 16 */ @@ -4270,6 +4283,7 @@ int mmc_setup_drive(struct burn_drive *d) d->needs_close_session = 0; d->needs_sync_cache = 0; d->bg_format_status = -1; + d->num_opc_tables = -1; d->last_lead_in = -2000000000; d->last_lead_out = -2000000000; d->disc_type = 0xff; diff --git a/libburn/trunk/libburn/sbc.c b/libburn/trunk/libburn/sbc.c index 3e005ddb..94e42de0 100644 --- a/libburn/trunk/libburn/sbc.c +++ b/libburn/trunk/libburn/sbc.c @@ -10,6 +10,10 @@ #include "spc.h" #include "options.h" +#ifdef Libburn_pioneer_dvr_216d_double_starT +#include +#endif + /* ts A70910 debug: for tracing calls which might use open drive fds @@ -95,6 +99,18 @@ int sbc_start_unit(struct burn_drive *d) /* ts A70918 : now asynchronous */ d->is_stopped = 0; ret = spc_wait_unit_attention(d, 1800, "START UNIT", 0); + +#ifdef Libburn_pioneer_dvr_216d_double_starT + fprintf(stderr, "libburn_DEBUG: Libburn_pioneer_dvr_216d_double_starT\n"); + scsi_init_command(&c, SBC_START_UNIT, sizeof(SBC_START_UNIT)); + c.retry = 1; + c.opcode[1] = 0; /* Not Immed */ + c.dir = NO_TRANSFER; + d->issue_command(d, &c); + if (c.error) + return 0; +#endif + return ret; } diff --git a/libburn/trunk/libburn/transport.h b/libburn/trunk/libburn/transport.h index d1132aa7..e9c04c34 100644 --- a/libburn/trunk/libburn/transport.h +++ b/libburn/trunk/libburn/transport.h @@ -220,6 +220,7 @@ struct burn_drive /* ts A61218 from 51h READ DISC INFORMATION */ int last_lead_in; int last_lead_out; + int num_opc_tables; /* ts A91104: -1= not yet known */ int bg_format_status; /* 0=needs format start, 1=needs format restart*/ int disc_type; /* 0="CD-DA or CD-ROM", 0x10="CD-I", 0x20="CD-ROM XA" */ unsigned int disc_id; /* a "32 bit binary integer" */ diff --git a/libburn/trunk/libburn/write.c b/libburn/trunk/libburn/write.c index 75541828..573394fa 100644 --- a/libburn/trunk/libburn/write.c +++ b/libburn/trunk/libburn/write.c @@ -1080,6 +1080,10 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o, /* ts A70214 : eventually adjust already expanded size of track */ burn_track_apply_fillup(s->track[tnum], d->media_capacity_remaining,1); +#ifdef Libburn_pioneer_dvr_216d_double_starT + d->start_unit(d); +#endif + if (o->write_type == BURN_WRITE_SAO) { /* DAO */ /* Round track size up to 32 KiB and reserve track */ size = ((off_t) burn_track_get_sectors(s->track[tnum])) @@ -1098,7 +1102,8 @@ int burn_disc_open_track_dvd_minus_r(struct burn_write_opts *o, } #ifdef Libburn_pioneer_dvr_216d_with_opC - if (!o->simulate) { + fprintf(stderr, "libburn_DEBUG: Libburn_pioneer_dvr_216d_with_opC : num_opc_tables = %d\n", d->num_opc_tables); + if (d->num_opc_tables <= 0 && !o->simulate) { fprintf(stderr, "libburn_DEBUG: Libburn_pioneer_dvr_216d_with_opC : performing OPC\n"); d->perform_opc(d); fprintf(stderr, "libburn_DEBUG: Libburn_pioneer_dvr_216d_with_opC : done\n");