[Libburn] TAO writing

Derek Foreman manmower@signalmarketing.com
Mon, 15 Dec 2003 15:59:48 -0600 (CST)


On Mon, 15 Dec 2003, Tiago Cogumbreiro wrote:

> Hello there,
> I've been trying to implement TAO writing but apparently my drive isn't
> working well with it (the red light never blinks) i am assuming the
> write commands are returning an error.

yay :/
libburn_set_verbosity(12); will dump insane amounts of debugging
information to console for you.  Do it just after initializing the lib.

Or if you're just using burniso as a test, --verbose 12

> I implemented TAO by doing the follwoing, skipping leads then adding a
> SYNC CACHE at the end of each track (it marks the end, thus drive gens
> leadout).

(that's not a leadout ;)

> When writing with TAO i had the following segfault:
>
> 0x0804cd84 in sector_subcodes (d=0x8053dc0, subcodes=0xbf5ef964 "",
>     t=0x8065e18, prelout=0) at libburn/sector.c:224
> 224             if ((t->entry->point == 1) && (d->rlba == -150))
> (gdb) bt
> #0  0x0804cd84 in sector_subcodes (d=0x8053dc0, subcodes=0xbf5ef964 "",
>     t=0x8065e18, prelout=0) at libburn/sector.c:224
> #1  0x0804d32e in sector_data (d=0x8053dc0, t=0x8065e18, prelout=0)
>     at libburn/sector.c:356
> #2  0x080503d5 in burn_write_track (d=0x8053dc0, o=0x8066018,
> t=0x8065e18,
>     pt=0x0, nt=0x0) at libburn/write.c:297
> #3  0x08050218 in burn_write_session (d=0x8053dc0, o=0x8066018,
> s=0x8063d18)
>     at libburn/write.c:243
> #4  0x08050677 in burn_disc_write_sync (d=0x8053dc0, disc=0x8065df8,
>     o=0x8066018) at libburn/write.c:375
> #5  0x080496c3 in write_disc_worker_func (w=0x8066050) at
> libburn/async.c:156
> #6  0x40029e31 in pthread_start_thread () from /lib/libpthread.so.0
>
> The problem is that track.entry is NULL. I did a "grep entry libburn/*"
> and found no entry doing "track->entry = foo" so i assum that this is a
> bug or an unimplemented feature.

Nope.  Your grep-fu is weak ;)

That stuff's set in write.c, burn_create_toc_entries
                tar[i]->entry = &e[3 + i];
is probably the line in particular.

> I don't understand where burn_toc_entry should be created but this
> prevents TAO from working, i've did a quick hack just to check what
> would happen if sector_subcodes wasn't called and the result was what
> i've said before, nothing happens in what concerns to writing.

sector subcodes will still be needed for certain blocktypes.

Ooh, here it is... burn_create_toc_entries is only called in write_leadin,
but you still need that data even when doing TAO.

> I have 2 questions hardcoded on the sourcecode:
> 1. In TAO mode when i finish burning a session and have another one to
> create should i call CLOSE SESSION?

Yes, which I haven't quite finished yet.

> 2. Shouldn't it be SUBCODE_SIZE instead of 96? can't we have 16 bytes
> buffer?
> 	if(t->source->read_sub)
> 		t->source->read_sub(t->source, data + 2352, 96);
> 	else
> 		sector_subcodes(d, data + 2352, t, prelout);

It'll depend on the bitfield |'d together with BURN_SECTORS, as soon as
I've got that done.

> Also the progress wasn't updating track number (my fault) so i've
> corrected that too.

Thanks

> I tried running burniso to burn raw audio to a cd (multiple tracks) but
> i had no success too. The tracks are added corrrectly because hey appear
> in the progress.
> I added each track with the following code:
> burn_track_define_data(tr, 0, 0, 0, BURN_SECTORS | BURN_AUDIO);
>
> And with the following burn options:
> o->perform_opc = 1;
> o->write_type = BURN_WRITE_RAW;
> o->block_type = BURN_BLOCK_RAW0;
> o->simulate = 0;
> o->underrun_proof = 0;

BURN_WRITE_RAW + BURN_BLOCK_RAW0 = BURN_COASTER

RAW0 doesn't let us write a q subchannel, so the TOC is totally blank.

that combination shouldn't have showed up as valid in get_block_types.
I'm working out a way to prevent the user from even selecting it in the
write opts structure.

(RAW16 or RAW96R should both be good for a test though)

> Also the type of drive.write_type and drive.block_type was an int
> instead of the enum, i've also changed that.

That's cool.

I'm gonna hold off on merging this for now, on account of the segfaults
and not burning and such...