LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-23-2005, 03:53 PM   #1
CrEsPo
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware 12
Posts: 184

Rep: Reputation: 30
Question cdrecord


Hey guys, I'm trying to learn how to use cdrecord instead of K3B, but I'm coming up with some problems.

I enter this:

$ cdrecord -dev=1,1,0 -audio -speed=4 "test 1.mp3"
cdrecord: Cannot allocate memory. WARNING: Cannot do mlockall(2).
cdrecord: WARNING: This causes a high risk for buffer underruns.
cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler
cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().
cdrecord: WARNING: This causes a high risk for buffer underruns.
scsidev: '1,1,0'
scsibus: 1 target: 1 lun: 0
cdrecord: Permission denied. Cannot open SCSI driver.
cdrecord: For possible targets try 'cdrecord -scanbus'. Make sure you are root.
cdrecord: For possible transport specifiers try 'cdrecord dev=help'.

So I figured because of the "Permission denied" I would have to use root, that solved the "Permission denied" problem though I still get the bottom error:

# cdrecord -dev=1,1,0 -audio -speed=4 "test 1.mp3"
scsidev: '1,1,0'
scsibus: 1 target: 1 lun: 0
cdrecord: Success. Cannot open SCSI driver.
cdrecord: For possible targets try 'cdrecord -scanbus'.
cdrecord: For possible transport specifiers try 'cdrecord dev=help'.

It says to use "cdrecord -scanbus" to find usable drives, but I already did that to get the drive in the first place.

I tried it on my DVD burner 1,0,0 and my CD burner 1,1,0. Both give me the above errors.

Any idea on what I'm doing wrong?
 
Old 04-23-2005, 04:15 PM   #2
Vookimedlo
Member
 
Registered: Jul 2004
Location: Czech Republic - Roudnice nad Labem
Distribution: Debian
Posts: 253

Rep: Reputation: 34
I'm not sure now, but I think that in kernel 2.6 you cannot use SCSI addressing for ATAPI drives.

So try

cdrecord -dev=/dev/hdb .....


where hd(b) is your CD-R drive.

Last edited by Vookimedlo; 04-23-2005 at 04:19 PM.
 
Old 04-23-2005, 04:23 PM   #3
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Perhaps this quote from the cdrecod manual pag might be applicable:
Quote:
To access SCSI devices via alternate transport layers, you need to
prepend the SCSI device name by a transport layer indicator. The
transport layer indicator may be something like USCSI: or ATAPI:. To
get a list of supported transport layers for your platform, use dev=
HELP:
In any case, you probably need the SCSI file, but I'm supprised that you don't have them "automatically."
 
Old 04-23-2005, 04:24 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Quote:
Distribution: FC3
The cdrecord dev part looks like this now....
dev=ATA:1,1,0 but there is another problem. For -audio , you need to convert it to wav or cdr first and I hope you aren't going to just put one song on the cdrom like your example shows.

Here is an example using lame to convert the mp3 files to wav
for i in *.mp3; do lame --decode "$i" `basename $i .mp3`.wav; done
then you would record the wav files like this ....
cdrecord -v dev=ATA:1,1,0 -audio -pad *.wav

or you could make it quick and use this script which does the converting and recording in one step. You will need mpg123 installed for this one.
Code:
#!/bin/bash
#decode directly to cdrom
cd /home/images
for i in *.mp3
do
mpg123 --cdr - "$i" | cdrecord -audio -pad -nofix -
done
cdrecord -fix -eject
 
Old 04-23-2005, 05:10 PM   #5
CrEsPo
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware 12
Posts: 184

Original Poster
Rep: Reputation: 30
Thanks for all the replies .

Alright since you have to do a little conversions for audio I'm scrapping that and just doing the data for now. I don't want to convert not knowing that I'm doing it right. That would mean if the CD doesn't work it could be bad cdrecord command or bad convert.

Alright so this is what I tried:

cdrecord -tao -dev=ATA:1,1,0 -speed=4 -data *.mp3

So everything went fine, it burnt. Problem is it wont mount; it tells me it can't find out the filesystem. I tried looking in the "cdrecord -help" page, but didn't find anything on filesystem. Any idea's on where I went wrong?
 
Old 04-23-2005, 05:38 PM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
For making a data cdrom, you need to make an iso image first. For example...
Code:
cd /home/images
mkisofs -R -J -o /home/myfiles.iso .

Then you record the iso image with cdrecord...
cdrecord -v dev=ATA:1,1,0 myfiles.iso
 
Old 04-23-2005, 06:19 PM   #7
megadeth
Member
 
Registered: Feb 2005
Distribution: Fedora Core 4 x64
Posts: 136

Rep: Reputation: 15
Why don't you want to use K3b?

For your own use, in kernel 2.6.x, you can not use ide-scsi adapter for your cdrom. Go to your kernel source code directory. Run make xconfig. Enable ide cdrom support and compile ide-scsi as a module. Then recompile and install your kernel and that is it.
 
Old 04-23-2005, 09:50 PM   #8
Lleb_KCir
Senior Member
 
Registered: Nov 2003
Location: Orlando FL
Distribution: Debian
Posts: 1,765

Rep: Reputation: 45
Quote:
Originally posted by homey
For making a data cdrom, you need to make an iso image first. For example...
Code:
cd /home/images
mkisofs -R -J -o /home/myfiles.iso .

