Date: Sat, 15 Sep 2001 11:26:05 +0200 (CEST) From: Søren Schmidt <sos@freebsd.dk> To: "Brian F. Feldman" <green@FreeBSD.ORG> Cc: current@FreeBSD.ORG Subject: Re: can't write CD-Rs with or without new DAO mode Message-ID: <200109150926.f8F9Q5788433@freebsd.dk> In-Reply-To: <200109131544.f8DFiDG02475@green.bikeshed.org> "from Brian F. Feldman at Sep 13, 2001 11:44:13 am"
next in thread | previous in thread | raw e-mail | index | archive | help
It seems Brian F. Feldman wrote: > Søren Schmidt <sos@freebsd.dk> wrote: > > It seems Brian Fundakowski Feldman wrote: > > > After updating my system I can't burn CD-Rs successfully. Can anyone else? > > > What happens is pretty simple: > > > > > > {"/home/green/toxicity"}$ burncd -s 8 -d audio /dev/null $(ls | trackclassify > > > > burncd: ioctl(CDRIOCINITWRITER): Input/output error > > > acd0: MODE_SELECT_BIG - ILLEGAL REQUEST asc=0x26 ascq=0x00 error=0x00 > > > > Are you absolutely sure your kernel & userland are in sync ? > recompiling burncd to the exact same effect. OK, try this patch (kernel & burncd need both to be remade) Index: sys/dev/ata/atapi-cd.c =================================================================== RCS file: /home/ncvs/src/sys/dev/ata/atapi-cd.c,v retrieving revision 1.100 diff -u -r1.100 atapi-cd.c --- sys/dev/ata/atapi-cd.c 10 Sep 2001 11:43:20 -0000 1.100 +++ sys/dev/ata/atapi-cd.c 15 Sep 2001 08:25:55 -0000 @@ -1407,9 +1407,7 @@ static int acd_init_writer(struct acd_softc *cdp, int test_write) { - struct write_param param; int8_t ccb[16]; - int error; bzero(ccb, sizeof(ccb)); ccb[0] = ATAPI_REZERO; @@ -1417,23 +1415,7 @@ ccb[0] = ATAPI_SEND_OPC_INFO; ccb[1] = 0x01; atapi_queue_cmd(cdp->atp, ccb, NULL, 0, ATPR_F_QUIET, 30, NULL, NULL); - - if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE, - (caddr_t)¶m, sizeof(param)))) - return error; - param.data_length = 0; - param.page_code = ATAPI_CDROM_WRITE_PARAMETERS_PAGE; - param.page_length = 0x32; - param.test_write = test_write ? 1 : 0; - param.write_type = CDR_WTYPE_SESSION; - param.session_type = CDR_SESS_NONE; - param.fp = 0; - param.packet_size = 0; - param.track_mode = CDR_TMODE_AUDIO; - param.datablock_type = CDR_DB_RAW; - param.session_format = CDR_SESS_CDROM; - - return acd_mode_select(cdp, (caddr_t)¶m, param.page_length + 10); + return 0; } static int @@ -1613,6 +1595,7 @@ static int acd_send_cue(struct acd_softc *cdp, struct cdr_cuesheet *cuesheet) { + struct write_param param; int8_t ccb[16] = { ATAPI_SEND_CUE_SHEET, 0, 0, 0, 0, 0, cuesheet->len>>16, cuesheet->len>>8, cuesheet->len, 0, 0, 0, 0, 0, 0, 0 }; @@ -1621,6 +1604,24 @@ #ifdef ACD_DEBUG int i; #endif + + if ((error = acd_mode_sense(cdp, ATAPI_CDROM_WRITE_PARAMETERS_PAGE, + (caddr_t)¶m, sizeof(param)))) + return error; + param.data_length = 0; + param.page_code = ATAPI_CDROM_WRITE_PARAMETERS_PAGE; + param.page_length = 0x32; + param.test_write = cuesheet->test_write ? 1 : 0; + param.write_type = CDR_WTYPE_SESSION; + param.session_type = CDR_SESS_NONE; + param.fp = 0; + param.packet_size = 0; + param.track_mode = CDR_TMODE_AUDIO; + param.datablock_type = CDR_DB_RAW; + param.session_format = CDR_SESS_CDROM; + if ((error = acd_mode_select(cdp, (caddr_t)¶m, param.page_length + 10))) + return error; + buffer = malloc(cuesheet->len, M_ACD, M_NOWAIT); if (!buffer) return ENOMEM; Index: sys/sys/cdrio.h =================================================================== RCS file: /home/ncvs/src/sys/sys/cdrio.h,v retrieving revision 1.4 diff -u -r1.4 cdrio.h --- sys/sys/cdrio.h 10 Sep 2001 11:42:27 -0000 1.4 +++ sys/sys/cdrio.h 15 Sep 2001 08:19:38 -0000 @@ -71,6 +71,7 @@ struct cdr_cuesheet { int32_t len; struct cdr_cue_entry *entries; + int test_write; }; #define CDRIOCBLANK _IOW('c', 100, int) Index: usr.sbin/burncd/burncd.c =================================================================== RCS file: /home/ncvs/src/usr.sbin/burncd/burncd.c,v retrieving revision 1.16 diff -u -r1.16 burncd.c --- usr.sbin/burncd/burncd.c 11 Sep 2001 12:14:20 -0000 1.16 +++ usr.sbin/burncd/burncd.c 15 Sep 2001 08:19:07 -0000 @@ -58,7 +58,7 @@ static int fd, quiet, verbose, saved_block_size, notracks; void add_track(char *, int, int); -void do_DAO(void); +void do_DAO(int); void do_TAO(int, int); int write_file(struct track_info *); int roundup_blocks(struct track_info *); @@ -245,7 +245,7 @@ cdopen = 1; } if (dao) - do_DAO(); + do_DAO(test_write); else do_TAO(test_write, preemp); } @@ -308,7 +308,7 @@ } void -do_DAO(void) +do_DAO(int test_write) { struct cdr_cuesheet sheet; struct cdr_cue_entry cue[100]; @@ -390,6 +390,7 @@ sheet.len = j * 8; sheet.entries = cue; + sheet.test_write = test_write; if (verbose) { u_int8_t *ptr = (u_int8_t *)sheet.entries; @@ -404,9 +405,10 @@ if (ioctl(fd, CDRIOCSENDCUE, &sheet) < 0) err(EX_IOERR, "ioctl(CDRIOCSENDCUE)"); - +#if 0 if (ioctl(fd, CDRIOCNEXTWRITEABLEADDR, &addr) < 0) err(EX_IOERR, "ioctl(CDRIOCNEXTWRITEABLEADDR)"); +#endif for (i = 0; i < notracks; i++) { if (write_file(&tracks[i])) err(EX_IOERR, "write_file"); -Søren To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200109150926.f8F9Q5788433>