Beginning to implement write code for BD-R SRM without POW

This commit is contained in:
Thomas Schmitt 2008-12-09 12:35:13 +00:00
parent d52ea49eb6
commit a5e2729604
6 changed files with 68 additions and 17 deletions

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2008.12.07.155219" #define Cdrskin_timestamP "2008.12.09.123314"

View File

@ -409,6 +409,11 @@ void burn_disc_format(struct burn_drive *drive, off_t size, int flag)
flag |= 4; /* format up to maximum size */ flag |= 4; /* format up to maximum size */
} else if (drive->current_profile == 0x12) { } else if (drive->current_profile == 0x12) {
ok = 1; /* DVD-RAM */ ok = 1; /* DVD-RAM */
} else if (drive->current_profile == 0x41) {
/* >>> BD-R SRM */
/* >>> check whether still unformatted */;
} else if (drive->current_profile == 0x43) { } else if (drive->current_profile == 0x43) {
ok = 1; /* BD-RE */ ok = 1; /* BD-RE */
} }

View File

@ -2246,8 +2246,9 @@ int burn_disc_get_multi_caps(struct burn_drive *d, enum burn_write_types wt,
o->might_do_sao = 4; o->might_do_sao = 4;
o->might_do_tao = 2; o->might_do_tao = 2;
o->advised_write_mode = BURN_WRITE_TAO; o->advised_write_mode = BURN_WRITE_TAO;
} else if (d->current_profile == 0x1b || d->current_profile == 0x2b) { } else if (d->current_profile == 0x1b || d->current_profile == 0x2b ||
/* DVD+R , DVD+R/DL */ d->current_profile == 0x41) {
/* DVD+R , DVD+R/DL , BD-R SRM */
o->multi_session = o->multi_track = 1; o->multi_session = o->multi_track = 1;
o->might_do_tao = 2; o->might_do_tao = 2;
o->might_do_sao = 1; o->might_do_sao = 1;

View File

@ -1137,7 +1137,8 @@ off_t burn_disc_available_space(struct burn_drive *d,
0x11 "DVD-R sequential recording", 0x12 "DVD-RAM", 0x11 "DVD-R sequential recording", 0x12 "DVD-RAM",
0x13 "DVD-RW restricted overwrite", 0x14 "DVD-RW sequential recording", 0x13 "DVD-RW restricted overwrite", 0x14 "DVD-RW sequential recording",
0x1a "DVD+RW", 0x1b "DVD+R", 0x1a "DVD+RW", 0x1b "DVD+R",
0x2b "DVD+R/DL", 0x43 "BD-RE", 0x2b "DVD+R/DL",
0x41 "BD-R sequential recording", 0x43 "BD-RE",
0xffff "stdio file" 0xffff "stdio file"
Note: 0xffff is not a MMC profile but a libburn invention. Note: 0xffff is not a MMC profile but a libburn invention.
If enabled by burn_allow_untested_profiles() it also writes to profiles If enabled by burn_allow_untested_profiles() it also writes to profiles
@ -1145,8 +1146,8 @@ off_t burn_disc_available_space(struct burn_drive *d,
Read-only are the profiles Read-only are the profiles
0x08 "CD-ROM", 0x10 "DVD-ROM", 0x08 "CD-ROM", 0x10 "DVD-ROM",
0x40 "BD-ROM", 0x40 "BD-ROM",
For now read-only are BD-R profiles (testers wanted) For now read-only is BD-R profile (testers wanted)
0x41 "BD-R sequential recording", 0x42 "BD-R random recording" 0x42 "BD-R random recording"
@param d The drive where the media is inserted. @param d The drive where the media is inserted.
@param pno Profile Number. See also mmc5r03c.pdf, table 89 @param pno Profile Number. See also mmc5r03c.pdf, table 89
@param name Profile Name (see above list, unknown profiles have empty name) @param name Profile Name (see above list, unknown profiles have empty name)

View File

@ -58,6 +58,9 @@ extern struct libdax_msgs *libdax_messenger;
/* ts A70509 : handling 0x41 and 0x42 as read-only types */ /* ts A70509 : handling 0x41 and 0x42 as read-only types */
#define Libburn_support_bd_r_readonlY 1 #define Libburn_support_bd_r_readonlY 1
/* >>> ts A81208 */
#define Libburn_support_bd_plus_r_srM 1
/* ts A80410 : <<< Dangerous experiment: Pretend that DVD-RAM is BD-RE /* ts A80410 : <<< Dangerous experiment: Pretend that DVD-RAM is BD-RE
# define Libburn_dvd_ram_as_bd_rE yes # define Libburn_dvd_ram_as_bd_rE yes
@ -119,6 +122,8 @@ extern struct libdax_msgs *libdax_messenger;
drive->do_stream_recording it does full nominal speed. drive->do_stream_recording it does full nominal speed.
ts A80506 : Giulio Orsero reports success with BD-RE formatting. ts A80506 : Giulio Orsero reports success with BD-RE formatting.
BD-RE is now an officially supported profile. BD-RE is now an officially supported profile.
ts A81209 : The first two sessions have been written to BD-R SRM
(auto formatted without Defect Management).
*/ */
/* ts A70519 : With MMC commands of data direction FROM_DRIVE: /* ts A70519 : With MMC commands of data direction FROM_DRIVE:
@ -1528,8 +1533,15 @@ static int mmc_read_disc_info_al(struct burn_drive *d, int *alloc_len)
#ifdef Libburn_support_bd_r_readonlY #ifdef Libburn_support_bd_r_readonlY
/* <<< For now: declaring BD-R read-only /* <<< For now: declaring BD-R read-only
*/ */
if (d->current_profile == 0x41 || d->current_profile == 0x42) { #ifndef Libburn_support_bd_plus_r_srM
/* BD-R seq, BD-R rnd */ if (d->current_profile == 0x41) {
/* BD-R seq as readonly dummy */
disc_status = 2; /* always full and finalized */
d->erasable = 0; /* never erasable */
}
#endif
if (d->current_profile == 0x42) {
/* BD-R rnd */
disc_status = 2; /* always full and finalized */ disc_status = 2; /* always full and finalized */
d->erasable = 0; /* never erasable */ d->erasable = 0; /* never erasable */
} }
@ -2239,7 +2251,11 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
d->current_is_supported_profile = 1; d->current_is_supported_profile = 1;
#ifdef Libburn_support_bd_r_readonlY #ifdef Libburn_support_bd_r_readonlY
if (cp == 0x41 || cp == 0x42) /* BD-R sequential, BD-R random */ #ifndef Libburn_support_bd_plus_r_srM
if (cp == 0x41) /* BD-R sequential (here as read-only dummy) */
d->current_is_supported_profile = 1;
#endif
if (cp == 0x42) /* BD-R random recording */
d->current_is_supported_profile = 1; d->current_is_supported_profile = 1;
#endif #endif
@ -2280,6 +2296,10 @@ static int mmc_get_configuration_al(struct burn_drive *d, int *alloc_len)
if (cp == 0x1b || cp == 0x2b) /* DVD+R , DVD+R/DL */ if (cp == 0x1b || cp == 0x2b) /* DVD+R , DVD+R/DL */
d->current_is_supported_profile = 1; d->current_is_supported_profile = 1;
#endif #endif
#ifdef Libburn_support_bd_plus_r_srM
if (cp == 0x41) /* BD-R SRM */
d->current_is_supported_profile = 1;
#endif
/* Enable this to get loud and repeated reports about the feature set : /* Enable this to get loud and repeated reports about the feature set :
#define Libburn_print_feature_descriptorS 1 #define Libburn_print_feature_descriptorS 1
@ -3440,8 +3460,9 @@ int mmc_compose_mode_page_5(struct burn_drive *d,
} else if (d->current_profile == 0x1a || d->current_profile == 0x1b || } else if (d->current_profile == 0x1a || d->current_profile == 0x1b ||
d->current_profile == 0x2b || d->current_profile == 0x12 || d->current_profile == 0x2b || d->current_profile == 0x12 ||
d->current_profile == 0x41 || d->current_profile == 0x42 ||
d->current_profile == 0x43) { d->current_profile == 0x43) {
/* not with DVD+R[W][/DL] or DVD-RAM or BD-RE */; /* not with DVD+R[W][/DL] or DVD-RAM or BD-R[E] */;
return 0; return 0;
} else { } else {
/* Traditional setup for CD */ /* Traditional setup for CD */

View File

@ -1005,8 +1005,10 @@ int burn_precheck_write(struct burn_write_opts *o, struct burn_disc *disc,
} else if (d->drive_role == 3 || } else if (d->drive_role == 3 ||
d->current_profile == 0x11 || d->current_profile == 0x14 || d->current_profile == 0x11 || d->current_profile == 0x14 ||
d->current_profile == 0x15 || d->current_profile == 0x15 ||
d->current_profile == 0x1b || d->current_profile == 0x2b ) { d->current_profile == 0x1b || d->current_profile == 0x2b ||
/* DVD-R* Sequential , DVD+R[/DL] , sequential stdio "drive" */ d->current_profile == 0x41) {
/* DVD-R* Sequential , DVD+R[/DL] , BD-R,
sequential stdio "drive" */
if (o->start_byte >= 0) if (o->start_byte >= 0)
strcat(reasons, "write start address not supported, "); strcat(reasons, "write start address not supported, ");
} else { } else {
@ -1106,6 +1108,10 @@ int burn_disc_open_track_dvd_plus_r(struct burn_write_opts *o,
if (o->write_type == BURN_WRITE_SAO && if (o->write_type == BURN_WRITE_SAO &&
! burn_track_is_open_ended(s->track[tnum])) { ! burn_track_is_open_ended(s->track[tnum])) {
/* Round track size up to 32 KiB and reserve track */ /* Round track size up to 32 KiB and reserve track */
/* ts A81208 */
/* >>> ??? round to 64 KiB for BD-R ? (It is not mandatory) */
size = ((off_t) burn_track_get_sectors(s->track[tnum])) size = ((off_t) burn_track_get_sectors(s->track[tnum]))
* (off_t) 2048; * (off_t) 2048;
size = (size + (off_t) 0x7fff) & ~((off_t) 0x7fff); size = (size + (off_t) 0x7fff) & ~((off_t) 0x7fff);
@ -1200,7 +1206,7 @@ int burn_disc_close_track_dvd_plus_r(struct burn_write_opts *o,
} }
/* ts A61218 - A70129 */ /* ts A61218 - A81208 */
int burn_dvd_write_track(struct burn_write_opts *o, int burn_dvd_write_track(struct burn_write_opts *o,
struct burn_session *s, int tnum, int is_last_track) struct burn_session *s, int tnum, int is_last_track)
{ {
@ -1224,6 +1230,11 @@ int burn_dvd_write_track(struct burn_write_opts *o,
ret = burn_disc_open_track_dvd_plus_r(o, s, tnum); ret = burn_disc_open_track_dvd_plus_r(o, s, tnum);
if (ret <= 0) if (ret <= 0)
goto ex; goto ex;
} else if (d->current_profile == 0x41) {
/* BD-R SRM */
ret = burn_disc_open_track_dvd_plus_r(o, s, tnum);
if (ret <= 0)
goto ex;
} }
sectors = burn_track_get_sectors(t); sectors = burn_track_get_sectors(t);
@ -1292,6 +1303,12 @@ int burn_dvd_write_track(struct burn_write_opts *o,
is_last_track); is_last_track);
if (ret <= 0) if (ret <= 0)
goto ex; goto ex;
} else if (d->current_profile == 0x41) {
/* BD-R SRM */
ret = burn_disc_close_track_dvd_plus_r(o, s, tnum,
is_last_track);
if (ret <= 0)
goto ex;
} }
ret = 1; ret = 1;
ex:; ex:;
@ -1408,6 +1425,8 @@ int burn_dvd_write_session(struct burn_write_opts *o,
} }
} else if (d->current_profile == 0x1b || d->current_profile == 0x2b) { } else if (d->current_profile == 0x1b || d->current_profile == 0x2b) {
/* DVD+R , DVD+R/DL do each track as an own session */; /* DVD+R , DVD+R/DL do each track as an own session */;
} else if (d->current_profile == 0x41) {
/* BD-R SRM do each track as an own session */;
} }
return 1; return 1;
} }
@ -1611,8 +1630,12 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
/* ??? padding needed ??? cowardly doing it for now */ /* ??? padding needed ??? cowardly doing it for now */
o->obs_pad = 1; /* fill-up track's last 32k buffer */ o->obs_pad = 1; /* fill-up track's last 32k buffer */
} else if (d->current_profile == 0x1b || d->current_profile == 0x2b) { } else if (d->current_profile == 0x1b || d->current_profile == 0x2b ||
/* DVD+R , DVD+R/DL */ d->current_profile == 0x41) {
/* DVD+R , DVD+R/DL , BD-R SRM */
/* >>> ts A81208 : with BD-R set o->obs to 64 kB ? */
t = disc->session[0]->track[0]; t = disc->session[0]->track[0];
o_end = ( burn_track_is_open_ended(t) && !o->fill_up_media ); o_end = ( burn_track_is_open_ended(t) && !o->fill_up_media );
default_size = burn_track_get_default_size(t); default_size = burn_track_get_default_size(t);
@ -1627,8 +1650,8 @@ int burn_dvd_write_sync(struct burn_write_opts *o,
} }
ret = burn_disc_setup_dvd_plus_r(o, disc); ret = burn_disc_setup_dvd_plus_r(o, disc);
if (ret <= 0) { if (ret <= 0) {
sprintf(msg, sprintf(msg, "Write preparation setup failed for %s",
"Write preparation setup failed for DVD+R"); d->current_profile == 0x41 ? "BD-R" : "DVD+R");
libdax_msgs_submit(libdax_messenger, d->global_index, libdax_msgs_submit(libdax_messenger, d->global_index,
0x00020121, 0x00020121,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH, LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,