Then you record the iso image with cdrecord...
cdrecord -v dev=ATA:1,1,0 myfiles.iso
you can also pipe that together on 1 line:
Code:
mkisofs -R -J -o /home/myfiels.iso | cdrecord -v dev=ATA:1,1,0 myfiles.iso
and that will on 1 line make the ISO, then burn it to CD.

god i love the raw power of linux.
 
Old 04-23-2005, 10:00 PM   #9
CrEsPo
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware 12
Posts: 184

Original Poster
Rep: Reputation: 30
homey: Thanks for that information. So much work needed before using cdrecord :P

I got my first successful CD burnt using cdrecord . I used mkisofs for the ISO and burnt it using cdrecord. Everything went smooth . Next mission is for the audio CD :P.

megadeth: In case of an emergency. If something goes wrong I can easily backup what I need instead of having to spend time to learn it in a stressful situation. Also learning to do things in the CLI helps you be able to go to any system and be able to operate it.

Lleb_KCir: Just saw your post after I posted. Thanks for that information, I forgot about piping commands together. I rarely use it . I'll keep that in mind as it is a time saver . No more need to make the ISO and wait for it to complete and then burn it .

Quote:
Originally posted by homey
for i in *.mp3; do lame --decode "$i" `basename $i .mp3`.wav; done
When I do this it tells me "basename: too many arguments". It goes through all the .mp3's telling me this, but looks like it converts. I then check and it has done nothing.

I can convert fine one at a time, though that can get tedious. Any idea's?

Last edited by CrEsPo; 04-23-2005 at 10:22 PM.
 
Old 04-23-2005, 10:56 PM   #10
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
Quote:
When I do this it tells me "basename: too many arguments". It goes through all the .mp3's telling me this, but looks like it converts. I then check and it has done nothing.
I just tried it on a small batch of mp3 files which have spaces and what-not in the name. That gave the same problem you ran into.
Then I replaced the spaces with a dash ( - ) and the operation completed without errors.
I can't remember off hand how to do it without getting rid of the spaces.

Hopefully, you are experimenting on a made-for-practice directory!

If you want to rename the files ( in the practice dir ) try this script.

For example: ./test /home/images
Code:
#!/bin/bash

usage()
{
        echo "Usage: $0 [directory]"
        exit 1;
}

test -d "$1" || usage

dir="$1"
mkdir $dir/tmp

ls $dir | grep -e "[:alnum:]" | \
while read i; do
j=`echo -e $i | sed -e 's/ /_/g'`
## j=`echo -n "$i" | tr "[:blank:]" "_"`
mv -v "$dir/$i" "$dir/tmp/$j"
done
find $dir/tmp -type f -name '*' -exec mv -v {} $dir \;
rm -rf $dir/tmp
 
Old 04-23-2005, 11:00 PM   #11
frenchie
LQ Newbie
 
Registered: Mar 2004
Location: Perth, Western Australia, Australia
Distribution: Slackware, OS X
Posts: 4

Rep: Reputation: 0
Quote:
Originally posted by CrEsPo
When I do this it tells me "basename: too many arguments". It goes through all the .mp3's telling me this, but looks like it converts. I then check and it has done nothing.
if your filenames have spaces in them, 'for' won't actually escape them when passing them on to basename. This results in basename seeing each word in the filename as a seperate argument.

To work around this try the following:

Code:
for i in *.mp3; do lame --decode "$i" `basename "$i" .mp3`.wav; done
Hopefully that helps

-Frenchie
 
Old 04-24-2005, 12:04 AM   #12
CrEsPo
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware 12
Posts: 184

Original Poster
Rep: Reputation: 30
homey: That's a hell of a script :P. Will try that tomorrow, to lazy right now, just about to head on to bed :P.

frenchie: Didn't work . Now the error is telling me excess argument and gives me the title .
 
Old 04-24-2005, 01:05 AM   #13
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 61
I found an example on the web which handles the files even with spaces in the name.
Code:
#!/bin/bash

cd /home/images

ls *.mp3 | xargs -n1 -i basename \{\} .mp3 | \
xargs -n1 -i lame --decode {}.mp3 {}.wav
 
Old 04-24-2005, 01:17 AM   #14
frenchie
LQ Newbie
 
Registered: Mar 2004
Location: Perth, Western Australia, Australia
Distribution: Slackware, OS X
Posts: 4

Rep: Reputation: 0
Quote:
Originally posted by CrEsPo
frenchie: Didn't work . Now the error is telling me excess argument and gives me the title .
Encase the `basename ....` part in quotations too... should look like this:

Code:
for i in *.mp3; do lame --decode "$i" "`basename "$i" .mp3`".wav; done
This one I'm sure works (I tested it)
 
Old 04-24-2005, 11:46 AM   #15
CrEsPo
Member
 
Registered: Apr 2005
Location: Canada
Distribution: Slackware 12
Posts: 184

Original Poster
Rep: Reputation: 30
frenchie: Thank-you. That works perfectly .

Thanks for all the help everyone. I just burnt a succesful audio CD .

Oh and I learnt how to do erase CDRW using the -blank=all option .
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cdrecord??? Lleb_KCir Linux - Software 17 04-14-2005 12:02 AM
cdrecord jaakkop Linux - Software 3 11-20-2004 02:17 PM
cdrecord chaitu_iiit Linux - Software 2 11-10-2004 02:20 PM
cdrecord quentusrex Debian 6 08-20-2004 04:01 AM
cdrecord Kent Emia Linux - Newbie 2 03-05-2004 11:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration