### Example Cgen Run Source: https://github.com/libburnia/libburn/blob/master/libcevap/cgen.txt Demonstrates a complete example run of the Cgen tool, showing class definitions and element modifiers. ```bash rm class_x.c class_x.h class_y.c class_y.h bin/cgen <<+ -l class_x -r -v struct Boss_clasS *boss -v int x -r -v struct stat stbuf -m struct Class_Y *y -m char *text -c struct Class_X *master -c struct Class_X *slave -b -l struct Class_X *provider -p -v struct Class_X *last_provider @ -b -l class_y -r -v char providername[80] @ + ``` -------------------------------- ### Cdrskin FIFO Buffer Control Source: https://github.com/libburnia/libburn/blob/master/cdrskin/wiki_plain.txt Examples demonstrating the use of 'fs' and 'fifo_start_at' options to control the FIFO buffer size and when it starts filling. These options can influence throughput, especially with high-speed media. ```bash cdrskin ... fs=128m fifo_start_at=20m ... ``` ```bash cdrskin ... fifo_start_at=0 ... ``` -------------------------------- ### Friendly Program Usage of open-cd-excl Source: https://github.com/libburnia/libburn/blob/master/doc/ddlp.txt Examples of how friendly programs should use the open-cd-excl command with various options for opening and accessing CD/DVD drives. ```bash ./open-cd-excl -e -r /dev/sr0 ``` ```bash ./open-cd-excl -e -w /dev/sg1 ``` ```bash ./open-cd-excl -e -w /dev/black-drive ``` ```bash ./open-cd-excl -f -r /dev/sg1 ``` ```bash ./open-cd-excl -e -f -w /dev/sr0 ``` -------------------------------- ### Scan for Drives Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html Get an overview of available drives and their addresses on the system. ```bash # cdrskin -scanbus ``` ```bash # cdrskin dev=ATA -scanbus ``` ```bash # cdrskin --devices ``` -------------------------------- ### Check Drive or Media Info Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html Get detailed information about a specific drive or the media loaded within it. ```bash $ cdrskin dev=0,1,0 -checkdrive ``` ```bash $ cdrskin dev=ATA:1,0,0 -v -atip ``` ```bash $ cdrskin dev=/dev/hdc -minfo ``` -------------------------------- ### Example CDRWIN Cue Sheet File Source: https://github.com/libburnia/libburn/blob/master/doc/cdtext.txt This is an example of a CDRWIN cue sheet file named NIGHTCATS.CUE. It defines catalog information, the audio data file, and details for each track including title, performer, ISRC, and index. ```cue CATALOG 1234567890123 FILE "audiodata.bin" BINARY TITLE "Joyful Nights" TRACK 01 AUDIO FLAGS DCP TITLE "Song of Joy" PERFORMER "Felix and The Purrs" SONGWRITER "Friedrich Schiller" ISRC XYBLG1101234 INDEX 01 00:00:00 TRACK 02 AUDIO FLAGS DCP TITLE "Humpty Dumpty" PERFORMER "Catwalk Beauties" SONGWRITER "Mother Goose" ISRC XYBLG1100005 INDEX 01 08:20:12 TRACK 03 AUDIO FLAGS DCP TITLE "Mee Owwww" PERFORMER "Mia Kitten" SONGWRITER "Mia Kitten" ISRC XYBLG1100006 INDEX 01 13:20:33 ``` -------------------------------- ### Specifying Write Start Address Source: https://github.com/libburnia/libburn/blob/master/cdrskin/wiki_plain.txt Illustrates how to set the write_start_address option to position a track on a specific block address, useful for media like DVD-RAM. ```bash cdrskin ... write_start_address=2412m ... ``` -------------------------------- ### Get Help Information Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html Display help information for cdrskin. Separate commands are used to view cdrecord-compatible options and non-cdrecord specific options. ```bash $ [cdrskin -help](cdrskin_help) ``` ```bash $ [cdrskin --help](cdrskin__help) ``` -------------------------------- ### CD Media ID Format Example Source: https://github.com/libburnia/libburn/blob/master/doc/mediainfo.txt Illustrates the format of CD media IDs as returned by libburn, including ATIP lead-in addresses. ```c burn_disc_get_media_id() encodes both tuples in its reply parameters as e.g. "97m15s35f/79m59s74f" , "97m15s35f", "79m59s74f" ``` -------------------------------- ### Configuring FIFO Buffer Start Source: https://github.com/libburnia/libburn/blob/master/cdrskin/wiki_plain.txt Sets the fifo_start_at option to begin burning after a specified number of bytes are read, rather than waiting for the FIFO to be completely full. This can help with unsteady data streams but risks initial buffer underruns. ```bash fifo_start_at= ``` -------------------------------- ### Ignorant Program Usage of open-cd-excl Source: https://github.com/libburnia/libburn/blob/master/doc/ddlp.txt Examples of how ignorant programs might use open-cd-excl, potentially leading to issues, especially when referencing non-standard device paths. ```bash ./open-cd-excl -r /dev/sr0 ``` ```bash ./open-cd-excl -w /dev/sg1 ``` ```bash ./open-cd-excl -f -w /dev/black-drive ``` -------------------------------- ### Build cdrskin from Source Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html Build cdrskin from the cloned repository. This involves running bootstrap, configure, and make, followed by a specific script to compile cdrskin. ```bash cd libburn ; ./bootstrap ; ./configure --prefix /usr ; make ; cdrskin/compile_cdrskin.sh ``` -------------------------------- ### Pack Type 0x89 Payload Example Source: https://github.com/libburnia/libburn/blob/master/doc/cdtext.txt This example demonstrates the hexadecimal output for pack type 0x89, which is related to time points within CD tracks. The data is based on Sony example values. ```hexadecimal 89 01 28 00 01 04 00 00 00 00 02 29 30 02 34 3a f3 0c 89 06 29 00 02 04 00 00 00 00 17 0e 19 17 1d 3c 73 92 89 07 2a 00 03 04 00 00 00 00 1c 1e 27 1c 2a 1e 72 20 89 0d 2b 00 04 04 00 00 00 00 37 0d 1a 37 1f 32 0b 62 ``` -------------------------------- ### Display Help Options for cdrskin Source: https://github.com/libburnia/libburn/blob/master/cdrskin/wiki_plain.txt Use 'cdrskin -help' for cdrecord-compatible options. Use 'cdrskin --help' for cdrskin-specific options. Online documentation is available for both. ```bash cdrskin -help ``` ```bash cdrskin --help ``` -------------------------------- ### Using Pseudo-Drives with cdrskin Source: https://github.com/libburnia/libburn/blob/master/cdrskin/wiki_plain.txt Demonstrates how to use standard output, named pipes, and character devices as targets for write-only operations in cdrskin. ```bash dev=stdio:/dev/fd/1 dev=stdio:/tmp/named_pipe dev=stdio:/dev/ptyxy ``` -------------------------------- ### Pack Type 0x88 Payload Example Source: https://github.com/libburnia/libburn/blob/master/doc/cdtext.txt This example shows the hexadecimal representation of a pack type 0x88 payload, derived from Sony TOC data. It illustrates the structure for recording track information. ```hexadecimal 88 00 23 00 01 0e 00 3f 02 12 00 00 00 00 00 00 12 00 88 01 24 00 00 02 00 04 0b 19 08 02 32 0b 2f 3e 67 2d ... 88 0d 27 00 35 18 19 39 03 19 00 00 00 00 00 00 ea af ``` -------------------------------- ### Prone to Failure Usage of open-cd-excl Source: https://github.com/libburnia/libburn/blob/master/doc/ddlp.txt An example of a usage pattern for open-cd-excl that is noted as being prone to failure without further explanation. ```bash ./open-cd-excl -e -r /dev/sg1 ``` -------------------------------- ### List Available Devices Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html Use this command to list all available CD/DVD/BD devices recognized by cdrskin. Run as a normal user first, and if not all drives appear, run as superuser. ```bash cdrskin --devices ``` -------------------------------- ### ddlpa occupation for IDE/SCSI devices Source: https://github.com/libburnia/libburn/blob/master/doc/ddlp.txt Example output of ddlpa successfully acquiring an exclusive lock on a single-representation device like /dev/hdc. ```text DDLPA_DEBUG: ddlpa_std_by_rdev("/dev/hdc") = "/dev/hdc" DDLPA_DEBUG: ddlpa_occupy() O_EXCL : '/dev/hdc' ---------------------------------------------- Lock gained ddlpa: opened /dev/hdc slept 1 seconds of 1 ``` -------------------------------- ### Get Multi-Session Info Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html Retrieve multi-session information required for the -C option of the mkisofs program. This helps in correctly appending sessions. ```bash $ c_values=$(cdrskin dev=/dev/sr0 -msinfo 2>/dev/null) $ mkisofs ... -C "$c_values" ... ``` -------------------------------- ### open-cd-excl command-line options Source: https://github.com/libburnia/libburn/blob/master/doc/ddlp.txt Explains the various command-line options available for the open-cd-excl utility, which allows testing different locking strategies. ```text Options: -e : open O_EXCL -f : aquire lock by fcntl(F_SETLK) after sucessful open -i : do not wait in case of success but exit 0 immediately -r : open O_RDONLY , with -f use F_RDLCK -w : open O_RDWR , with -f use F_WRLCK plus the path of the devce file to open. ``` -------------------------------- ### Define a List Element Source: https://github.com/libburnia/libburn/blob/master/libcevap/cgen.txt Defines a list element with start and end pointers to a listable class, providing methods for list manipulation. ```cgen -l struct XyZ *list_start ``` ```cgen -v struct XyZ *list_end ``` -------------------------------- ### Growing ISO-9660 Filesystems on Overwriteable Media Source: https://github.com/libburnia/libburn/blob/master/cdrskin/wiki_plain.txt Demonstrates the use of the '--grow_overwriteable_iso' option for DVD multi-session writing, inspired by growisofs. This feature allows growing ISO-9660 filesystems on various media types including DVD-RAM, DVD+RW, BD-RE, and regular files. ```bash cdrskin --grow_overwriteable_iso ... ``` -------------------------------- ### Asserting Write LBA Source: https://github.com/libburnia/libburn/blob/master/cdrskin/wiki_plain.txt Ensures that the start block address used during filesystem preparation matches the address used by the burn process. Aborts if they do not match. ```bash assert_write_lba=0 ``` -------------------------------- ### Accelerate BD-RE Writing Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html Enable stream recording for BD-RE media to achieve full nominal speed after an initial buffer of 250 MB. This optimizes writing performance. ```bash $ cdrskin ... stream_recording=250m ... ``` -------------------------------- ### Grant Read/Write Permissions (Simple) Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html This command grants read and write permissions to all users for the specified devices. This is the simplest but least secure method. ```bash chmod a+rw /dev/sr0 /dev/hdc ``` -------------------------------- ### Compile open-cd-excl utility Source: https://github.com/libburnia/libburn/blob/master/doc/ddlp.txt Compile the open-cd-excl utility, which is used to explore open() and fcntl() locking mechanisms on device files. ```bash cc -g -Wall -o open-cd-excl open-cd-excl.c ``` -------------------------------- ### Successful ddlpa occupation log Source: https://github.com/libburnia/libburn/blob/master/doc/ddlp.txt Example output demonstrating a successful exclusive lock acquisition by ddlpa. It shows the process of finding and occupying all device representations. ```text DDLPA_DEBUG: ddlpa_std_by_rdev("/dev/scd0") = "/dev/sr0" DDLPA_DEBUG: ddlpa_collect_siblings() found "/dev/sr0" DDLPA_DEBUG: ddlpa_collect_siblings() found "/dev/scd0" DDLPA_DEBUG: ddlpa_collect_siblings() found "/dev/sg0" DDLPA_DEBUG: ddlpa_occupy() : '/dev/scd0' DDLPA_DEBUG: ddlpa_occupy() O_EXCL : '/dev/sg0' DDLPA_DEBUG: ddlpa_occupy() O_EXCL : '/dev/sr0' ---------------------------------------------- Lock gained ddlpa: opened /dev/sr0 ddlpa: opened siblings: /dev/scd0 /dev/sg0 slept 1 seconds of 300 ``` -------------------------------- ### Get CD-TEXT Pack for Track Source: https://github.com/libburnia/libburn/blob/master/doc/cdtext.txt Retrieves a specific CD-TEXT pack from a track. This function allows reading back previously set track text data. ```c int burn_track_get_cdtext(struct burn_track *t, int block, int pack_type, char *pack_type_name, unsigned char **payload, int *length, int flag); ``` -------------------------------- ### Cautious Open and fcntl Lock Source: https://github.com/libburnia/libburn/blob/master/doc/ddlp.txt This approach uses a cautious open() with O_NDELAY and acquires a POSIX lock via fcntl(F_SETLK). It's necessary when O_EXCL is too restrictive. Locks are automatically released when any file descriptor referring to the locked file is closed. ```c std_path = one of the standard device files: /dev/sr[0..255] /dev/scd[0..255] /dev/sg[0..255] /dev/hd[a..z] or a symbolic link pointing to one of them. open( std_path , ... | O_NDELAY) fcntl(F_SETLK) and close() on failure ... eventually disable O_NDELAY by fcntl(F_SETFL) ... ``` -------------------------------- ### Get CD-TEXT Pack for Session Source: https://github.com/libburnia/libburn/blob/master/doc/cdtext.txt Retrieves a specific CD-TEXT pack from a session. This function allows reading back previously set session text data. ```c int burn_session_get_cdtext(struct burn_session *s, int block, int pack_type, char *pack_type_name, unsigned char **payload, int *length, int flag); ``` -------------------------------- ### Grant Read/Write Permissions (Group) Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html This method involves adding users to a group (e.g., 'floppy'), assigning devices to that group, and then granting group read/write access. This is more secure than granting access to all users. ```bash vi /etc/group ... floppy:x:19:thomas,scdbackup ... chgrp floppy /dev/sr0 /dev/hdc chmod g+rw /dev/sr0 /dev/hdc ``` -------------------------------- ### Get CD-TEXT Parameters for Session Source: https://github.com/libburnia/libburn/blob/master/doc/cdtext.txt Retrieves the CD-TEXT parameters (character codes, copyrights, languages) previously set for a session. This allows inspection of session text attributes. ```c int burn_session_get_cdtext_par(struct burn_session *s, int char_codes[8], int copyrights[8], int block_languages[8], int flag); ``` -------------------------------- ### Blank or Format Media Source: https://github.com/libburnia/libburn/blob/master/cdrskin/cdrskin_eng.html Prepare CD-RW, DVD-RW, DVD-RAM, or BD-RE media for use. Supports blanking as needed or full formatting. ```bash $ cdrskin -v dev=/dev/sg1 blank=as_needed -eject ``` ```bash $ cdrskin -v dev=/dev/sr0 blank=format_overwrite ``` ```bash $ cdrskin -v dev=/dev/sr0 blank=deformat_sequential ``` -------------------------------- ### Failed ddlpa occupation attempt log Source: https://github.com/libburnia/libburn/blob/master/doc/ddlp.txt Example output showing a failed attempt to occupy a device representation after another process has already locked it. This illustrates the 'Device or resource busy' error. ```text DDLPA_DEBUG: ddlpa_std_by_rdev("/dev/NEC") = "/dev/sg0" DDLPA_DEBUG: ddlpa_collect_siblings() found "/dev/sr0" DDLPA_DEBUG: ddlpa_collect_siblings() found "/dev/scd0" DDLPA_DEBUG: ddlpa_collect_siblings() found "/dev/sg0" Cannot exclusively open '/dev/sg0' Reason given : Failed to open O_RDWR | O_NDELAY | O_EXCL : '/dev/sr0' Error condition : 16 'Device or resource busy' ```