LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-14-2007, 07:12 AM   #1
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Rep: Reputation: 32
Post Autoplay of audio CDs in text mode


I wasn't quite sure where to put this, hopefully this forum is suitable.

At home I have a Mac mini running as a server which hosts all my music (in digital form). From time to time it's useful to be able to play an actual CD though, and my CD player recently packed in. Since the Mini is next to my stereo, I thought I might be able to use that to play CDs rather than having to find another CD player. There are a couple of complications though.

The server is set up headless, i.e. no mouse, keyboard or monitor, and it's not got X installed either. I access it via ssh for maintenance, but I don't want to have to do anything interactive to play CDs. I'm not bothered about being able to skip tracks or anything, just put in the CD and have it play. Since Mac minis don't have an eject button, I also want the CD to eject when it's finished playing.

Here's an outline of what I want to happen:
CD is put into the server
Server checks if it's an audio CD (either true red book or mixed mode)
If it's not an audio CD, nothing further happens
If it is an audio CD, the CD begins playing from start to finish
When the CD has finished playing, it is ejected

Does anyone have any suggestions on how I might go about setting this up? The parts I'm particularly unsure about are how to make something happen automatically when the CD is put in, how to check what kind of CD it is, and how to play it from start to finish without interaction. I know there are various command line CD playing programs which can probably play it okay, and of course the 'eject' command will eject the CD, but putting all the steps together seems tricky.

I have a few years of experience with Linux, as well as some basic scripting knowledge, so I'm not bothered by technical instructions, and I'm not asking for a full howto or anything, just a few pointers and suggestions of programs that might be useful.

Thanks for any assistance you can offer!
 
Old 09-15-2007, 08:54 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Well, you can create a script using the command-line tool cdcd.

Quote:
cdcd> ?
Commands: !, ?, access, close, debug, device, edit, eject, exit, ext, ff,
getvol, help, info, list, next, open, pause, play, prev, quit, refresh, resume,
rew, rndplay, setvol, sites, slot, status, stop, toggle, tracks, and verbose.
For more specific help, type `help <command>'.

cdcd> help play
Usage: play [starttrackname/track #] [endtrackname/track #] [min:sec]
By default, starts at the beginning of the CD. You may specify tracks using
either the number of the track or a section of the track's name. The disc will
play from where it starts to the end of the disc or a track you specify. You
may also specify a position within the first track to start.

cdcd> help info
Usage: info
Display statistics regarding the CD, such as name, artist, number of tracks,
etc. When you invoke this command for the first time on a particular CD, it
will block as it attempts to retrieve CD information from the CDDB.
It looks like it has all the functionality you need.
 
Old 09-16-2007, 03:45 PM   #3
Gethyn
Member
 
Registered: Aug 2003
Location: UK
Distribution: (X)Ubuntu 10.04/10.10, Debian 5, CentOS 5
Posts: 900

Original Poster
Rep: Reputation: 32
Thanks for that, I'd found cdcd but was having trouble getting it working. On Ubuntu it gives a cddb query error, which I thought was a bug but was actually because the default cddb mirror is defunct. Refreshing the cddb list fixed this problem, and CDs seem to play alright.

Turns out there is another problem though, apparently Mac Minis don't have a CD audio cable, which means the only way to play CDs is via the IDE interface. I haven't been able to find a command line CD player that does this, the only possibilities seem to be xine and xmms, so I think I might have to give up on the idea. Thanks for your help anyway.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't play CDs with gxine, error: Autoplay for input plugin 'CD' failed Nylex Linux - Software 1 12-29-2005 07:11 AM
audio cds in text-interface mrchaos Slackware 4 03-31-2005 01:42 PM
Burning MP3 CDs (not audio CDs) mlamarche Linux - Newbie 6 11-29-2004 04:09 AM
autoplay audio cds and dvds Norin311 Linux - Software 4 09-08-2004 01:11 PM
Command to autoplay audio cd cgoerner Linux - Software 1 08-19-2004 03:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:40 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