Compare commits

..

10 Commits

31 changed files with 307 additions and 1979 deletions

View File

@ -3,8 +3,5 @@
aclocal
libtoolize --copy --force
autoconf
# ts A61101 : libburn is not prepared for config.h
# autoheader
autoheader
automake --foreign --add-missing --copy --include-deps

View File

@ -26,12 +26,12 @@ following possible.
cdrskin. By Thomas Schmitt <scdbackup@gmx.net>
Integrated sub project of libburn.pykix.org but also published via:
http://scdbackup.sourceforge.net/cdrskin_eng.html
http://scdbackup.sourceforge.net/cdrskin-0.2.5.tar.gz
http://scdbackup.sourceforge.net/cdrskin-0.2.4.tar.gz
Copyright (C) 2006 Thomas Schmitt
------------------------------------------------------------------------------
On top of libburn there is implemented cdrskin 0.2.5, a limited cdrecord
On top of libburn there is implemented cdrskin 0.2.4, a limited cdrecord
compatibility wrapper which allows to use some libburn features from
the command line.
Interested users of cdrecord are invited to participate in the development
@ -59,16 +59,16 @@ systems, including 64 bit systems. (Further reports are welcome.)
Compilation, First Glimpse, Installation
Obtain cdrskin-0.2.5.tar.gz , take it to a directory of your choice and do:
Obtain cdrskin-0.2.4.tar.gz , take it to a directory of your choice and do:
tar xzf cdrskin-0.2.5.tar.gz
cd cdrskin-0.2.5
tar xzf cdrskin-0.2.4.tar.gz
cd cdrskin-0.2.4
Or obtain a libburn.pykix.org SVN snapshot,
go into the toplevel directory of the snapshot (e.g. cd libburn_pykix ),
and execute the autotools script ./bootstrap . Use autools version >= 1.7 .
Within that toplevel directory of either cdrskin-0.2.5 or libburn then execute:
Within that toplevel directory of either cdrskin-0.2.4 or libburn then execute:
./configure
make
@ -86,7 +86,7 @@ In order to surely get a standalone binary, execute
cdrskin/compile_cdrskin.sh
Version identification and help texts available afterwards:
Version identification an help texts available afterwards:
cdrskin/cdrskin -version
cdrskin/cdrskin --help
cdrskin/cdrskin -help
@ -169,8 +169,8 @@ Burn image file my_image.iso to CD
-eject my_image.iso
Burn a compressed afio archive to CD on-the-fly
find . | afio -oZ - | cdrskin -v dev=0,1,0 fs=32m speed=8 -tao \
driveropts=burnfree padsize=300k -
find . | afio -oZ - | cdrskin -v dev=0,1,0 fs=32m speed=8 -sao \
driveropts=burnfree padsize=300k tsize=650m -
Burn 6 audio tracks from files with different formats to CD.
Anything except .wav or .au files has to be converted into raw format first.
@ -181,7 +181,7 @@ See below "Audio CD" for specifications.
madplay -o raw:track04.cd /path/to/track4.mp3
mppdec --raw-le /path/to/track5.mpc track05.cd
cdrskin -v dev=0,1,0 blank=fast -eject speed=48 -sao \
cdrskin dev=0,1,0 blank=fast -eject speed=48 -sao \
-audio -swab track0[1-5].cd /path/to/track6.wav
@ -198,7 +198,7 @@ or a device file address as listed by --devices with an accessible drive :
Set usage of cdrskin with appropriate options rather than cdrecord :
export SCDBACKUP_CDRECORD="cdrskin -v -v"
export SCDBACKUP_CDRECORD="cdrskin -v -v tao_to_sao_tsize=650m"
Run a backup :
@ -207,11 +207,12 @@ Run a backup :
Restrictions
The major restrictions are lifted now: audio, TAO, multi-session do work.
Many cdrecord options are still unsupported, though.
If you have use cases for them, please report your wishes and expectations.
The convenient burn mode TAO is not available with libburn yet.
Therefore it has to be defaulted to mode SAO which needs to know the track
size in advance. non-cdrecord option tao_to_sao_tsize=650m causes each CD
to get burned up to 650 MB regardless of the payload size.
No multi session yet ... Please report your wishes.
Inspiration and Standard

View File

@ -1,203 +0,0 @@
#!/bin/sh
set -x
# This script documents how this cdrskin version was derived from
# a vanilla libburn version. It is not intended nor needed for any
# use of cdrskin but included here only to show the technical
# relationship between both projects - which are close friends
# and issue roughly the same software.
#
# Package maintainers are advised to cover rather libburn than
# cdrskin unless they put only emphasis on the cdrecord emulation
# provided by cdrskin. libburn contains cdrskin - cdrskin is an
# oscillating, friendly and coordinated fork of libburn.
#
# Script results are a source tarball and two binaries
# one dynamic and one static in respect to system libs.
# Both binaries are static in respect to libburn.
#
# The script is to be run in the directory above the toplevel
# directory of libburn resp. cdrskin development.
#
# libburn version used: http://libburn.pykix.org
# Downloaded by:
# $ svn co http://libburn-svn.pykix.org/trunk libburn_pykix
# packed up in a tarball just to save it from inadverted changes by
# $ tar czf libburn_svn.tgz libburn_pykix
original="./libburn_svn.tgz"
# Historic moments:
# original="./libburn_svn_A60815.tgz"
# original="./libburn_cdrskin_A60819.tgz"
# The top level directory in that snapshot is named
intermediate="./libburn_pykix"
# My changes are in libburn-0.2.3.ts.develop , mainly in ./cdrskin
changes="./libburn-0.2.3.ts.develop"
skin_rev="0.2.5"
# The result directory and the name of the result tarballs
target="./cdrskin-${skin_rev}"
cdrskin_tarball="./cdrskin-${skin_rev}.tar.gz"
cdrskin_tarball_svn="./cdrskin-${skin_rev}.svn.tar.gz"
# (This once earned me an embarrassingly blooping source tarball)
# compile_dir="$changes"
compile_dir="$target"
compile_cmd="./cdrskin/compile_cdrskin.sh"
compile_static_opts="-static"
compile_result="cdrskin/cdrskin"
bintarget_dynamic="cdrskin_${skin_rev}-x86-suse9_0"
bintarget_static="$bintarget_dynamic"-static
if test -d "$changes"
then
dummy=dummy
else
echo "$0 : FATAL : no directory $changes" >&2
exit 1
fi
for i in "$target" "$intermediate"
do
if test -e "$i"
then
echo "$0 : FATAL : already existing $i" >&2
exit 2
fi
done
if test -f "$original"
then
dummy=dummy
else
echo "$0 : FATAL : no file $original" >&2
exit 3
fi
# Unpack SVN snapshot.
tar xzf "$original"
# Rename the directory to the cdrskin name
mv "$intermediate" "$target"
# Copy the changes from the development tree
#
cdrskin_dir="$changes"/cdrskin
libburn_dir="$changes"/libburn
cdrskin_target="$target"/cdrskin
libburn_target="$target"/libburn
# Create version timestamp
timestamp="$(date -u '+%Y.%m.%d.%H%M%S')"
echo "$timestamp"
echo '#define Cdrskin_timestamP "'"$timestamp"'"' >"$cdrskin_dir"/cdrskin_timestamp.h
# Add the cdrskin files
if test -e "$cdrskin_target"
then
rm -rf "$cdrskin_target"
fi
cp -a "$cdrskin_dir" "$cdrskin_target"
# Remove copied binaries
rm "$cdrskin_target"/*.o
rm "$cdrskin_target"/cdrfifo
rm "$cdrskin_target"/cdrskin
rm "$cdrskin_target"/cleanup
for i in std new make old
do
if test -e "$cdrskin_target"/cdrskin_"$i"
then
rm "$cdrskin_target"/cdrskin_"$i"
fi
done
for i in .deps .dirstamp .libs
do
if test -e "$cdrskin_target"/"$i"
then
rm -rf "$cdrskin_target"/"$i"
fi
done
# Remove unwanted SVN stuff (TODO: avoid downloading it)
for i in "$target"/.svn "$target"/*/.svn
do
if test "$i" = "$target"'/*/.svn'
then
dummy=dummy
else
if test -e "$i"
then
rm -rf "$i"
fi
fi
done
## No more : Add own libburn-README in toplevel
# cp -a "$changes"/README "$target"
## No more : Add modified Makefile.am
# cp -a "$changes"/Makefile.am "$target"
# Make SVN state tarball for the libburn team
tar czf "$cdrskin_tarball_svn" "$target"
# Get over dependecy on autotools. Rely only on cc, make et. al.
# This is not the same as "make dist" but i can do it without
# having to evaluate the quality of said "make dist"
#
( cd "$target" ; ./bootstrap )
# Remove unwanted stuff after bootstrap
for i in "$target"/autom4te.cache
do
if echo "$i" | grep '\*' >/dev/null
then
dummy=dummy
else
if test -e "$i"
then
rm -rf "$i"
fi
fi
done
# Pack it up to the new libburn+cdrskin-tarball
tar czf "$cdrskin_tarball" "$target"
# Produce a static and a dynamic binary
(
cd "$compile_dir" || exit 1
./configure
make
$compile_cmd -do_strip
cp "$compile_result" "../$bintarget_dynamic"
if test -n "$compile_static_opts"
then
$compile_cmd $compile_static_opts -do_strip
cp "$compile_result" "../$bintarget_static"
fi
)
# Remove the build area
# Disable this for debugging the merge process
rm -rf "$target"
# Show the result
./"$bintarget_dynamic" -version
./"$bintarget_static" -version
ls -l "$cdrskin_tarball"
ls -l "$bintarget_dynamic"
ls -l "$bintarget_static"

View File

