Discussion:
Playing audio CDs
Akenner
2009-02-07 18:28:46 UTC
Permalink
I've been searching on the net for like an hour trying to see how to
play a CD on FreeBSD, and normally I'd have just tried mounting it,
being from the Linux world, but when I first checked to be sure of the
proper way, I found mostly info saying not to mount it at all.

So now I'm not sure what is the right way to do it. On two machines each
having between 1 - 3 drives to play CDs from, I've tried just loading a
CD player app and hitting play, but it doesn't find the CD, and on one
machine there is only one drive so it can't be the wrong one.

None of the pages I found said it was OK to mount it, and so I'm a
little confused how you play CDs, and I've used cdplay as root to make
sure I had access since the one app said I couldn't access the CD drive,
and nothing has happened.

How is the normal way of playing a regular audio CD in FreeBSD?

Thanks
Akenner
2009-02-07 18:35:56 UTC
Permalink
I found in the handbook that I could try this:

/sbin/mount /cdrom

I then saw this:

/dev/cd0: device not configured.

Apparently typing /sbin first made it give me a different error message,
I'm just trying to find hwo to configure a drive now. would
/stand/sysinstall work for this?
Polytropon
2009-02-07 22:25:38 UTC
Permalink
Post by Akenner
/sbin/mount /cdrom
/dev/cd0: device not configured.
This refers to the fact that the device does not contain an ISO-9660
formatted media.
Post by Akenner
Apparently typing /sbin first made it give me a different error message,
I'm just trying to find hwo to configure a drive now. would
/stand/sysinstall work for this?
No.

The "device is configured" via the /etc/fstab file that controls how to
mount the disc, e. g.

# Device Mountpoint FStype Options Dump Pass#
# ----------- --------------------- ------ ------------- ----- -----
/dev/acd0 /cdrom cd9660 ro,noauto 0 0

This will "expand" your command

% mount /cdrom

to something like

% mount -t cd9660 -o ro /dev/acd0 /cdrom

Also, keep in mind the permissions: You need +r for the device, and you
have to be the owner of the mount target directory. Furthermore, users
must be allowed to mount media which is controlled by the setting

vfs.usermount=1

that is to be put into /etc/sysctl.conf.



But as I mentioned before, you cannot mount an audio CD; imagine that
it's "technically" impossible. :-)

(Of course, this says nothing about that you cannot copy audio tracks,
convert them into OGG/Vorbis or duplicate discs 1:1, which is ALL
possible.)



A final note: I see you're using /dev/cd0 for your CD drive. What about
using acd0 instead (if it's an ATAPI drive)? You can specify /dev/cd0
as $CDROM if you've got a SCSI device, but then, due to permissions,
I think you need to set proper access rules for the xpt device, too.
--
Polytropon
Post by Akenner
From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
Akenner
2009-02-08 16:43:12 UTC
Permalink
*snipped for polite cleanliness*

Thanks to everyone who took the time to help me out here. I think
instead of playing CDs I'll just rip them, it seems a WHOLE lot easier,
and of course, not having to worry about scratches is a plus ;)

I think one MAJOR problem I had yesterday when I was doing all this, was
that I had been awake for about 27 hours...Which is more than most
Windows boxes. I was trying to remember how to configure hardware
because I'm basically spoiled by easy to configure OSs like BSD and
Linux, that I literally couldn't remember how to configure stuff.

I think you guys can agree to that. Back in like 2000 even, which wasn't
THAT long ago, I know for a fact Windows and Linux were both very
different, and this was....FreeBSD 4.0? 2000 is a little spacial, it's
when I bought my very first FreeBSD PowerPak with FreeBSD 4.0 on CD, the
6 CD set of tools and things, and came with The Complete FreeBSD 3rd
edition. Which I still read. Lehey is a great book writer.

