Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When playing audio CDs with mplayer, I always get a choppy playback. Playing audio from files, like MP3 (from any optical media, or other drives), etc. works fine. Watching video DVDs is also ok. Listening to uncompressed media that's on my hard drives, like WAV or CDR, works fine as well.

But when playing audio CDs like so:

mplayer cdda://

It spins the CD, plays for a few seconds until the buffer runs out, then it spins the CD again, fills the buffer and the whole procedure repeats. I tried -nocache, that didn't help.

How do I make mplayer keep a constant buffer fill, i.e. read the CD continuously?

share|improve this question
    
Which library to you use to read the CD, libcdparanoia or libcdio? –  ByteNudger Feb 20 '12 at 19:41
    
@ByteNudger erm, I don't know, I didn't set anything specific, just ran it like I described in my 1st post. –  polemon Feb 22 '12 at 0:09
    
I wanted to know against which of these libraries your mplayer is compiled. If you didn't compiled mplayer from source, you can get this information from the dependencies of the package. –  ByteNudger Feb 22 '12 at 10:29
    
@ByteNudger libcdda_paranoia.so.0 => /usr/lib64/libcdda_paranoia.so.0 (0x0000003420200000) I used ldd, should be alright. –  polemon Feb 26 '12 at 8:52

1 Answer 1

up vote 2 down vote accepted

The problem is the usage of mplayer cdda:// and the libcdparanoia library, because libcdparanoia has it's own caching method. This method bundles about 15 second in one request to read from the CD and that period is long enough that the CD spins down.

There are two options how you can solve this problem:

  1. mplayer which uses the library libcdio
  2. use the option -cache from mplayer with a value that's bigger then the file size you want to read

I know the second option is a bit of workaround, but when you use a package from some distribution, it's not that easy to change the library.

Also found some bug reports with the same problem from Debian and archlinux.

share|improve this answer
    
Well, filesize... I want to listen to audio CDs, not files on the CD. I'd have to cache the whole CD in this case. –  polemon Feb 26 '12 at 18:55
    
Since I don't feel like compiling mplayer myself, what program would you suggest to use for CDDA playback? –  polemon Feb 27 '12 at 4:53
    
I personally use VLC and it has also a cli command cvlc cdda://, but this is just me ;). There are many other players with GUI or without, just pick one ... –  ByteNudger Feb 27 '12 at 21:46
    
I talked to an mplayer developer. He confirmed mplayer only uses libcdparanoia, there is no support for libcdio. He said, that feature is poorly tested, since hardly anyone uses it. –  polemon Feb 28 '12 at 23:30
    
mplayer2 (mplayer2.org) seemed like the best option. I just compiled it, and it plays CD-DA flawlessly! –  polemon Mar 14 '12 at 0:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.