@ -48,9 +48,6 @@ struct CdrfifO {
int source_fd;
double in_counter;
double fd_in_counter;
double fd_in_limit;
char *buffer;
int buffer_size;
int buffer_is_full;
@ -75,27 +72,17 @@ struct CdrfifO {
double empty_counter;
double full_counter;
/* (sequential) fd chaining */
/* fds: 0=source, 1=dest */
int follow_up_fds[Cdrfifo_ffd_maX][2];
/* index of first byte in buffer which does not belong to predecessor fd */
int follow_up_eop[Cdrfifo_ffd_maX];
/* index of first byte in buffer which belongs to [this] fd pair */
int follow_up_sod[Cdrfifo_ffd_maX];
/* values for fd_in_limit */
double follow_up_in_limits[Cdrfifo_ffd_maX];
/* number of defined follow-ups */
int follow_up_fd_counter;
/* index of currently active (i.e. reading) follow-up */
int follow_up_fd_idx;
/* (simultaneous) peer chaining */
struct CdrfifO *next;
struct CdrfifO *prev;
@ -130,8 +117,6 @@ int Cdrfifo_new(struct CdrfifO **ff, int source_fd, int dest_fd,
buffer_size+= chunk_size-(buffer_size%chunk_size);
o->source_fd= source_fd;
o->in_counter= 0.0;
o->fd_in_counter= 0;
o->fd_in_limit= -1.0;
o->buffer= NULL;
o->buffer_is_full= 0;
o->buffer_size= buffer_size;
@ -155,7 +140,6 @@ int Cdrfifo_new(struct CdrfifO **ff, int source_fd, int dest_fd,
for(i= 0; i<Cdrfifo_ffd_maX; i++) {
o->follow_up_fds[i][0]= o->follow_up_fds[i][1]= -1;
o->follow_up_eop[i]= o->follow_up_sod[i]= -1;
o->follow_up_in_limits[i]= -1.0;
}
o->follow_up_fd_counter= 0;
o->follow_up_fd_idx= -1;
@ -240,26 +224,6 @@ int Cdrfifo_set_speed_limit(struct CdrfifO *o, double bytes_per_second,
}
/** Set a fixed size for input in order to cut off any unwanted tail
@param o The fifo object
@param idx index for fds attached via Cdrfifo_attach_follow_up_fds(),
first attached is 0, <0 directs limit to active fd limit
(i.e. first track is -1, second track is 0, third is 1, ...)
*/
int Cdrfifo_set_fd_in_limit(struct CdrfifO *o, double fd_in_limit, int idx,
int flag)
{
if(idx<0) {
o->fd_in_limit= fd_in_limit;
return(1);
}
if(idx >= o->follow_up_fd_counter)
return(0);
o->follow_up_in_limits[idx]= fd_in_limit;
return(1);
}
int Cdrfifo_set_fds(struct CdrfifO *o, int source_fd, int dest_fd, int flag)
{
o->source_fd= source_fd;
@ -280,7 +244,6 @@ int Cdrfifo_get_fds(struct CdrfifO *o, int *source_fd, int *dest_fd, int flag)
fifo buffer when its predecessors are exhausted. Reading will start as
soon as reading of the predecessor encounters EOF. Writing will start
as soon as all pending predecessor data are written.
@return index number of new item + 1, <=0 indicates error
*/
int Cdrfifo_attach_follow_up_fds(struct CdrfifO *o, int source_fd, int dest_fd,
int flag)
@ -290,7 +253,7 @@ int Cdrfifo_attach_follow_up_fds(struct CdrfifO *o, int source_fd, int dest_fd,
o->follow_up_fds[o->follow_up_fd_counter][0]= source_fd;
o->follow_up_fds[o->follow_up_fd_counter][1]= dest_fd;
o->follow_up_fd_counter++;
return(o->follow_up_fd_counter);
return(1);
}
@ -604,12 +567,7 @@ after_write:;
can_read= o->chunk_size;
if(o->write_idx<o->read_idx && o->write_idx+can_read > o->read_idx)
can_read= o->read_idx - o->write_idx;
if(o->fd_in_limit>=0.0)
if(can_read > o->fd_in_limit - o->fd_in_counter)
can_read= o->fd_in_limit - o->fd_in_counter;
ret= 0;
if(can_read>0)
ret= read(o->source_fd,o->buffer+o->write_idx,can_read);
ret= read(o->source_fd,o->buffer+o->write_idx,can_read);
if(ret==-1) {
/* >>> handle input error */;
@ -641,8 +599,6 @@ after_write:;
sod= 0;
o->follow_up_sod[idx]= sod;
o->write_idx= sod;
o->fd_in_counter= 0;
o->fd_in_limit= o->follow_up_in_limits[idx];
if(Cdrfifo_debuG || (flag&1))
fprintf(stderr,"\ncdrfio: new fifo source fd : %d\n",o->source_fd);
} else {
@ -652,7 +608,6 @@ after_write:;
did_work= 1;
o->put_counter++;
o->in_counter+= ret;
o->fd_in_counter+= ret;
o->write_idx+= ret;
if(o->write_idx>=o->buffer_size)
o->write_idx= 0;

View File

@ -15,7 +15,7 @@
/** The fifo buffer which will smoothen the data stream from data provider
to data consumer. Although this is not a mandatory lifesaver for modern
to data consumer. Although this is not a mandatory lifesavier for modern
burners any more, a fifo can speed up burning of data which is delivered
with varying bandwidths (e.g. compressed archives created on the fly
or mkisofs running at its speed limit.).
@ -64,16 +64,6 @@ int Cdrfifo_get_sizes(struct CdrfifO *o, int *chunk_size, int *buffer_size,
int Cdrfifo_set_speed_limit(struct CdrfifO *o, double bytes_per_second,
int flag);
/** Set a fixed size for input in order to cut off any unwanted tail
@param o The fifo object
@param idx index for fds attached via Cdrfifo_attach_follow_up_fds(),
first attached is 0, <0 directs limit to active fd limit
(i.e. first track is -1, second track is 0, third is 1, ...)
*/
int Cdrfifo_set_fd_in_limit(struct CdrfifO *o, double fd_in_limit, int idx,
int flag);
int Cdrfifo_set_fds(struct CdrfifO *o, int source_fd, int dest_fd, int flag);
int Cdrfifo_get_fds(struct CdrfifO *o, int *source_fd, int *dest_fd, int flag);
@ -82,7 +72,6 @@ int Cdrfifo_get_fds(struct CdrfifO *o, int *source_fd, int *dest_fd, int flag);
fifo buffer when its predecessors are exhausted. Reading will start as
soon as reading of the predecessor encounters EOF. Writing will start
as soon as all pending predecessor data are written.
@return index number of new item + 1, <=0 indicates error
*/
int Cdrfifo_attach_follow_up_fds(struct CdrfifO *o, int source_fd, int dest_fd,
int flag);

File diff suppressed because it is too large Load Diff

View File

@ -99,10 +99,8 @@ wishes as well as on the development of libburn.</DT>
<DD>$ cdrskin -v dev=/dev/dvd blank=fast -eject</DD>
<DT>Write ISO-9660 filesystem image:</DT>
<DD>$ cdrskin -v dev=/dev/hdc speed=12 fs=8m driveropts=burnfree -sao -eject padsize=300k my_image.iso</DD>
<DT>Write compressed afio archive on-the-fly via cdrskin-0.2.4 :</DT>
<DT>Write compressed afio archive on-the-fly:</DT>
<DD>$ find . | afio -oZ - | cdrskin -v dev=0,1,0 fs=32m speed=8 driveropts=burnfree padsize=300k -sao tsize=650m -</DD>
<DT>Write compressed afio archive on-the-fly via cdrskin-0.2.5 :</DT>
<DD>$ find . | afio -oZ - | cdrskin -v dev=0,1,0 fs=32m speed=8 driveropts=burnfree padsize=300k -tao -</DD>
<DT>Write audio tracks:</DT>
<DD>$ cdrskin -v dev=ATA:1,0,0 speed=48 driveropts=burnfree -sao track1.wav track2.au -audio -swab track3.raw
<DD>
@ -126,12 +124,10 @@ wishes as well as on the development of libburn.</DT>
<DT></DT>
<LI>
Burns only a single closed session. No -multi option yet.
Note: Development version 0.2.5 offers multi-session now. See below.
</LI>
<LI>
No TAO mode in cdrskin-0.2.4 and therefore no writing on-the-fly without
a predefined source size.<BR>
Note: Development version 0.2.5 offers TAO now. See below.
No TAO mode and therefore no writing on-the-fly without a predefined
source size.
</LI>
<LI>
cdrskin -scanbus or --devices hangs for quite a while if there is
@ -153,7 +149,7 @@ rw-permissions and retry the bus scan as non-superuser.
<P>
<DL>
<DT>Download as source code (see README):</DT>
<DD><A HREF="cdrskin-0.2.4.pl01.tar.gz">cdrskin-0.2.4.pl01.tar.gz</A>
<DD><A HREF="cdrskin-0.2.4.tar.gz">cdrskin-0.2.4.tar.gz</A>
(510 KB).
</DD>
<DD>
@ -164,14 +160,14 @@ cdrskin is part of libburn - full libburn is provided with cdrskin releases.
</DD>
<DD>&nbsp;</DD>
<DT>Download as single x86 binaries (untar and move to /usr/bin/cdrskin):</DT>
<DD><A HREF="cdrskin_0.2.4.pl01-x86-suse9_0.tar.gz">
cdrskin_0.2.4.pl01-x86-suse9_0.tar.gz</A>, (60 KB),
<DD><A HREF="cdrskin_0.2.4-x86-suse9_0.tar.gz">
cdrskin_0.2.4-x86-suse9_0.tar.gz</A>, (60 KB),
<DL>
<DD>runs on SuSE 9.0 (2.4.21) , RIP-14.4 (2.6.14) ,
Gentoo (2.6.15 x86_64 Athlon).</DD>
</DL>
<DD><A HREF="cdrskin_0.2.4.pl01-x86-suse9_0-static.tar.gz">
cdrskin_0.2.4.pl01-x86-suse9_0-static.tar.gz</A>, (260 KB), -static compiled,
<DD><A HREF="cdrskin_0.2.4-x86-suse9_0-static.tar.gz">
cdrskin_0.2.4-x86-suse9_0-static.tar.gz</A>, (260 KB), -static compiled,
<DL>
<DD>runs on SuSE 7.2 (2.4.4), and on the systems above.</DD>
</DL>
@ -218,22 +214,11 @@ Enhancements towards previous stable version cdrskin-0.2.2:
<P>
<DL>
<DT><H3>Development snapshot, version 0.2.5 :</H3></DT>
<DT>Development snapshot, version 0.2.5 :</DT>
<DD>&nbsp;</DD>
<DD>Enhancements towards stable version 0.2.4:
<UL>
<LI>Option <KBD><B>-tao</B></KBD> is fully enabled.
With single track or with undefined size from standard input,
default is -tao. With other multi-track sessions, default is -sao.
(The latter is an intentional deviation from cdrecord defaults.)
</LI>
<LI>Status report during blank, preparation and finalization improved.</LI>
<LI>Bug fixed: Trailing trash appended to .wav files caused error message
and, if exceeding fifo size, could even stall a burn.
(Workaround: disable fifo by <KBD><B>fs=0</B></KBD>)</LI>
<LI>Bug fixed: False speed with first pacifier cycle. Potential program
abort by floating point exception (NaN).</LI>
<LI>multi-session CDs: <KBD><B>-multi</B></KBD>, <KBD><B>-msinfo</B></KBD>,
writing to appendable CDs (for now restricted to write mode TAO).</LI>
<LI>-none for now-</LI>
</UL>
</DD>
<DD>&nbsp;</DD>

View File

@ -1 +1 @@
#define Cdrskin_timestamP "2006.11.12.185342"
#define Cdrskin_timestamP "2006.10.28.132532"

View File

@ -1,22 +1,5 @@
------------------------------------------------------------------------------
libburn.pykix.org scdbackup.sourceforge.net/cdrskin
------------------------------------------------------------------------------
Deliberate deviations of cdrskin from cdrecord compatibility:
+ cdrskin does drive operations (on its drive 0) without a dev= option
+ gracetime=0 is allowed and set by default
+ -pad is always set for audio tracks
+ -sao is default for multi-track sessions with all track lengths defined
+ premature end of source is not an error and leads to full announced tracksize
+ -msinfo pushes all other messages to stderr. It works independent of
other options which would prevent it with cdrecord (-atip, -scanbus, ...)
------------------------------------------------------------------------------
Changelog
------------------------------------------------------------------------------
@ -1195,7 +1178,7 @@ Announced full -audio compatibility with cdrecord
------------------------------------ cycled - cdrskin-0.2.3 - 2006.10.25.160540
2006.10.27.114326 [319 branch]
[]
- cdrskin/add_ts_changes_to_libburn_0_2_3
+ cdrskin/add_ts_changes_to_libburn_0_2_4
cdrskin/README
@ -1203,15 +1186,13 @@ cdrskin/cdrskin.c
cdrskin/cdrskin_eng.html
cdrskin/changelog.txt
README
Performed cdrskin version leap to cdrskin-0.2.4
Preparing cdrskin version leap to cdrskin-0.2.4
(To be committed to branch)
2006.10.28.093922 [320 branch]
cdrskin/cdrskin_timestamp.h
Set final timestamp 2006.10.28.093922
------------------------------------ cycled - cdrskin-0.2.4 - 2006.10.28.093922
------------------------------------ cycle - cdrskin-0.2.5
2006.10.28.115213 [321 trunk] [322 trunk]
[]
- cdrskin/add_ts_changes_to_libburn_0_2_3
+ cdrskin/add_ts_changes_to_libburn_0_2_4
+ cdrskin/add_ts_changes_to_libburn_0_2_5
@ -1220,306 +1201,19 @@ cdrskin/cdrskin.c
cdrskin/cdrskin_eng.html
cdrskin/changelog.txt
README
Performed cdrskin version leap to cdrskin-0.2.5
28 Oct 2006 [323 branch]
- cdrskin/add_ts_changes_to_libburn_0_2_3
cdrskin/add_ts_changes_to_libburn_0_2_4
Corrected misnaming of my development directory
28 Oct 2006 [324 trunk]
cdrskin/add_ts_changes_to_libburn_0_2_4
cdrskin/add_ts_changes_to_libburn_0_2_5
Corrected misnaming of my development directory
2006.10.28.132532 [325 branch]
cdrskin/cdrskin.c
Corrected last-minute bug which made every track from file an audio track
2006.10.28.151521 [326 trunk]
cdrskin/cdrskin.c
Corrected bug which made every track from file an audio track
29 Oct 2006 [327 branch] [328 trunk]
+ CONTRIBUTORS
Copied missing file from libburn-0.2.2
29 Oct 2006 [329 branch] [330 trunk]
Makefile.am
Added to EXTRA_DIST cdrskin/cleanup.[ch]
29 Oct 2006 [331 branch] [332 trunk]
Makefile.am
Added to EXTRA_DIST libburn/sg-*.[ch]
29 Oct 2006 [333 branch] [334 trunk]
Makefile.am
Deleted from to EXTRA_DIST libburn/sg-*.h
30 Oct 2006 [337]
libburn/transport.h
libburn/mmc.c
libburn/sg-freebsd.c
Made MMC command CLOSE TRACK/SESSION available to struct burn_drive
2006.10.31.115606 [338]
libburn/transport.h
libburn/spc.c
libburn/mmc.c
libburn/write.h
libburn/write.c
libburn/sector.c
libburn/libdax_msgs.h
libburn/sg.h
libburn/sg-linux.c
cdrskin/cdrskin.c
Made single track TAO work (sector i/o still wants fixed size, though)
2006.10.31.184736 [339]
libburn/sector.c
libburn/source.c
libburn/structure.h
libburn/structure.c
libburn/write.c
cdrskin/cdrskin.c
Made single track TAO work without fixed size (compile -experimental)
2006.11.01.163934 [340]
libburn/libburn.h
libburn/source.c
libburn/write.h
libburn/write.c
libburn/structure.c
libburn/structure.h
libburn/sector.c
cdrskin/cdrskin.c
cdrskin/compile_cdrskin.sh
Adapted cdrskin pacifier to possibly unknown track size
2006.11.01.172004 [341]
configure.ac
bootstrap
test/libburner.c
Repaired broken macro settings during Linux build
2 Nov 2006 [342]
cdrskin/README
Mentioned -tao and experimental compile
2006.11.02.211816 [343]
libburn/libburn.h
libburn/write.c
cdrskin/cdrskin.c
Installed status communications about closing session ("Fixating")
3 Nov 2006 [344]
test/libburner.c
Changed status report during blanking (there are no "sectors")
2006.11.03.063307 [345]
cdrskin/cdrskin.c
Removed some obsolete debugging messages
2006.11.03.151137 [346]
libburn/structure.h
libburn/structure.c
libburn/write.h
libburn/write.c
libburn/sector.c
libburn/libdax_msgs.h
Installed decent abort behavior with TAO
2006.11.03.202403 [347]
libburn/write.c
Enabled TAO for multiple -data tracks (-audio still ends after 0 bytes)
2006.11.04.092909 [348]
libburn/spc.c
libburn/sector.c
Enabled audio tracks with TAO
2006.11.02.140329 (pl01) [351 tags/CdrskinZeroTwoFourPlZeroOne]
../cdrskin-0.2.4.patch01/configure.ac
../cdrskin-0.2.4.patch01/bootstrap
../cdrskin-0.2.4.patch01/cdrskin/README
../cdrskin-0.2.4.patch01/cdrskin/add_ts_changes_to_libburn_0_2_4_patch01
../cdrskin-0.2.4.patch01/cdrskin/cdrskin_timestamp.h
../cdrskin-0.2.4.patch01/test/libburner.c
Revoked autotools aspect of revision 290
2006.11.06.073810 [352]
cdrskin/cdrskin.c
cdrskin/cdrskin_eng.html
cdrskin/changelog.txt
Adapted documentation to reflect experimental TAO mode
------------------------------------ cycle - cdrskin-0.2.5 - 2006.11.06.085056
2006.11.06.114159 [353]
libburn/libburn.h
libburn/spc.c
libburn/options.c
cdrskin/cdrskin.c
New API burn_write_opts_set_multi(). (But libburn cannot burn next session yet)
2006.11.06.121409 [354]
cdrskin/cdrskin.c
Made -toc on multiple sessions more compatible
2006.11.06.155237 [355]
libburn/libburn.h
libburn/drive.c
libburn/write.c
libburn/mmc.c
libburn/sg-linux.c
cdrskin/cdrskin.c
Made CD with unclosed track blankable (by -force)
2006.11.06.195743 [356]
libburn/transport.h
libburn/mmc.c
libburn/spc.c
libburn/write.c
libburn/sg-linux.c
Cared for some SCSI error conditions which were ignored up to now
2006.11.07.114514 [357]
cdrskin/cdrskin.c
Made -tao default for single track or stdin, -sao for any other multi-track
7 Nov 2006 [358]
cdrskin/cdrskin_eng.html
cdrskin/changelog.txt
Prepared next cdrskin-0.2.5 upload cycle
7 Nov 2006 [359]
cdrskin/changelog.txt
cdrskin/README
cdrskin/wiki_plain.txt
Updated documentation about TAO
2006.11.07.152018 [360]
cdrskin/cdrskin.c
cdrskin/changelog.txt
Updated documentation about TAO
------------------------------------ cycle - cdrskin-0.2.5 - 2006.11.07.152018
* Enabled TAO
2006.11.08.165648 [361]
cdrskin/cdrfifo.h
cdrskin/cdrfifo.c
cdrskin/cdrskin.c
Avoided error message and nonzero exit with trailing trash on .wav
8 Nov 2006 [362]
cdrskin/cdrskin_eng.html
Mentioned bug fix about trailing trash
2006.11.08.172918 [363]
libburn/write.c
Made track write counter of SAO count rather too much than too few bytes
8 Nov 2006 [364]
cdrskin/changelog.txt
Prepared next cdrskin-0.2.5 upload cycle
------------------------------------ cycle - cdrskin-0.2.5 - 2006.11.08.181016
* Bug fixed: Trailing trash appended to .wav files caused error message
and, if exceeding fifo size, could even stall a burn.
2006.11.09.112832 [365]
cdrskin/cdrskin.c
Check desired write and block type with burn_drive_info.*_block_types
2006.11.09.113729 [366]
libburn/sg-linux.c
Silenced SCSI error (debugging) messages about missing media
2006.11.09.151431 [367]
cdrskin/cdrskin.c
Corrected first speed measurement report in TAO mode (which was random)
2006.11.09.193030 [368]
libburn/libburn.h
libburn/write.c
cdrskin/cdrskin.c
Experimentally enabled burning to BURN_DISC_APPENDABLE (tested with TAO only)
2006.11.10.093843 [369]
cdrskin/cdrskin.c
doc/comments
Expressing more self-confidence
2006.11.10.172212 [370]
cdrskin/cdrskin.c
Provisory -msinfo (very verbous on stderr)
2006.11.10.184047 [371]
cdrskin/cdrskin.c
Made it work with fifos and other non-plain files as track sources
2006.11.10.185209 [372]
cdrskin/cdrskin.c
Read -msinfo from first track of last session and not from last track
2006.11.11.122402 [373]
libburn/libburn.h
libburn/transport.h
libburn/mmc.h
libburn/mmc.c
libburn/write.c
libburn/drive.c
libburn/libdax_msgs.h
New API function burn_disc_track_lba_nwa()
2006.11.11.122907 [374] [375]
cdrskin/cdrskin.c
Implemented not so provisory -msinfo
2006.11.11.124020 [376] [377]
cdrskin/cdrskin.c
Reacted on some warnings of gcc -O2
2006.11.11.134752 [378]
cdrskin/cdrskin.c
Implemented handling of unsuitable disk states with -msinfo
2006.11.11.152037 [379]
cdrskin/cdrskin.c
Demanded (for now) -tao for writing to appendable CDs
2006.11.11.152748 [380]
cdrskin/cdrskin.c
Generally enabled -multi, -msinfo and writing to appendable CDs in TAO mode
11 Nov 2006 []
cdrskin/changelog.txt
Prepared next cdrskin-0.2.5 cycle
------------------------------------ cycle - cdrskin-0.2.5 - 2006.11.11.
* Bug fixed: False speed with first pacifier cycle. Potential SIGFPE by NaN.
* multi-session CDs (for now restricted to write mode TAO) by -multi, -msinfo
Prepare cdrskin version leap to cdrskin-0.2.5
(To be committed to trunk)
------------------------------------ cycle - cdrskin-0.2.5 -
[]
Enable multi-session for write modes other than TAO
[]
Liberate generic SCSI code from sg-linux.c (scsi_notify_error(), scsi_error())
[]
Coordinate scsi_notify_error() and scsi_error() about harmless conditions
2006 []
-reset: ioctl(fd,CDROMRESET) ioctl(fd,SG_SCSI_RESET,SG_SCSI_RESET_DEVICE)
2006 []
Try wether tao will work if finalized by mmc_close()
2006 []
Open O_EXCL all devices in address resolution chain
(Might help with non-standard hdX device siblings)
@ -1532,6 +1226,9 @@ Convert burn_print() into libdax_msgs_submit()
Test unlocking of all drives by burn_drive_info_free()
Test unlocking of single drive by burn_drive_grab(), burn_drive_release()
2006 []
Clear outdated persistent read buffer after small CD image was read (ticket 57)

View File

@ -6,7 +6,6 @@
debug_opts=
def_opts=
largefile_opts="-D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE=1"
libvers="-DCdrskin_libburn_0_2_3"
cleanup_src_or_obj="libburn/cleanup.o"
libdax_msgs_o="libburn/libdax_msgs.o"
@ -51,9 +50,6 @@ do
elif test "$i" = "-oldfashioned"
then
def_opts="$def_opts -DCdrskin_oldfashioned_api_usE"
elif test "$i" = "-no_largefile"
then
largefile_opts=
elif test "$i" = "-do_not_compile_cdrskin"
then
compile_cdrskin=0
@ -80,7 +76,6 @@ do
echo " -cvs_A60220 set macro to match libburn-CVS of 20 Feb 2006."
echo " -libburn_0_2_2 set macro to match libburn-0.2.2."
echo " -libburn_0_2_3 set macro to match current libburn-SVN."
echo " -no_largefile do not use 64 bit off_t (must match libburn)."
echo " -do_not_compile_cdrskin omit compilation of cdrskin/cdrskin."
echo " -experimental use newly introduced libburn features."
echo " -oldfashioned use pre-0.2.2 libburn features only."
@ -104,14 +99,7 @@ echo "Build timestamp : $timestamp"
if test "$compile_cdrskin"
then
echo "compiling program cdrskin/cdrskin.c $static_opts $debug_opts $libvers $def_opts $cleanup_src_or_obj"
cc -I. \
$warn_opts \
$static_opts \
$debug_opts \
$libvers \
$largefile_opts \
$def_opts \
\
cc $warn_opts -I. $static_opts $debug_opts $libvers $def_opts \
-DCdrskin_build_timestamP='"'"$timestamp"'"' \
\
-o cdrskin/cdrskin \

View File

@ -2,7 +2,7 @@
cdrskin Wiki - plain text copy
--------------------------------------------------------------------------
cdrskin-0.2.5 is the cdrecord compatibility middleware of libburn.
cdrskin-0.2.3 is the cdrecord compatibility middleware of libburn.
Its paragon, cdrecord, is a powerful GPL'ed burn program included in Joerg
Schilling's cdrtools. cdrskin strives to be a second source for the services
@ -12,16 +12,12 @@ Its future ability to burn DVD media depends on the development of libburn.
cdrskin does not contain any bytes copied from cdrecord's sources.
Many bytes have been copied from the message output of cdrecord
runs, though. The most comprehensive technical overview of cdrskin
can be found in cdrskin/README . Online available as :
http://libburn.pykix.org/browser/trunk/cdrskin/README?format=raw
can be found in cdrskin/README .
--------------------------------------------------------------------------
cdrskin with CD media fails to match its paragon cdrecord on one major field:
Multi session.
Convenient TAO burn mode is provided in development version 0.2.5 but not in
current "stable" release 0.2.4.
cdrskin with CD media fails to match its paragon cdrecord on two major
fields: convenient TAO burn mode and multi session.
cdrskin does not provide DVD burning yet. See advise to use dvd+rw-tools
at the end of this text.
@ -129,10 +125,6 @@ tao_to_sao_tsize=<num> allows the - actually unsupported - cdrecord option
-tao and defines a default track size to be used if - as custom with -tao -
no option tsize=# is given.
Since -tao is supported in cdrskin-0.2.5 the TAO-to-SAO workaround on its way
to obsolescence. Nevertheless, tao_to_sao_tsize= allows to preset a default
size for SAO mode which is in effect only if no track size is available.
As in general with cdrskin tsize=# the data source does not have to provide
the full annouced amount of data. Missing data will be padded up by 0-bytes.
Surplus data is supposed to cause an error, though. The burn will then

View File

@ -7,11 +7,7 @@ AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([subdir-objects])
dnl A61101 This breaks Linux build (makes 32 bit off_t)
dnl http://sourceware.org/autobook/autobook/autobook_96.html says
dnl one must include some config.h and this was a pitfall.
dnl So why dig the pit at all ?
dnl AM_CONFIG_HEADER(config.h)
AM_CONFIG_HEADER(config.h)
dnl Making releases:
dnl BURN_MICRO_VERSION += 1;

View File

@ -13,10 +13,10 @@ together strive to be a usable foundation for application development.
These are libraries, language bindings, and middleware binaries which emulate
classical (and valuable) Linux tools.
Our scope is currently Linux 2.4 and 2.6 only. For ports to other systems
we would need : login on a development machine resp. a live OS on CD or DVD,
advise from a system person about the equivalent of Linux sg or FreeBSD CAM,
volunteers for testing of realistic use cases.
Our scope is currently Linux 2.4 and 2.6 and we will have a hard time to widen
this for now, because of our history. The project could need advise from or
membership of skilled kernel people and people who know how to talk CD/DVD
drives into doing things.
We do have a workable code base for burning data CDs, though. The burn API is
quite comprehensively documented and can be used to build a presentable

View File

@ -1176,16 +1176,6 @@ int burn_disc_pretend_blank(struct burn_drive *d)
return 1;
}
/* ts A61106 API function */
int burn_disc_pretend_full(struct burn_drive *d)
{
if (d->status != BURN_DISC_UNREADY &&
d->status != BURN_DISC_UNSUITABLE)
return 0;
d->status = BURN_DISC_FULL;
return 1;
}
/* ts A61021: new API function */
int burn_disc_read_atip(struct burn_drive *d)
{
@ -1202,31 +1192,3 @@ int burn_disc_read_atip(struct burn_drive *d)
return 1;
}
/* ts A61110 : new API function */
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
int trackno, int *lba, int *nwa)
{
int ret;
if (burn_drive_is_released(d)) {
libdax_msgs_submit(libdax_messenger,
d->global_index, 0x0002011b,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
"Attempt to read track info from ungrabbed drive",
0, 0);
return -1;
}
if (d->busy != BURN_DRIVE_IDLE) {
libdax_msgs_submit(libdax_messenger,
d->global_index, 0x0002011c,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
"Attempt to read track info from busy drive",
0, 0);
return -1;
}
if (o!=NULL)
d->send_write_parameters(d, o);
ret = d->get_nwa(d, trackno, lba, nwa);
return ret;
}

View File

@ -7,7 +7,6 @@
expressing a file or stream size.
XXX we should enforce 64-bitness for off_t
ts A61101 : this is usually done by the build system (if it is not broken)
*/
#include <sys/types.h>
@ -41,10 +40,6 @@ struct burn_session;
/** References a single track on a disc */
struct burn_track;
/* ts A61111 */
/** References a set of write parameters */
struct burn_write_opts;
/** Session format for normal audio or data discs */
#define BURN_CDROM 0
/** Session format for obsolete CD-I discs */
@ -221,16 +216,7 @@ enum burn_drive_status
/** The drive is erasing a disc */
BURN_DRIVE_ERASING,
/** The drive is being grabbed */
BURN_DRIVE_GRABBING,
/* ts A61102 */
/** The drive gets written zeroes before the track payload data */
BURN_DRIVE_WRITING_PREGAP,
/** The drive is told to close a track (TAO only) */
BURN_DRIVE_CLOSING_TRACK,
/** The drive is told to close a session (TAO only) */
BURN_DRIVE_CLOSING_SESSION
BURN_DRIVE_GRABBING
};
/** Information about a track on a disc - this is from the q sub channel of the
@ -662,15 +648,6 @@ enum burn_disc_status burn_disc_get_status(struct burn_drive *drive);
int burn_disc_pretend_blank(struct burn_drive *drive);
/* ts A61106 */
/** WARNING: This overrides the safety measures against unsuitable media.
Sets the drive status to BURN_DISC_FULL if it is BURN_DISC_UNREADY
or BURN_DISC_UNSUITABLE. Thus marking media as blankable which actually
failed to declare themselves either blank or (partially) filled.
*/
int burn_disc_pretend_full(struct burn_drive *drive);
/* ts A61021 */
/** Reads ATIP information from inserted media. To be obtained via
burn_drive_get_write_speed(), burn_drive_get_min_write_speed(),
@ -695,21 +672,6 @@ int burn_disc_read_atip(struct burn_drive *drive);
int burn_drive_get_start_end_lba(struct burn_drive *drive,
int *start_lba, int *end_lba, int flag);
/* ts A61110 */
/** Read start lba and Next Writeable Address of a track from media.
Usually a track lba is obtained from the result of burn_track_get_entry().
This call retrieves an updated lba, eventual nwa, and can address the
invisible track to come.
The drive must be grabbed for this call. One may not issue this call
during ongoing burn_disc_write() or burn_disc_erase().
@param d The drive to query.
@param o If not NULL: write parameters to be set on drive before query
@param trackno 0=next track to come, >0 number of existing track
@return 1=nwa is valid , 0=nwa is not valid , -1=error
*/
int burn_disc_track_lba_nwa(struct burn_drive *d, struct burn_write_opts *o,
int trackno, int *lba, int *nwa);
/** Tells whether a disc can be erased or not
@return Non-zero means erasable
@ -759,7 +721,6 @@ void burn_read_opts_free(struct burn_read_opts *opts);
*/
void burn_disc_erase(struct burn_drive *drive, int fast);
/* ts A61109 : this is defunct */
/** Read a disc from the drive and write it to an fd pair. The drive must be
grabbed successfully BEFORE calling this function. Always ensure that the
drive reports a status of BURN_DISC_FULL before calling this function.
@ -768,9 +729,10 @@ void burn_disc_erase(struct burn_drive *drive, int fast);
*/
void burn_disc_read(struct burn_drive *drive, const struct burn_read_opts *o);
/** Write a disc in the drive. The drive must be grabbed successfully before
/** Write a disc in the drive. The drive must be grabbed successfully BEFORE
calling this function. Always ensure that the drive reports a status of
BURN_DISC_BLANK before calling this function.
BURN_DISC_BLANK or BURN_STATUS_FULL (to append a new session to the
disc) before calling this function.
@param o The options for the writing operation.
@param disc The struct burn_disc * that described the disc to be created
*/
@ -955,19 +917,10 @@ struct burn_source *burn_file_source_new(const char *path,
*/
struct burn_source *burn_fd_source_new(int datafd, int subfd, off_t size);
/** Tells how long a track will be on disc
>>> NOTE: Not reliable with tracks of undefined length
*/
/** Tells how long a track will be on disc */
int burn_track_get_sectors(struct burn_track *);
/* ts A61101 */
/** Tells how many source bytes have been read and how many data bytes have
been written by the track during burn */
int burn_track_get_counters(struct burn_track *t,
off_t *read_bytes, off_t *written_bytes);
/** Sets drive read and write speed
@param d The drive to set speed for
@param read Read speed in k/s (0 is max)
@ -1032,15 +985,6 @@ void burn_write_opts_set_has_mediacatalog(struct burn_write_opts *opts, int has_
void burn_write_opts_set_mediacatalog(struct burn_write_opts *opts, unsigned char mediacatalog[13]);
/* ts A61106 */
/* Sets the multi flag which eventually marks the emerging session as not being
the last one and thus creating a BURN_DISC_APPENDABLE media.
@param multi 1=media will be appendable, 0=media will be closed (default)
*/
void burn_write_opts_set_multi(struct burn_write_opts *opts, int multi);
/** Sets whether to read in raw mode or not
@param opts The read opts to change
@param raw_mode If non-zero, reading will be done in raw mode, so that everything in the data tracks on the

View File

@ -303,7 +303,7 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x00020006 (FATAL,HIGH) = Too many scsi siblings
0x00020007 (NOTE,HIGH) = Closed O_EXCL scsi siblings
General library operations:
From the hunt on Assert:
0x00020101 (WARNING,HIGH) = Cannot find given worker item
0x00020102 (SORRY,HIGH) = A drive operation is still going on
@ -320,7 +320,7 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x0002010c (FATAL,HIGH) = Failed to transfer command to drive
0x0002010d (DEBUG,HIGH) = Could not inquire TOC
0x0002010e (FATAL,HIGH) = Attempt to read ATIP from ungrabbed drive
0x0002010f (DEBUG,HIGH) = SCSI error condition on command
0x0002010f
0x00020110 (FATAL,HIGH) = Persistent drive address too long
0x00020111 (FATAL,HIGH) = Could not allocate new auxiliary object
0x00020112 (SORRY,HIGH) = Bad combination of write_type and block_type
@ -329,12 +329,6 @@ Range "scdbackup" : 0x00020000 to 0x0002ffff
0x00020115 (SORRY,HIGH) = Attempt to set track mode to unusable value
0x00020116 (FATAL,HIGH) = Track mode has unusable value
0x00020117 (FATAL,HIGH) = toc_entry of drive is already in use
0x00020118 (DEBUG,HIGH) = Closing track
0x00020119 (DEBUG,HIGH) = Closing session
0x0002011a (NOTE,HIGH) = Padding up track to minimum size
0x0002011b (FATAL,HIGH) = Attempt to read track info from ungrabbed drive
0x0002011c (FATAL,HIGH) = Attempt to read track info from busy drive
0x0002011d (FATAL,HIGH) = SCSI error condition on write
libdax_audioxtr:
0x00020200 (SORRY,HIGH) = Cannot open audio source file

View File

@ -20,15 +20,6 @@
#include "structure.h"
#include "options.h"
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#endif /* Libburn_log_in_and_out_streaM */
/* ts A61005 */
#include "libdax_msgs.h"
extern struct libdax_msgs *libdax_messenger;
@ -99,9 +90,7 @@ void mmc_send_cue_sheet(struct burn_drive *d, struct cue_sheet *s)
d->issue_command(d, &c);
}
/* ts A61110 : added parameters trackno, lba, nwa. Redefined return value.
@return 1=nwa is valid , 0=nwa is not valid , -1=error */
int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa)
int mmc_get_nwa(struct burn_drive *d)
{
struct buffer buf;
struct command c;
@ -112,27 +101,13 @@ int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa)
c.oplen = sizeof(MMC_TRACK_INFO);
memcpy(c.opcode, MMC_TRACK_INFO, sizeof(MMC_TRACK_INFO));
c.opcode[1] = 1;
if(trackno<=0)
c.opcode[5] = 0xFF;
else
c.opcode[5] = trackno;
c.opcode[5] = 0xFF;
c.page = &buf;
c.dir = FROM_DRIVE;
d->issue_command(d, &c);
data = c.page->data;
*lba = (data[8] << 24) + (data[9] << 16)
+ (data[10] << 8) + data[11];
*nwa = (data[12] << 24) + (data[13] << 16)
return (data[12] << 24) + (data[13] << 16)
+ (data[14] << 8) + data[15];
/* ts A61106 : MMC-1 Table 142 : NWA_V = NWA Valid Flag */
if (!(data[7]&1)) {
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
"mmc_get_nwa: Track Info Block: NWA_V == 0", 0, 0);
return 0;
}
return 1;
}
/* ts A61009 : function is obviously unused. */
@ -183,13 +158,14 @@ void mmc_close(struct burn_drive *d, int session, int track)
mmc_function_spy("mmc_close");
libdax_msgs_submit(libdax_messenger, -1, 0x00000002,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
"HOW THAT ? mmc_close() was called", 0, 0);
c.retry = 1;
c.oplen = sizeof(MMC_CLOSE);
memcpy(c.opcode, MMC_CLOSE, sizeof(MMC_CLOSE));
/* ts A61030 : shifted !!session rather than or-ing plain session */
c.opcode[2] = ((!!session)<<1) | !!track;
c.opcode[2] = session | !!track;
c.opcode[4] = track >> 8;
c.opcode[5] = track & 0xFF;
c.page = NULL;
@ -254,14 +230,6 @@ int mmc_write(struct burn_drive *d, int start, struct buffer *buf)
struct command c;
int len;
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
static int tee_fd= -1;
if(tee_fd==-1)
tee_fd= open("/tmp/libburn_sg_written",
O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
#endif /* Libburn_log_in_and_out_streaM */
mmc_function_spy("mmc_write");
pthread_mutex_lock(&d->access_lock);
cancelled = d->cancel;
@ -293,35 +261,9 @@ int mmc_write(struct burn_drive *d, int start, struct buffer *buf)
burn_print(12, "%d, %d, %d, %d\n", c->opcode[6], c->opcode[7], c->opcode[8], c->opcode[9]);
*/
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
if(tee_fd!=-1) {
write(tee_fd,c.page->data,len*2048);
}
#endif /* Libburn_log_in_and_out_streaM */
/* write(fileno(stderr), c.page->data, c.page->bytes);*/
d->issue_command(d, &c);
/* ts A61112 : react on eventual error condition */
if (c.error && c.sense[2]!=0) {
/* >>> make this scsi_notify_error() when liberated */
if (c.sense[2]!=0) {
char msg[80];
sprintf(msg,
"SCSI error condition on write : key=%X asc=%2.2Xh ascq=%2.2Xh",
c.sense[2],c.sense[12],c.sense[13]);
libdax_msgs_submit(libdax_messenger, d->global_index,
0x0002011d,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
msg, 0, 0);
}
pthread_mutex_lock(&d->access_lock);
d->cancel = 1;
pthread_mutex_unlock(&d->access_lock);
return BE_CANCELLED;
}
return 0;
}
@ -349,7 +291,6 @@ void mmc_read_toc(struct burn_drive *d)
if (c.error) {
/* ts A61020 : this snaps on non-blank DVD media */
/* ts A61106 : also snaps on CD with unclosed track/session */
/* Very unsure wether this old measure is ok.
Obviously higher levels do not care about this.
DVD+RW burns go on after passing through here.
@ -693,12 +634,8 @@ void mmc_read_sectors(struct burn_drive *d,
len >>= 8;
c.opcode[6] = len & 0xFF;
req = 0xF8;
/* ts A61106 : LG GSA-4082B dislikes this. key=5h asc=24h ascq=00h
if (d->busy == BURN_DRIVE_GRABBING || o->report_recovered_errors)
req |= 2;
*/
c.opcode[10] = 0;
/* always read the subcode, throw it away later, since we don't know
@ -784,13 +721,6 @@ void mmc_set_speed(struct burn_drive *d, int r, int w)
{
struct command c;
/* ts A61112 : MMC standards prescribe FFFFh as max speed.
But libburn.h prescribes 0. */
if (r<=0 || r>0xffff)
r = 0xffff;
if (w<=0 || w>0xffff)
w = 0xffff;
mmc_function_spy("mmc_set_speed");
memcpy(c.opcode, MMC_SET_SPEED, sizeof(MMC_SET_SPEED));
c.retry = 1;
@ -894,7 +824,6 @@ int mmc_setup_drive(struct burn_drive *d)
d->get_nwa = mmc_get_nwa;
d->close_disc = mmc_close_disc;
d->close_session = mmc_close_session;
d->close_track_session = mmc_close;
d->read_buffer_capacity = mmc_read_buffer_capacity;
/* ts A61020 */

View File

@ -37,11 +37,7 @@ void mmc_set_speed(struct burn_drive *, int, int);
void mmc_read_lead_in(struct burn_drive *, struct buffer *);
void mmc_perform_opc(struct burn_drive *);
void mmc_get_configuration(struct burn_drive *);
/* ts A61110 : added parameters trackno, lba, nwa. Redefined return value.
@return 1=nwa is valid , 0=nwa is not valid , -1=error */
int mmc_get_nwa(struct burn_drive *d, int trackno, int *lba, int *nwa);
int mmc_get_nwa(struct burn_drive *);
void mmc_send_cue_sheet(struct burn_drive *, struct cue_sheet *);
/* ts A61023 : get size and free space of drive buffer */

View File

@ -152,14 +152,6 @@ void burn_write_opts_set_mediacatalog(struct burn_write_opts *opts,
memcpy(opts->mediacatalog, &mediacatalog, 13);
}
/* ts A61106 */
void burn_write_opts_set_multi(struct burn_write_opts *opts, int multi)
{
opts->multi = !!multi;
}
void burn_read_opts_set_raw(struct burn_read_opts *opts, int raw)
{
opts->raw = raw;
@ -206,4 +198,3 @@ void burn_read_opts_set_hardware_error_retries(struct burn_read_opts *opts,
{
opts->hardware_error_retries = hardware_error_retries;
}

View File

@ -19,15 +19,6 @@
#include "toc.h"
#include "write.h"
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#endif /* Libburn_log_in_and_out_streaM */
/*static unsigned char isrc[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";*/
#define sector_common(X) d->alba++; d->rlba X;
@ -53,8 +44,7 @@ static void uncook_subs(unsigned char *dest, unsigned char *source)
int sector_get_outmode(enum burn_write_types write_type,
enum burn_block_types block_type)
{
/* ts A61103 : extended SAO condition to TAO */
if (write_type == BURN_WRITE_SAO || write_type == BURN_WRITE_TAO)
if (write_type == BURN_WRITE_SAO)
return 0;
else
switch (block_type) {
@ -91,15 +81,6 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
{
int valid, shortage, curr, i, tr;
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
static int tee_fd= -1;
if(tee_fd==-1)
tee_fd= open("/tmp/libburn_sg_readin",
O_WRONLY|O_CREAT|O_TRUNC,S_IRUSR|S_IWUSR);
#endif /* Libburn_log_in_and_out_streaM */
/* no track pointer means we're just generating 0s */
if (!track) {
memset(data, 0, count);
@ -126,18 +107,10 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
valid = track->source->read(track->source, data + curr, count - curr);
} else valid = 0;
if (valid <= 0) { /* ts A61031 : extended from (valid == -1) */
if (valid == -1) {
track->eos = 1;
valid = 0;
}
track->sourcecount += valid;
#ifdef Libburn_log_in_and_out_streaM
/* <<< ts A61031 */
if(tee_fd!=-1 && valid>0) {
write(tee_fd, data + curr, valid);
}
#endif /* Libburn_log_in_and_out_streaM */
curr += valid;
shortage = count - curr;
@ -161,12 +134,6 @@ static void get_bytes(struct burn_track *track, int count, unsigned char *data)
if (!shortage)
goto ex;
/* ts A61031 */
if (shortage >= count)
track->track_data_done = 1;
if (track->open_ended)
goto ex;
/* If we're still short, and there's a "next" pointer, we pull from that.
if that depletes, we'll just fill with 0s.
*/
@ -185,6 +152,15 @@ ex:;
if(shortage)
memset(data + curr, 0, shortage); /* this is old icculus.org */
if (track->swap_source_bytes == 1) {
/*
{ static int swapping_count= 0;
fprintf(stderr,"\rlibburn_debug: swapping #%d \r",
swapping_count);
swapping_count++;
}
*/
for (i = 1; i < count; i += 2) {
tr = data[i];
data[i] = data[i-1];
@ -195,9 +171,7 @@ ex:;
/* ts A61009 : seems to hand out sector start pointer in opts->drive->buffer
and to count hand outs as well as reserved bytes */
/* ts A61101 : added parameter track for counting written bytes */
static unsigned char *get_sector(struct burn_write_opts *opts,
struct burn_track *track, int inmode)
static unsigned char *get_sector(struct burn_write_opts *opts, int inmode)
{
struct burn_drive *d = opts->drive;
struct buffer *out = d->buffer;
@ -222,13 +196,6 @@ static unsigned char *get_sector(struct burn_write_opts *opts,
err = d->write(d, d->nwa, out);
if (err == BE_CANCELLED)
return NULL;
/* ts A61101 */
if(track != NULL) {
track->writecount += out->bytes;
track->written_sectors += out->sectors;
}
d->nwa += out->sectors;
out->bytes = 0;
out->sectors = 0;
@ -241,32 +208,6 @@ static unsigned char *get_sector(struct burn_write_opts *opts,
return ret;
}
/* ts A61031 */
/* Revoke the counting of the most recent sector handed out by get_sector() */
static void unget_sector(struct burn_write_opts *opts, int inmode)
{
struct burn_drive *d = opts->drive;
struct buffer *out = d->buffer;
int outmode;
int seclen;
outmode = get_outmode(opts);
if (outmode == 0)
outmode = inmode;
/* ts A61009 : react on eventual failure of burn_sector_length()
(should not happen if API tested properly).
Ensures out->bytes >= out->sectors */
seclen = burn_sector_length(outmode);
if (seclen <= 0)
return;
seclen += burn_subcode_length(outmode);
out->bytes -= seclen;
out->sectors--;
}
/* either inmode == outmode, or outmode == raw. anything else is bad news */
/* ts A61010 : changed type to int in order to propagate said bad news */
/** @return 1 is ok, <= 0 is failure */
@ -394,7 +335,7 @@ int sector_toc(struct burn_write_opts *o, int mode)
unsigned char *data;
unsigned char subs[96];
data = get_sector(o, NULL, mode);
data = get_sector(o, mode);
if (data == NULL)
return 0;
/* ts A61010 */
@ -414,7 +355,7 @@ int sector_pregap(struct burn_write_opts *o,
unsigned char *data;
unsigned char subs[96];
data = get_sector(o, NULL, mode);
data = get_sector(o, mode);
if (data == NULL)
return 0;
/* ts A61010 */
@ -434,7 +375,7 @@ int sector_postgap(struct burn_write_opts *o,
unsigned char subs[96];
unsigned char *data;
data = get_sector(o, NULL, mode);
data = get_sector(o, mode);
if (data == NULL)
return 0;
/* ts A61010 */
@ -606,7 +547,7 @@ int sector_lout(struct burn_write_opts *o, unsigned char control, int mode)
unsigned char subs[96];
unsigned char *data;
data = get_sector(o, NULL, mode);
data = get_sector(o, mode);
if (!data)
return 0;
/* ts A61010 */
@ -625,19 +566,13 @@ int sector_data(struct burn_write_opts *o, struct burn_track *t, int psub)
unsigned char subs[96];
unsigned char *data;
data = get_sector(o, t, t->mode);
data = get_sector(o, t->mode);
if (!data)
return 0;
/* ts A61010 */
if (convert_data(o, t, t->mode, data) <= 0)
return 0;
/* ts A61031 */
if (t->open_ended && t->track_data_done) {
unget_sector(o, t->mode);
return 2;
}
if (!t->source->read_sub)
subcode_user(o, subs, t->entry->point,
t->entry->control, 1, &t->isrc, psub);
@ -687,11 +622,6 @@ int sector_headers_is_ok(struct burn_write_opts *o, int mode)
return 1;
if (o->write_type == BURN_WRITE_SAO)
return 1;
/* ts A61031 */
if (o->write_type == BURN_WRITE_TAO)
return 1;
if (mode & BURN_MODE1)
return 2;
return 0;
@ -720,11 +650,6 @@ void sector_headers(struct burn_write_opts *o, unsigned char *out,
return;
if (o->write_type == BURN_WRITE_SAO)
return;
/* ts A61031 */
if (o->write_type == BURN_WRITE_TAO)
return;
if (mode & BURN_MODE1)
modebyte = 1;

View File

@ -481,7 +481,6 @@ static void enumerate_common(char *fname, int bus_no, int host_no,
out.get_nwa = mmc_get_nwa;
out.close_disc = mmc_close_disc;
out.close_session = mmc_close_session;
out.close_track_session = mmc_close;
out.read_buffer_capacity = mmc_read_buffer_capacity;
out.idata = malloc(sizeof(struct burn_scsi_inquiry_data));
out.idata->valid = 0;

View File

@ -585,40 +585,19 @@ int sg_release(struct burn_drive *d)
return 0;
}
int sg_issue_command(struct burn_drive *d, struct command *c)
{
int done = 0, no_c_page = 0;
int err;
sg_io_hdr_t s;
#ifdef Libburn_log_sg_commandS
/* <<< ts A61030 */
static FILE *fp= NULL;
static int fpcount= 0;
int i;
#endif /* Libburn_log_sg_commandS */
/* <<< ts A60821
debug: for tracing calls which might use open drive fds */
/* ts A60821
<<< debug: for tracing calls which might use open drive fds */
char buf[161];
sprintf(buf,"sg_issue_command d->fd= %d d->released= %d\n",
d->fd,d->released);
mmc_function_spy(buf);
#ifdef Libburn_log_sg_commandS
/* <<< ts A61030 */
if(fp==NULL) {
fp= fopen("/tmp/libburn_sg_command_log","a");
fprintf(fp,"\n-----------------------------------------\n");
}
for(i=0;i<10;i++)
fprintf(fp,"%2.2x ", c->opcode[i]);
fprintf(fp,"\n");
fpcount++;
#endif /* Libburn_log_sg_commandS */
/* ts A61010 : with no fd there is no chance to send an ioctl */
if (d->fd < 0) {
c->error = 1;
@ -691,9 +670,7 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
if (s.sb_len_wr) {
if (!c->retry) {
c->error = 1;
/* A61106: rather than : return 1 */
goto ex;
return 1;
}
switch (scsi_error(d, s.sbp, s.sb_len_wr)) {
case RETRY:
@ -708,59 +685,9 @@ int sg_issue_command(struct burn_drive *d, struct command *c)
done = 1;
}
} while (!done);
/* ts A61106 */
ex:;
if (c->error) {
/* >>> to become d->notify_error() */
scsi_notify_error(d, c, s.sbp, s.sb_len_wr, 0);
}
return 1;
}
/* ts A61030 - A61109 */
/* @param flag bit0=do report conditions which are considered not an error */
int scsi_notify_error(struct burn_drive *d, struct command *c,
unsigned char *sense, int senselen, int flag)
{
int key= -1, asc= -1, ascq= -1, ret;
char msg[160];
if (d->silent_on_scsi_error)
return 1;
if (senselen > 2)
key = sense[2];
if (senselen > 13) {
asc = sense[12];
ascq = sense[13];
}
if(!(flag & 1)) {
/* SPC : TEST UNIT READY command */
if (c->opcode[0] == 0)
return 1;
/* MMC : READ DISC INFORMATION command */
if (c->opcode[0] == 0x51)
if (key == 0x2 && asc == 0x3A &&
ascq>=0 && ascq <= 0x02) /* MEDIUM NOT PRESENT */
return 1;
}
sprintf(msg,"SCSI error condition on command %2.2Xh :", c->opcode[0]);
if (key>=0)
sprintf(msg+strlen(msg), " key=%Xh", key);
if (asc>=0)
sprintf(msg+strlen(msg), " asc=%2.2Xh", asc);
if (ascq>=0)
sprintf(msg+strlen(msg), " ascq=%2.2Xh", ascq);
ret = libdax_msgs_submit(libdax_messenger, d->global_index, 0x0002010f,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, msg,0,0);
return ret;
}
enum response scsi_error(struct burn_drive *d, unsigned char *sense,
int senselen)
{

View File

@ -64,9 +64,5 @@ int sg_release(struct burn_drive *);
int sg_issue_command(struct burn_drive *, struct command *);
enum response scsi_error(struct burn_drive *, unsigned char *, int);
/* ts A61030 */
/* @param flag bit0=do also report TEST UNIT READY failures */
int scsi_notify_error(struct burn_drive *, struct command *c,
unsigned char *sense, int senselen, int flag);
#endif /* __SG */

View File

@ -22,10 +22,6 @@ enum burn_source_status burn_track_set_source(struct burn_track *t,
return BURN_SOURCE_FAILED;
s->refcount++;
t->source = s;
/* ts A61031 */
t->open_ended = (s->get_size(s) <= 0);
return BURN_SOURCE_OK;
}

View File

@ -274,11 +274,6 @@ void spc_sense_write_params(struct burn_drive *d)
mmc_read_disc_info(d);
}
/* remark ts A61104 :
Although command MODE SELECT is SPC, the content of the
Write Parameters Mode Page (05h) is MMC (Table 108 in MMC-1).
Thus the filling of the mode page should be done by a mmc_ function.
*/
void spc_select_write_params(struct burn_drive *d,
const struct burn_write_opts *o)
{
@ -289,13 +284,6 @@ void spc_select_write_params(struct burn_drive *d,
/* ts A61007 : All current callers are safe. */
/* a ssert(o->drive == d); */
/* <<< A61030
fprintf(stderr,"libburn_debug: write_type=%d multi=%d control=%d\n",
o->write_type,o->multi,o->control);
fprintf(stderr,"libburn_debug: block_type=%d spc_block_type=%d\n",
o->block_type,spc_block_type(o->block_type));
*/
memcpy(c.opcode, SPC_MODE_SELECT, sizeof(SPC_MODE_SELECT));
c.retry = 1;
c.oplen = sizeof(SPC_MODE_SELECT);
@ -319,17 +307,8 @@ void spc_select_write_params(struct burn_drive *d,
c.page->data[10] = (bufe << 6)
+ (sim << 4)
+ o->write_type;
/* ts A61106 : MMC-1 table 110 : multi==0 or multi==3 */
c.page->data[11] = ((3 * !!o->multi) << 6) | o->control;
c.page->data[11] = (o->multi << 6) | o->control;
c.page->data[12] = spc_block_type(o->block_type);
/* ts A61104 */
if(!(o->control&4)) /* audio (MMC-1 table 61) */
if(o->write_type == BURN_WRITE_TAO) /* ??? for others too ? */
c.page->data[12] = 0; /* Data Block Type: Raw Data */
c.page->data[22] = 0;
c.page->data[23] = 150; /* audio pause length */
/*XXX need session format! */
@ -382,10 +361,7 @@ void spc_probe_write_modes(struct burn_drive *d)
c.page->data[12] = try_block_type;
c.page->data[23] = 150;
c.dir = TO_DRIVE;
d->silent_on_scsi_error = 1;
d->issue_command(d, &c);
d->silent_on_scsi_error = 0;
key = c.sense[2];
asc = c.sense[12];
@ -494,10 +470,6 @@ int burn_scsi_setup_drive(struct burn_drive *d, int bus_no, int host_no,
d->channel = channel_no;
d->lun = lun_no;
/* ts A61106 */
d->silent_on_scsi_error = 0;
d->idata = malloc(sizeof(struct burn_scsi_inquiry_data));
d->idata->valid = 0;
d->mdata = malloc(sizeof(struct scsi_mode_data));

View File

@ -115,17 +115,6 @@ struct burn_track *burn_track_create(void)
t->pad = 1;
t->entry = NULL;
t->source = NULL;
t->eos = 0;
/* ts A61101 */
t->sourcecount = 0;
t->writecount = 0;
t->written_sectors = 0;
/* ts A61031 */
t->open_ended = 0;
t->track_data_done = 0;
t->postgap = 0;
t->pregap1 = 0;
t->pregap2 = 0;
@ -329,31 +318,6 @@ int burn_track_get_sectors(struct burn_track *t)
return sectors;
}
/* ts A61031 */
int burn_track_is_open_ended(struct burn_track *t)
{
return !!t->open_ended;
}
/* ts A61101 : API function */
int burn_track_get_counters(struct burn_track *t,
off_t *read_bytes, off_t *written_bytes)
{
/*
fprintf(stderr, "libburn_experimental: sizeof(off_t)=%d\n",
sizeof(off_t));
*/
*read_bytes = t->sourcecount;
*written_bytes = t->writecount;
return 1;
}
/* ts A61031 */
int burn_track_is_data_done(struct burn_track *t)
{
return !!t->track_data_done;
}
int burn_track_get_shortage(struct burn_track *t)
{
int size;

View File

@ -31,18 +31,6 @@ struct burn_track
struct burn_source *source;
/** End of Source flag */
int eos;
/* ts A61101 */
off_t sourcecount;
off_t writecount;
off_t written_sectors;
/* ts A61031 */
/** Source is of undefined length */
int open_ended;
/** End of open ended track flag : offset+payload+tail are delivered */
int track_data_done;
/** The audio/data mode for the entry. Derived from control and
possibly from reading the track's first sector. */
int mode;
@ -83,10 +71,4 @@ struct burn_disc
int burn_track_get_shortage(struct burn_track *t);
/* ts A61031 : might go to libburn.h */
int burn_track_is_open_ended(struct burn_track *t);
int burn_track_is_data_done(struct burn_track *t);
#endif /* BURN__STRUCTURE_H */

View File

@ -129,10 +129,6 @@ struct burn_drive
enum burn_disc_status status;
int erasable;
volatile int released;
/* ts A61106 */
int silent_on_scsi_error;
int nwa; /* next writeable address */
int alba; /* absolute lba */
int rlba; /* relative lba in section */
@ -182,7 +178,7 @@ struct burn_drive
void (*send_cue_sheet) (struct burn_drive *, struct cue_sheet *);
void (*sync_cache) (struct burn_drive *);
int (*get_erase_progress) (struct burn_drive *);
int (*get_nwa) (struct burn_drive *, int trackno, int *lba, int *nwa);
int (*get_nwa) (struct burn_drive *);
/* ts A61009 : removed d in favor of o->drive */
/* void (*close_disc) (struct burn_drive * d,
@ -193,10 +189,6 @@ struct burn_drive
void (*close_disc) (struct burn_write_opts * o);
void (*close_session) ( struct burn_write_opts * o);
/* ts A61029 */
void (*close_track_session) ( struct burn_drive *d,
int session, int track);
int (*test_unit_ready) (struct burn_drive * d);
void (*probe_write_modes) (struct burn_drive * d);
struct params params;

View File

@ -7,13 +7,6 @@
/* #include <a ssert.h> */
/* ts A61106 : Deliberate defect provocation macros
DO NOT DEFINE THESE IF YOU WANT SUCCESSFUL TAO !
#define Libburn_experimental_no_close_tracK 1
#define Libburn_experimental_no_close_sessioN 1
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
@ -106,7 +99,7 @@ void type_to_form(int mode, unsigned char *ctladr, int *form)
*form |= 0x40;
}
int burn_write_flush(struct burn_write_opts *o, struct burn_track *track)
int burn_write_flush(struct burn_write_opts *o)
{
struct burn_drive *d = o->drive;
@ -115,112 +108,13 @@ int burn_write_flush(struct burn_write_opts *o, struct burn_track *track)
err = d->write(d, d->nwa, d->buffer);
if (err == BE_CANCELLED)
return 0;
/* A61101 */
if(track != NULL) {
track->writecount += d->buffer->bytes;
track->written_sectors += d->buffer->sectors;
}
d->nwa += d->buffer->sectors;
d->buffer->bytes = 0;
d->buffer->sectors = 0;
}
d->sync_cache(d);
return 1;
}
/* ts A61030 */
int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
int tnum)
{
char msg[81];
struct burn_drive *d;
struct burn_track *t;
int todo, step, cancelled, seclen;
/* ts A61106 */
#ifdef Libburn_experimental_no_close_tracK
return 1;
#endif
d = o->drive;
t = s->track[tnum];
/* ts A61103 : pad up track to minimum size of 600 sectors */
if (t->written_sectors < 300) {
todo = 300 - t->written_sectors;
sprintf(msg,"Padding up track to minimum size (+ %d sectors)",
todo);
libdax_msgs_submit(libdax_messenger, o->drive->global_index,
0x0002011a,
LIBDAX_MSGS_SEV_NOTE, LIBDAX_MSGS_PRIO_HIGH, msg,0,0);
step = BUFFER_SIZE / 4096; /* shall fit any sector size */
if (step <= 0)
step = 1;
seclen = burn_sector_length(t->mode);
if (seclen <= 0)
seclen = 2048;
memset(d->buffer, 0, sizeof(struct buffer));
cancelled = d->cancel;
for (; todo > 0; todo -= step) {
if (step > todo)
step = todo;
d->buffer->bytes = step*seclen;
d->buffer->sectors = step;
d->cancel = 0;
d->write(d, d->nwa, d->buffer);
d->nwa += d->buffer->sectors;
t->writecount += d->buffer->bytes;
t->written_sectors += d->buffer->sectors;
}
d->cancel = cancelled;
}
/* ts A61102 */
d->busy = BURN_DRIVE_CLOSING_TRACK;
sprintf(msg, "Closing track %2.2d", tnum+1);
libdax_msgs_submit(libdax_messenger, o->drive->global_index,0x00020119,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH, msg,0,0);
/* MMC-1 mentions track number 0xFF for "the incomplete track",
MMC-3 does not. I tried both. 0xFF was in effect when other
bugs finally gave up and made way for readable tracks. */
d->close_track_session(o->drive, 0, 0xff); /* tnum+1); */
/* ts A61102 */
d->busy = BURN_DRIVE_WRITING;
return 1;
}
/* ts A61030 */
int burn_write_close_session(struct burn_write_opts *o, struct burn_session *s)
{
/* ts A61106 */
#ifdef Libburn_experimental_no_close_sessioN
return 1;
#endif
libdax_msgs_submit(libdax_messenger, o->drive->global_index,0x00020119,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_HIGH,
"Closing session", 0, 0);
/* ts A61102 */
o->drive->busy = BURN_DRIVE_CLOSING_SESSION;
o->drive->close_track_session(o->drive, 1, 0);
/* ts A61102 */
o->drive->busy = BURN_DRIVE_WRITING;
return 1;
}
/* ts A60819:
This is unused since about Feb 2006, icculus.org/burn CVS.
The compiler complains. We shall please our compiler.
@ -334,20 +228,11 @@ struct cue_sheet *burn_create_toc_entries(struct burn_write_opts *o,
/* ts A61009 */
/* a ssert(d->toc_entry == NULL); */
if (d->toc_entry != NULL) {
/* ts A61109 : this happens with appendable CDs
>>> Open question: is the existing TOC needed ? */
/* ts A61109 : for non-SAO, this sheet is thrown away later */
free((char *) d->toc_entry);
/*
libdax_msgs_submit(libdax_messenger,
d->global_index, 0x00020117,
LIBDAX_MSGS_SEV_FATAL, LIBDAX_MSGS_PRIO_HIGH,
"toc_entry of drive is already in use", 0, 0);
goto failed;
*/
}
d->toc_entry = calloc(d->toc_entries, sizeof(struct burn_toc_entry));
@ -417,17 +302,8 @@ XXX this is untested :)
*/
if (!tar[i]->pad) {
rem += burn_track_get_shortage(tar[i]);
/* ts A61101 : I doubt that linking would yield a
desireable effect. With TAO it is
counterproductive in any way.
*/
if (o->write_type == BURN_WRITE_TAO)
tar[i]->source->next = NULL;
else
if (i +1 != ntr)
tar[i]->source->next = tar[i+1]->source;
if (i +1 != ntr)
tar[i]->source->next = tar[i+1]->source;
} else if (rem) {
rem = 0;
runtime++;
@ -541,7 +417,7 @@ int burn_write_session(struct burn_write_opts *o, struct burn_session *s)
{
struct burn_drive *d = o->drive;
struct burn_track *prev = NULL, *next = NULL;
int i, ret;
int i;
d->rlba = 0;
burn_print(1, " writing a session\n");
@ -554,15 +430,9 @@ int burn_write_session(struct burn_write_opts *o, struct burn_session *s)
next = NULL;
if (!burn_write_track(o, s, i))
{ ret = 0; goto ex; }
return 0;
}
/* ts A61103 */
ret = 1;
ex:;
if (o->write_type == BURN_WRITE_TAO)
burn_write_close_session(o, s);
return ret;
return 1;
}
int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
@ -570,18 +440,13 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
{
struct burn_track *t = s->track[tnum];
struct burn_drive *d = o->drive;
int i, tmp = 0, open_ended = 0, ret, nwa, lba;
int i, tmp = 0;
int sectors;
char msg[80];
d->rlba = -150;
/* XXX for tao, we don't want the pregaps but still want post? */
if (o->write_type != BURN_WRITE_TAO) {
/* ts A61102 */
d->busy = BURN_DRIVE_WRITING_PREGAP;
if (t->pregap1)
d->rlba += 75;
if (t->pregap2)
@ -597,36 +462,20 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
for (i = 0; i < 75; i++)
if (!sector_pregap(o, t->entry->point,
pt->entry->control, pt->mode))
{ ret = 0; goto ex; }
return 0;
}
if (t->pregap2)
for (i = 0; i < 150; i++)
if (!sector_pregap(o, t->entry->point,
t->entry->control, t->mode))
{ ret = 0; goto ex; }
return 0;
} else {
o->control = t->entry->control;
d->send_write_parameters(d, o);
/* ts A61103 */
ret = d->get_nwa(d, -1, &lba, &nwa);
sprintf(msg,
"pre-track %2.2d : get_nwa(%d), ret= %d , d->nwa= %d\n",
tnum+1, nwa, ret, d->nwa);
libdax_msgs_submit(libdax_messenger, d->global_index, 0x000002,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
msg,0,0);
if (nwa > d->nwa)
d->nwa = nwa;
}
/* user data */
/* ts A61102 */
d->busy = BURN_DRIVE_WRITING;
sectors = burn_track_get_sectors(t);
open_ended = burn_track_is_open_ended(t);
/* Update progress */
d->progress.start_sector = d->nwa;
@ -639,11 +488,10 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
burn_print(12, "track %d is %d sectors long\n", tnum, sectors);
/* ts A61030 : this cannot happen. tnum is alsways < s-tracks */
if (tnum == s->tracks)
tmp = sectors > 150 ? 150 : sectors;
for (i = 0; open_ended || i < sectors - tmp; i++) {
for (i = 0; i < sectors - tmp; i++) {
/* ts A61023 : http://libburn.pykix.org/ticket/14
From time to time inquire drive buffer */
@ -651,24 +499,12 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
d->read_buffer_capacity(d);
if (!sector_data(o, t, 0))
{ ret = 0; goto ex; }
/* ts A61031 */
if (open_ended) {
d->progress.sectors = sectors = i;
if (burn_track_is_data_done(t))
break;
}
return 0;
/* update current progress */
d->progress.sector++;
}
for (; i < sectors; i++) {
/* ts A61030: program execution never gets to this point */
fprintf(stderr,"LIBBURN_DEBUG: TNUM=%d TRACKS=%d TMP=%d\n",
tnum, s->tracks, tmp);
burn_print(1, "last track, leadout prep\n");
/* ts A61023 */
@ -676,7 +512,7 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
d->read_buffer_capacity(d);
if (!sector_data(o, t, 1))
{ ret = 0; goto ex; }
return 0;
/* update progress */
d->progress.sector++;
@ -686,41 +522,23 @@ int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
for (i = 0; i < 150; i++)
if (!sector_postgap(o, t->entry->point, t->entry->control,
t->mode))
{ ret = 0; goto ex; }
return 0;
i = t->offset;
if (o->write_type == BURN_WRITE_SAO) {
if (d->buffer->bytes) {
int err;
err = d->write(d, d->nwa, d->buffer);
if (err == BE_CANCELLED)
{ ret = 0; goto ex; }
/* A61101 : probably this is not all payload data */
/* A61108 : but audio count is short without this */
t->writecount += d->buffer->bytes;
return 0;
d->nwa += d->buffer->sectors;
d->buffer->bytes = 0;
d->buffer->sectors = 0;
}
}
/* ts A61103 */
ret = 1;
ex:;
if (o->write_type == BURN_WRITE_TAO) {
/* ts A61103 */
/* >>> if cancelled: ensure that at least 600 kB get written */
if (!burn_write_flush(o, t))
ret = 0;
/* ts A61030 */
if (burn_write_close_track(o, s, tnum) <= 0)
ret = 0;
}
return ret;
if (o->write_type == BURN_WRITE_TAO)
if (!burn_write_flush(o))
return 0;
return 1;
}
/* ts A61009 */
@ -750,8 +568,8 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
struct burn_drive *d = o->drive;
struct buffer buf;
struct burn_track *lt;
int first = 1, i, ret, lba, nwa;
char msg[80];
int first = 1, i;
int res;
/* ts A60924 : libburn/message.c gets obsoleted
burn_message_clear_queue();
@ -768,24 +586,15 @@ void burn_disc_write_sync(struct burn_write_opts *o, struct burn_disc *disc)
/* Apparently some drives require this command to be sent, and a few drives
return crap. so we send the command, then ignore the result.
*/
/* ts A61107 : moved up send_write_parameters because LG GSA-4082B
seems to dislike get_nwa() in advance */
res = d->get_nwa(d);
/* printf("ignored nwa: %d\n", res);*/
d->alba = d->start_lba;
d->nwa = d->alba;
if (o->write_type == BURN_WRITE_TAO) {
nwa = 0; /* get_nwa() will be called in burn_track() */
} else {
if (o->write_type != BURN_WRITE_TAO)
d->send_write_parameters(d, o);
ret = d->get_nwa(d, -1, &lba, &nwa);
sprintf(msg, "Inquired nwa: %d (ret=%d)", nwa, ret);
libdax_msgs_submit(libdax_messenger, d->global_index,
0x00000002,
LIBDAX_MSGS_SEV_DEBUG, LIBDAX_MSGS_PRIO_ZERO,
msg,0,0);
}
/* init progress before showing the state */
d->progress.session = 0;
d->progress.sessions = disc->sessions;
@ -827,19 +636,8 @@ return crap. so we send the command, then ignore the result.
goto fail;
} else {
if (first) {
/* ts A61030 : 0 made the burner take data. */
/* ts A61103 : Meanwhile d->nwa is updated in
burn_write_track() */
if(o->write_type == BURN_WRITE_TAO) {
d->nwa= d->alba = 0;
} else {
d->nwa = -150;
d->alba = -150;
}
d->nwa = -150;
d->alba = -150;
} else {
d->nwa += 4500;
d->alba += 4500;
@ -854,13 +652,8 @@ return crap. so we send the command, then ignore the result.
lt->mode))
goto fail;
} else {
/* ts A61030 */
if (o->write_type != BURN_WRITE_TAO)
if (!burn_write_flush(o, NULL))
goto fail;
if (!burn_write_flush(o))
goto fail;
d->nwa += first ? 6750 : 2250;
d->alba += first ? 6750 : 2250;
}
@ -872,18 +665,15 @@ return crap. so we send the command, then ignore the result.
d->progress.start_sector = 0;
d->progress.sectors = 0;
}
/* ts A61030: extended skipping of flush to TAO: session is closed */
if (o->write_type != BURN_WRITE_SAO && o->write_type != BURN_WRITE_TAO)
if (!burn_write_flush(o, NULL))
if (o->write_type != BURN_WRITE_SAO)
if (!burn_write_flush(o))
goto fail;
sleep(1);
burn_print(1, "done\n");
d->busy = BURN_DRIVE_IDLE;
/* ts A61012 : This return was traditionally missing. I suspect this
/* ts A61012 : This return was traditionally missing, a suspect this
to have caused Cdrskin_eject() failures */
return;

View File

@ -24,11 +24,6 @@ int burn_write_leadout(struct burn_write_opts *o,
int burn_write_session(struct burn_write_opts *o, struct burn_session *s);
int burn_write_track(struct burn_write_opts *o, struct burn_session *s,
int tnum);
int burn_write_flush(struct burn_write_opts *o, struct burn_track *track);
/* ts A61030 : necessary for TAO */
int burn_write_close_track(struct burn_write_opts *o, struct burn_session *s,
int tnum);
int burn_write_close_session(struct burn_write_opts *o,struct burn_session *s);
int burn_write_flush(struct burn_write_opts *o);
#endif /* BURN__WRITE_H */

View File

@ -35,10 +35,17 @@
*/
/* We shall prepare for times when more than 2 GB of data are to be handled.
This gives POSIX-ly 64 bit off_t */
#ifndef _LARGEFILE_SOURCE
#define _LARGEFILE_SOURCE 1
#endif
#ifndef _FILE_OFFSET_BITS
#define _FILE_OFFSET_BITS 64
#endif
/** See this for the decisive API specs . libburn.h is The Original */
/* For using the installed header file : #include <libburn/libburn.h> */
/* This program insists in the own headerfile. */
#include "../libburn/libburn.h"
#include <libburn/libburn.h>
/* libburn is intended for Linux systems with kernel 2.4 or 2.6 for now */
#include <stdio.h>
@ -242,8 +249,7 @@ int libburner_aquire_by_driveno(int *driveno)
int libburner_blank_disc(struct burn_drive *drive, int blank_fast)
{
enum burn_disc_status disc_state;
struct burn_progress p;
int percent = 1;
struct burn_progress progress;
while (burn_drive_get_status(drive, NULL) != BURN_DRIVE_IDLE)
usleep(1001);
@ -275,13 +281,11 @@ int libburner_blank_disc(struct burn_drive *drive, int blank_fast)
}
printf(
"Beginning to %s-blank CD media.\n", (blank_fast?"fast":"full"));
printf(
"Expect some garbage sector numbers and some zeros at first.\n");
burn_disc_erase(drive, blank_fast);
sleep(1);
while (burn_drive_get_status(drive, &p) != BURN_DRIVE_IDLE) {
if(p.sectors>0 && p.sector>=0) /* display 1 to 99 percent */
percent = 1.0 + ((double) p.sector+1.0)
/ ((double) p.sectors) * 98.0;
printf("Blanking ( %d%% done )\n", percent);
while (burn_drive_get_status(drive, &progress) != BURN_DRIVE_IDLE) {
printf("Blanking sector %d\n", progress.sector);
sleep(1);
}
printf("Done\n");