I think one problem also, is the sheer number of albums I have. I ahve a
LOT of CDs, and almost all of them currently have been ripped, and I
keep two HDs in my Slackware FTP server (Which may be reinstalled with
FreeBSD, which is one reason I was testing how I'd do certain things in
BSD) and I have over 30 GBs of music in there. Some albums that are
important to me, like my Misfits boxed set, Ramones Discography, and
rare Acid Bath Demo stuff, and my complete set of Danzig work (All
Misfits, Samhain boxed set, + all Danzig CDs) I have all ripped as both
oggVorbis, 128 K MP3s, and 320 K MP3s (I use 128 for my I-Pod because I
have a 1 GB model, can't afford the big ones) and 320 I use for my play
lists on the computer so I get good sound, and oggorbis was because a
while back Linux distros like SUSE couldn't give you MP3 from out of the
box, because of the license thing, so I kept ogg for that. It's
something that took a LONG time to do and I'll probably just continue on
with ripping the rest of my CD collection and putting it all on my FTP
server so that each machine I have can play music without all of them
losing disk space.

Thanks again everyone!
Lowell Gilbert
2009-02-07 20:31:11 UTC
Permalink
Post by Akenner
I've been searching on the net for like an hour trying to see how to
play a CD on FreeBSD, and normally I'd have just tried mounting it,
being from the Linux world, but when I first checked to be sure of the
proper way, I found mostly info saying not to mount it at all.
So now I'm not sure what is the right way to do it. On two machines
each having between 1 - 3 drives to play CDs from, I've tried just
loading a CD player app and hitting play, but it doesn't find the CD,
and on one machine there is only one drive so it can't be the wrong
one.
None of the pages I found said it was OK to mount it, and so I'm a
little confused how you play CDs, and I've used cdplay as root to make
sure I had access since the one app said I couldn't access the CD
drive, and nothing has happened.
How is the normal way of playing a regular audio CD in FreeBSD?
See the entry in the FreeBSD FAQ titled "Why can I not mount an audio CD?"
http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/disks.html#MOUNT-AUDIO-CD
--
Lowell Gilbert, embedded/networking software engineer, Boston area
http://be-well.ilk.org/~lowell/
Polytropon
2009-02-07 22:19:34 UTC
Permalink
Post by Akenner
I've been searching on the net for like an hour trying to see how to
play a CD on FreeBSD, and normally I'd have just tried mounting it,
^^^^^^^^ ???
Post by Akenner
being from the Linux world, but when I first checked to be sure of the
proper way, I found mostly info saying not to mount it at all.
What should it be good for mounting an audio CD? It doesn't have
an ISO-9660 file system on it.

In order to play an audio CD, you can utilize the cdcontrol command
included in the base system:

% cdcontrol play

Refer to "man cdcontrol" for further options and eventually how to
specify the CD device (if needed).
Post by Akenner
So now I'm not sure what is the right way to do it. On two machines each
having between 1 - 3 drives to play CDs from, I've tried just loading a
CD player app and hitting play, but it doesn't find the CD, and on one
machine there is only one drive so it can't be the wrong one.
What does

% cdcontrol info

say about the media you're trying to play?
Post by Akenner
None of the pages I found said it was OK to mount it, and so I'm a
little confused how you play CDs, and I've used cdplay as root to make
sure I had access since the one app said I couldn't access the CD drive,
and nothing has happened.
Permissions of the device file?

% ll /dev/acd0
crw-rw-r-- 1 root operator 0, 105 Feb 7 22:32 /dev/acd0
^ ^ ^
These are important!
Post by Akenner
How is the normal way of playing a regular audio CD in FreeBSD?
As I mentioned, cdcontrol is a very easy way to do this. Of course, there
are GUI tools that can be handy, e. g. xcd or whatever comes with KDE or
Gnome (if you use this).

Keep in mind that, according to FreeBSD's permission concept, you need
the +r permission on the device file (see /etc/devfs.conf, /etc/devfs.rules).
If you have more than one drive, you can set variables like CDROM to get
rid of things like -f /dev/acd[012].
--
Polytropon
Post by Akenner
From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
Joshua Isom
2009-02-10 08:39:17 UTC
Permalink
On Sat, 07 Feb 2009 13:28:46 -0500, Akenner
In order to play an audio CD, you can utilize the cdcontrol command
% cdcontrol play
Refer to "man cdcontrol" for further options and eventually how to
specify the CD device (if needed).
One thing that I don't think I've read but personally encountered.
When using cdcontrol, it seems to tell the cd-rom drive to play the
disc so it's not really done in software. If the audio cable from the
cd-rom drive is not connected to the motherboard you won't get sound.
For the vast majority of users this is a non-issue, but it be confusing
to figure out.
Polytropon
2009-02-10 23:30:19 UTC
Permalink
Post by Joshua Isom
One thing that I don't think I've read but personally encountered.
When using cdcontrol, it seems to tell the cd-rom drive to play the
disc so it's not really done in software. If the audio cable from the
cd-rom drive is not connected to the motherboard you won't get sound.
For the vast majority of users this is a non-issue, but it be confusing
to figure out.
Well, interesting you mentioned this. I have this audio cable installed
and after cdcontrol "told" the drive to play the audio CD, it is on the
CD audio channel of the sound card (and the mixer channel CD, of course).
I'm not sure how this is handled via the ATA cable where the CD drive
usually is connected, or the SATA calbe, if it's a newer drive. Or, to
make it more complicated, when the drive is a SCSI cable; I don't think
SCSI transmits audio data via the SCSI cable...

At least the drive should show the typical "playing activity" which can
be checked using a headphone on the drive's front connector (if it has
one).
--
Polytropon
Post by Joshua Isom
From Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...
Continue reading on narkive:
Loading...