|
Guides All Guides and HOWTO's. |
|
Thread Tools | Display Modes |
|
|||
OpenBSD : Ripping and writing music CDs with cdio(1)
For a general overview see How do I burn CDs and DVDs?
Following the advice of http://www.openbsd.org/faq/faq13.html#burnIntro we first check how the drive is recognized by the OpenBSD kernel: Code:
dmesg | grep ^cd cd0 at scsibus0 targ 0 lun 0: <Optiarc, DVD RW AD-7200A, 1.09> ATAPI 5/cdrom removable cd0(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 4 Code:
NAME cdio - compact disc control utility SYNOPSIS cdio [-sv] [-d host: port] [-f device] [command args ...] DESCRIPTION The cdio program is a compact disc control utility, with support for playing audio CDs and TAO CD writing. Code:
cddbinfo [n] Print the Table Of Contents (TOC) after matching the disc with the CDDB. In case of multiple matches, reissue the command with n. Code:
$ sudo cdio -f cd0c cddbinfo Zappa, Frank / Uncle Meat CD1(rock) ------------------------------------------------- 1 1:55.30 Uncle Meat: Main Title Theme 2 0:26.45 The Voice of Cheese 3 6:00.25 Nine Types of Industrial Pollution 4 0:54.65 Zolar Czakl 5 3:59.45 Dog Breath, In the Year of the Plague 6 3:27.67 The Legend of The Golden Arches 7 2:19.08 Louie Louie [At the Royal Albert Hall in London] 8 1:48.42 The Dog Breath Variations 9 0:50.53 Sleeping in a Jar 10 1:05.22 Our Bizarre Relationship 11 4:46.15 The Uncle Meat Variations 12 1:46.28 Electric Aunt Jemima 13 3:38.45 Prelude to King Kong 14 1:10.72 God Bless America [Live at the Whisky a Go Go] 15 1:29.20 A Pound for a Brown on the Bus 16 5:05.40 Ian Underwood Whips It Out [Live on Stage in Copenhagen] 17 3:14.03 Mr. Green Genes 18 2:03.02 We Can Shoot You 19 1:14.00 "If We'd All Been Living in California..." 20 2:57.28 The Air 21 4:49.00 Project X 22 2:17.60 Cruising for Burgers 170 57:22.40 Code:
ls -l /dev/cd* brw-r----- 1 root operator 6, 0 Apr 5 2010 /dev/cd0a brw-r----- 1 root operator 6, 2 Apr 5 2010 /dev/cd0c brw-r----- 1 root operator 6, 16 Apr 5 2010 /dev/cd1a brw-r----- 1 root operator 6, 18 Apr 5 2010 /dev/cd1c Code:
$ groupinfo operator name operator passwd * gid 5 members root j65nko Requirement for access to the CDDB server(s) is that the firewall should allow outgoing TCP connections to port 888. Code:
$ grep cddb /etc/services cddb 888/tcp cddbp # Audio CD Database Code:
pass out quick on egress inet proto tcp from egress to any port cddb I want to combine the tracks of CD 1 and CD 2 on a single CD, excluding those three tracks. First create the directory structure: Code:
$ mkdir UncleMeat $ cd UncleMeat $ mkdir CD_1 CD_2 $ ls -l total 8 drwxr-xr-x 2 j65 j65 512 Nov 21 23:26 CD_1 drwxr-xr-x 2 j65 j65 512 Nov 21 23:26 CD_2 The cdio(1) command to rip the CD is cdrip described in the man page as: Code:
cdrip [track1-trackN ...] Rip specified tracks from disk. Audio tracks are saved as WAVE sound files. All tracks will be saved in the current working directory. If parameters are omitted, all tracks are ripped. Both individual tracks and track ranges may be specified, in the same format as the cdplay command. cdplay [track1-trackN ...] Play specified tracks from disk. Unlike play, the CD player need not be connected to an audio device; instead it rips tracks from disk and outputs audio data to the default audio(4) device or aucat(1) socket. Both individual tracks and track ranges may be specified. If range is specified in descending order tracks will be played in descending order. If the first value in the range is omitted, tracks from first track on disk to the specified one will be played. If the last value in the range is omitted, tracks from the specified track to the last track on disk will be played.[/b] Code:
$ cd CD_1 ; sudo cdio -f cd0c cdrip track 1 'a' 00008655/00008655 100% track 2 'a' 00001995/00001995 100% track 3 'a' 00027025/00027025 100% track 4 'a' 00004115/00004115 100% track 5 'a' 00017970/00017970 100% track 6 'a' 00015592/00015592 100% track 7 'a' 00010433/00010433 100% track 8 'a' 00008142/00008142 100% track 9 'a' 00003803/00003803 100% track 10 'a' 00004897/00004897 100% track 11 'a' 00021465/00021465 100% track 12 'a' 00007978/00007978 100% track 13 'a' 00016395/00016395 100% track 14 'a' 00005322/00005322 100% track 15 'a' 00006695/00006695 100% track 16 'a' 00022915/00022915 100% track 17 'a' 00014553/00014553 100% track 18 'a' 00009227/00009227 100% track 19 'a' 00005550/00005550 100% track 20 'a' 00013303/00013303 100% track 21 'a' 00021675/00021675 100% track 22 'a' 00010335/00010335 100% Code:
$ ls -l total 1186400 -rw------- 1 root j65 20356604 Nov 21 23:35 track01.wav -rw------- 1 root j65 4692284 Nov 21 23:35 track02.wav -rw------- 1 root j65 63562844 Nov 21 23:36 track03.wav -rw------- 1 root j65 9678524 Nov 21 23:36 track04.wav -rw------- 1 root j65 42265484 Nov 21 23:36 track05.wav -rw------- 1 root j65 36672428 Nov 21 23:37 track06.wav -rw------- 1 root j65 24538460 Nov 21 23:37 track07.wav -rw------- 1 root j65 19150028 Nov 21 23:37 track08.wav -rw------- 1 root j65 8944700 Nov 21 23:37 track09.wav -rw------- 1 root j65 11517788 Nov 21 23:37 track10.wav -rw------- 1 root j65 50485724 Nov 21 23:38 track11.wav -rw------- 1 root j65 18764300 Nov 21 23:38 track12.wav -rw------- 1 root j65 38561084 Nov 21 23:39 track13.wav -rw------- 1 root j65 12517388 Nov 21 23:39 track14.wav -rw------- 1 root j65 15746684 Nov 21 23:39 track15.wav -rw------- 1 root j65 53896124 Nov 21 23:40 track16.wav -rw------- 1 root j65 34228700 Nov 21 23:40 track17.wav -rw------- 1 root j65 21701948 Nov 21 23:41 track18.wav -rw------- 1 root j65 13053644 Nov 21 23:41 track19.wav -rw------- 1 root j65 31288700 Nov 21 23:41 track20.wav -rw------- 1 root j65 50979644 Nov 21 23:42 track21.wav -rw------- 1 root j65 24307964 Nov 21 23:42 track22.wav Code:
sudo cdio eject Code:
$ sudo cdio close Code:
$ cd ../CD_2 $ sudo cdio -f cd0c cddbinfo Frank Zappa h / Uncle Meat (Disc 2)(rock) ------------------------------------------------- 1 37:34.45 Uncle Meat film excerpt, part I 2 3:46.20 Tengo 'na Minchia Tanta 3 3:51.02 Uncle Meat film excerpt, part II 4 0:49.00 King Kong Itself (as played by the Mothers in a studio) 5 1:21.08 King Kong ? (its magnificence as interpreted by Dom DeWild) 6 1:44.72 King Kong ? (as Motorhead explains it) 7 6:17.45 King Kong ? (the Gardner Varieties) 8 0:34.05 King Kong ? (as played by 3 deranged Good Humor trucks) 9 7:23.55 King Kong (live on a flat bed diesel in the middle of a race track at a Miami Pop Festival...the Underwood ramifications) 170 63:24.27 Code:
$ sudo cdio info Starting track = 1, ending track = 9, TOC size = 82 bytes track start duration block length type ------------------------------------------------- 1 0:02.00 37:34.45 0 169095 audio 2 37:36.45 3:46.20 169095 16970 audio 3 41:22.65 3:51.02 186065 17327 audio 4 45:13.67 0:49.00 203392 3675 audio 5 46:02.67 1:21.08 207067 6083 audio 6 47:24.00 1:44.72 213150 7872 audio 7 49:08.72 6:17.45 221022 28320 audio 8 55:26.42 0:34.05 249342 2555 audio 9 56:00.47 7:23.55 251897 33280 audio 170 63:24.27 - 285177 - - Code:
$ sudo cdio cdrip 4- track 4 'a' 00003675/00003675 100% track 5 'a' 00006083/00006083 100% track 6 'a' 00007872/00007872 100% track 7 'a' 00028320/00028320 100% track 8 'a' 00002555/00002555 100% track 9 'a' 00033280/00033280 100% $ ls -l -rw------- 1 root j65 8643644 Nov 21 23:53 track04.wav -rw------- 1 root j65 14307260 Nov 21 23:54 track05.wav -rw------- 1 root j65 18514988 Nov 21 23:54 track06.wav -rw------- 1 root j65 66608684 Nov 21 23:55 track07.wav -rw------- 1 root j65 6009404 Nov 21 23:55 track08.wav -rw------- 1 root j65 78274604 Nov 21 23:56 track09.wav in both CD_1 and CD_2 directories. I have no idea if that could pose a problem in the track sequence if we would write them. We could of course test this with a CD-RW, but by using hard links we can easily solve this issue. Code:
$ [~/UncleMeat/CD_2] cd .. $ [~/UncleMeat] ls -l drwxr-xr-x 2 j65 j65 512 Nov 21 23:42 CD_1 drwxr-xr-x 2 j65 j65 512 Nov 21 23:55 CD_2 $ [~/UncleMeat] ln CD_1/*wav . ; ls -l drwxr-xr-x 2 j65 j65 512 Nov 21 23:42 CD_1 drwxr-xr-x 2 j65 j65 512 Nov 21 23:55 CD_2 -rw------- 2 root j65 20356604 Nov 21 23:35 track01.wav -rw------- 2 root j65 4692284 Nov 21 23:35 track02.wav -rw------- 2 root j65 63562844 Nov 21 23:36 track03.wav -rw------- 2 root j65 9678524 Nov 21 23:36 track04.wav -rw------- 2 root j65 42265484 Nov 21 23:36 track05.wav -rw------- 2 root j65 36672428 Nov 21 23:37 track06.wav -rw------- 2 root j65 24538460 Nov 21 23:37 track07.wav -rw------- 2 root j65 19150028 Nov 21 23:37 track08.wav -rw------- 2 root j65 8944700 Nov 21 23:37 track09.wav -rw------- 2 root j65 11517788 Nov 21 23:37 track10.wav -rw------- 2 root j65 50485724 Nov 21 23:38 track11.wav -rw------- 2 root j65 18764300 Nov 21 23:38 track12.wav -rw------- 2 root j65 38561084 Nov 21 23:39 track13.wav -rw------- 2 root j65 12517388 Nov 21 23:39 track14.wav -rw------- 2 root j65 15746684 Nov 21 23:39 track15.wav -rw------- 2 root j65 53896124 Nov 21 23:40 track16.wav -rw------- 2 root j65 34228700 Nov 21 23:40 track17.wav -rw------- 2 root j65 21701948 Nov 21 23:41 track18.wav -rw------- 2 root j65 13053644 Nov 21 23:41 track19.wav -rw------- 2 root j65 31288700 Nov 21 23:41 track20.wav -rw------- 2 root j65 50979644 Nov 21 23:42 track21.wav -rw------- 2 root j65 24307964 Nov 21 23:42 track22.wav Code:
$ [~/UncleMeat] ln CD_2/track04.wav track23.wav $ [~/UncleMeat] ln CD_2/track05.wav track24.wav $ [~/UncleMeat] ln CD_2/track06.wav track25.wav $ [~/UncleMeat] ln CD_2/track07.wav track26.wav $ [~/UncleMeat] ln CD_2/track08.wav track27.wav $ [~/UncleMeat] ln CD_2/track09.wav track28.wav $ [~/UncleMeat] ls -l [snip] -rw------- 2 root j65 8643644 Nov 21 23:53 track23.wav -rw------- 2 root j65 14307260 Nov 21 23:54 track24.wav -rw------- 2 root j65 18514988 Nov 21 23:54 track25.wav -rw------- 2 root j65 66608684 Nov 21 23:55 track26.wav -rw------- 2 root j65 6009404 Nov 21 23:55 track27.wav -rw------- 2 root j65 78274604 Nov 21 23:56 track28.wav The appropiate command according to the man page is: Code:
tao [-ad] [-s speed] trackfile ... [command line only] Write a track-at-once CD containing the specified trackfile. The options are as follows: -a Write files as audio tracks. File formats of audio tracks may be CDDA or WAVE with 2 channels of PCM audio, signed 16-bit (little endian) values sampled at 44100 Hz. -d Write files as data tracks (the default). -s speed Specify a write speed for tracks. speed may be a numerical value between 1 and the maximum speed supported by the media and drive, or one of the literal strings ``auto'' or ``max'', meaning the optimal or maximum speed detected. Code:
$ [~/UncleMeat]sudo cdio -f /dev/cd0c tao -a -s auto *wav track 01 'a' 00008655/00008655 100% track 02 'a' 00010802/00010802 100% track 03 'a' 00037979/00037979 100% track 04 'a' 00042246/00042246 100% track 05 'a' 00060368/00060368 100% track 06 'a' 00076112/00076112 100% track 07 'a' 00086697/00086697 100% track 08 'a' 00094991/00094991 100% track 09 'a' 00098946/00098946 100% track 10 'a' 00103995/00103995 100% track 11 'a' 00125612/00125612 100% track 12 'a' 00133742/00133742 100% track 13 'a' 00150289/00150289 100% track 14 'a' 00155763/00155763 100% track 15 'a' 00162610/00162610 100% track 16 'a' 00185677/00185677 100% track 17 'a' 00200382/00200382 100% track 18 'a' 00209761/00209761 100% track 19 'a' 00215463/00215463 100% track 20 'a' 00228918/00228918 100% track 21 'a' 00250745/00250745 100% track 22 'a' 00261232/00261232 100% track 23 'a' 00265059/00265059 100% track 24 'a' 00271294/00271294 100% track 25 'a' 00279318/00279318 100% track 26 'a' 00307790/00307790 100% track 27 'a' 00310497/00310497 100% track 28 'a' 00343929/00343929 100% Closing session. Code:
$ sudo cdio cddbinfo cddb: multiple matches 1: misc 8b11b51c Frank Zappa / Uncle Meat (CD's 1 & 2 combined) Code:
cddbinfo [n] Print the Table Of Contents (TOC) after matching the disc with the CDDB. In case of multiple matches, reissue the command with n. Code:
$ sudo cdio cddbinfo 1 Frank Zappa / Uncle Meat (CD's 1 & 2 combined)(misc) ------------------------------------------------- 1 1:57.32 Uncle Meat: Main Title Theme 2 0:28.47 The Voice Of Cheese 3 6:02.27 Nine Types Of Industrial Pollution 4 0:56.67 Zolar Czakl 5 4:01.47 Dog Breath, In The Year Of The Plague 6 3:29.69 The Legend Of The Golden Arches 7 2:21.10 Louie Louie (At the Royal Albert Hall in London) 8 1:50.44 The Dog Breath Variations 9 0:52.55 Sleeping In A Jar 10 1:07.24 Our Bizarre Relationship 11 4:48.17 The Uncle Meat Variations 12 1:48.30 Electric Aunt Jemima 13 3:40.47 Prelude To King Kong 14 1:12.74 God Bless America (Live at the Whisky A Go Go) 15 1:31.22 A Pound For A Brown On The Bus 16 5:07.42 Ian Underwood Whips It Out (Live on stage in Copenhagen) 17 3:16.05 Mr. Green Genes 18 2:05.04 We Can Shoot You 19 1:16.02 "If We'd All Been Living in California..." 20 2:59.30 The Air 21 4:51.02 Project X 22 2:19.62 Cruising For Burgers 23 0:51.02 King KongItself 24 1:23.10 King Kong II 25 1:46.74 King Kong III 26 6:19.47 King Kong IV 27 0:36.07 King Kong V 28 7:23.57 King Kong VI 170 76:27.56 Actually I was a little bit concerned whether this all could fit on a 700 MB CD. The total time is 76:26 minutes.That is below the 80 minutes playing capability of the CD-R, but the nr of MB exceeds it's 700 MB specification: Code:
du -hc *wav 19.4M track01.wav 4.5M track02.wav 60.6M track03.wav 9.3M track04.wav 40.3M track05.wav 35.0M track06.wav 23.4M track07.wav 18.3M track08.wav 8.5M track09.wav 11.0M track10.wav 48.2M track11.wav 17.9M track12.wav 36.8M track13.wav 12.0M track14.wav 15.0M track15.wav 51.4M track16.wav 32.7M track17.wav 20.7M track18.wav 12.5M track19.wav 29.9M track20.wav 48.6M track21.wav 23.2M track22.wav 8.3M track23.wav 13.7M track24.wav 17.7M track25.wav 63.5M track26.wav 5.8M track27.wav 74.7M track28.wav 763M total APPENDIX An interesting command to find out the capabilities of your CD/DVD drive is using the info command combined with a double verbose flag. Code:
$ sudo cdio -vv info No CD device name specified. Defaulting to cd0. Features: 0x0000 Profile List (56 bytes of data) 00 00 03 38|00 2b 00 00 00 1b 00 00 00 1a 00 00 00 16 00 00 00 15 00 00 00 14 00 00 00 13 00 00 00 12 00 00 00 11 00 00 00 10 00 00 00 0a 00 00 00 09 00 00 00 08 01 00 00 02 00 00 Profiles: 0x002b DVD+Recordable Dual Layer 0x001b DVD+Recordable 0x001a DVD+ReWritable 0x0016 Dual Layer DVD-R using Layer Jump recording 0x0015 Dual Layer DVD-R using Sequential recording 0x0014 Re-recordable DVD using Sequential recording 0x0013 Re-recordable DVD using Restricted Overwrite 0x0012 Re-writable DVD 0x0011 Write once DVD using Sequential recording 0x0010 Read only DVD 0x000a Re-writable Compact Disc 0x0009 Write once Compact Disc * 0x0008 Read only Compact Disc [Current Profile] 0x0002 Re-writable, with removable media 0x0001 Core (8 bytes of data) 00 01 0b 08|00 00 00 02 01 00 00 00 0x0002 Morphing (4 bytes of data) 00 02 07 04|02 00 00 00 0x0003 Removable Medium (4 bytes of data) 00 03 07 04|39 00 00 00 0x0010 Random Readable (8 bytes of data) 00 10 01 08|00 00 08 00 00 01 01 00 0x001d Multi-Read 00 1d 01 00 0x001e CD Read (4 bytes of data) 00 1e 09 04|83 00 00 00 0x0100 Power Management 01 00 03 00 0x0105 Timeout (4 bytes of data) 01 05 07 04|00 00 00 00 0x0107 Real Time Streaming (4 bytes of data) 01 07 11 04|1f 00 00 00 0x0108 Drive Serial Number (12 bytes of data) 01 08 03 0c|4c 6b 35 39 34 41 36 68 41 63 76 33 Starting track = 1, ending track = 9, TOC size = 82 bytes track start duration block length type ------------------------------------------------- 1 0:02.00 37:34.45 0 169095 audio 2 37:36.45 3:46.20 169095 16970 audio 3 41:22.65 3:51.02 186065 17327 audio 4 45:13.67 0:49.00 203392 3675 audio 5 46:02.67 1:21.08 207067 6083 audio 6 47:24.00 1:44.72 213150 7872 audio 7 49:08.72 6:17.45 221022 28320 audio 8 55:26.42 0:34.05 249342 2555 audio 9 56:00.47 7:23.55 251897 33280 audio 170 63:24.27 - 285177 - -
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
||||
Even though I have used cdio from the base in the past to rip and burn music CDs in exactly the fashion that you described I just find much easier these days to do ripping with ABCDE http://lly.org/~rcw/abcde/page/. It boils down to about the same except that you are using somebody's debugged script (Ok not quite since ABCDE uses cdparanoia for ripping instead of cdio rip). By the way cdrtools port (cdparanoia is the part of the suit) has just been updated to the latest release 3.0 so everyone who runs OpenBSD current should help testing.
|
|
||||
There are some serious problems associated with ripping CD's. The biggest problem is that most CD/DVD drives are not able to accurately report whether an error occurred, and due to strange caching algorithms may produce very strange results.
The CD/DVD drive you use makes a huge difference. Plextor drivers have long since been recognized as being the best in quality. The "gold standard" for accurate CD ripping is Exact Audio Copy, while excellent software, it is Windows-only and closed source. I'm not aware of an alternative that runs on BSD. One solution might be to rip them twice and compare hashes...
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
|
|||
I only know that Yamaha supposedly uses a technology that produces better quality CD-R's.
From http://en.wikipedia.org/wiki/Optical...lity_Recording Quote:
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
||||
Those things sound like nonsense, from: http://www.activewin.com/reviews/har...features.shtml
Quote:
Quote:
Quote:
I think this is one that should be added to: http://web.archive.org/web/200702091...audiophile.htm
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. |
Tags |
cdio(1), link (hard), music cd |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A faster Web server: ripping out Apache for Nginx | J65nko | News | 3 | 14th November 2011 03:56 AM |
New to OpenBSD: problem with music, raid? | barum87 | OpenBSD General | 3 | 24th June 2010 04:04 AM |
FreeBSD howto: burning and ripping cd's | graudeejs | Guides | 9 | 31st December 2008 06:39 AM |
Newbies questions about FreeBSD + Music & e17 ! | nico_h | FreeBSD General | 31 | 17th December 2008 09:33 PM |
I'm looking for a music text based music player that can play .m4p and .m4a formats | cssgalactic | FreeBSD Ports and Packages | 4 | 14th July 2008 04:16 AM |