I have an image file (.iso) made from an audio CD. How can I listen to the music?
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
An audio CD doesn't have a real filesystem. So you can't mount it. I would expect that an audio cd image would have an .img extension. Look at the file with "file <filename>". If it says that is is an iso9660 image, then maybe your ripping software converted the cd to an iso9660 image made up of cda or wav files. If that is the case, you can mount the file:
sudo mount -t iso9660 <filename> <mountpoint> -o ro,loop
I use the command "file" to look at the image. It said that it is "data"
I cannot mount it. There is no filesystem in the image... What should I do? By the way, I cannot believe that there is no way listen to the music in an CD image. Even MS Windows has software to do this! How come there is no way for Linux?
By the way, the image extension ".iso" is added by me. So it does not mean that the image contain a ISO9660 file system...
mount it (might not work these days, but used to iirc)
cdda2wav -device file.iso
xmms file.iso
In theory most media apps should be able to treat the file like a device. And read it accordingly. You might have to enable digital extraction since there's no audio cable connecting the file to the soundcard. Although a lot of modern computers don't have that cable anymore anyway.
CD audio is 2 channels of 16 bit 44.1kHz audio. The format on the cd is big endian. The playable wav version is little endian. AFAIK, the file format is the same, except for the byte order.
mount it (might not work these days, but used to iirc)
No, it didn't use to, at least with a stock kernel (unless that feature existed in 2.2 or early 2.4 and it was removed at a later stage, which I highly doubt). As said, audio cds lack a file system, and the only fs's that I know of that are supported for a cdrom in a stock kernel are iso9660 and udf, none of which is related to audio cds. The cdda format as described in the handbook doesn't have any fs-like structure behind it. There are external projects that might help you though. Try cdfs.
You might be able to use cdfs to mount your iso in loopback mode. It's long since the last time I tested cdfs and I don't know if it's still maintained and if it will work against the newer kernels. But it's worth a try.
There was also an audiofs project, but I can't seem to find it anymore. I think it just died.
Some players might as well be able to play it without problems. Mplayer might play it. However I don't think you can change tracks and things like that unless there's some specific support that allows treating the file as a device as you said.
No, it didn't use to, at least with a stock kernel (unless that feature existed in 2.2 or early 2.4 and it was removed at a later stage, which I highly doubt).
It was a 2.4.x kernel. Custom compile, but shouldn't be that different from most stock kernels. Back in the 2.4.14-ish days. It used to mount, I swear it did, and used to show some sort of track01.cda type files. This was long before DRM measures and other man made limits. And is no longer an option afaik. It's all bits and bytes, so there has to be some sort of implied filesystem. Otherwise CD-Text and stuff would be handled very oddly. It's all bits and bytes to some degree. But that doesn't mean that it's an iso9660 filesystem.
It was a 2.4.x kernel. Custom compile, but shouldn't be that different from most stock kernels. Back in the 2.4.14-ish days. It used to mount, I swear it did, and used to show some sort of track01.cda type files. This was long before DRM measures and other man made limits. And is no longer an option afaik.
Well, that's possible. By the time of 2.4 I rarely built a kernel since I was not that knowledgeable about linux by that time, and compiling a kernel was nothing that could be done in a breeze in a classic 133mhz pentium cpu. It could take a lot of hours to do so. It's perfectly possible that I bypassed that option, though it seems odd to me that such capability existed on a stock kernel and was then removed (admittedly, it's not impossible).
It's also possible that it was your distro adding the audiofs patch or something like that... Some distros add patches to the vanilla kernel so we can't discard that. I am more inclined to think that this was the case, because, in first place, if there were builtin support in the kernel to do this, then why would anyone design a 3rd party patch to do the same?
In any case, the cdfs seems as the way to go right now.
Quote:
It's all bits and bytes, so there has to be some sort of implied filesystem. Otherwise CD-Text and stuff would be handled very oddly. It's all bits and bytes to some degree. But that doesn't mean that it's an iso9660 filesystem.
Well, the affirmation that an audio cd doesn't have a fs has more to do with the fact that the red book (which defines this standard) has nothing on it specifying such a thing like a file system. However, as you say, it's all bits and bytes. If you have a driver to handle it on an fs-like fashion, then, to all effects you can consider that you have a file system. cds certainly can be accessed on a random fashion, and you know where a track begins and end, so, it's perfectly possible to manage this like if they were files. It's just a matter of interfacing it correctly using a driver, which is what the cdfs does.
As you see, the line about what has a fs and what hasn't is very thin. Conceptually, you can do an fs-like handler for almost anything, from databases to remote shares or even the whole web if we wanted.
I use the command "file" to look at the image. It said that it is "data"
I cannot mount it. There is no filesystem in the image... What should I do? By the way, I cannot believe that there is no way listen to the music in an CD image. Even MS Windows has software to do this! How come there is no way for Linux?
By the way, the image extension ".iso" is added by me. So it does not mean that the image contain a ISO9660 file system...
Well - you didn't answer my questions. How did you make the image?
MS can play CUE/BIN images - I don't thing they can just play a bitwise captured datastream. Which is why the type of image is important. Which software are you thinking of?
Note - your on-disk collection will benifit from being converted from raw images to a collection on FLAC files. No quality loss, and smaller size. Same portability.
Saved this from a couple years back. Is this what you are trying to do?
Code:
So, the first thing you need to do is read the CD to a temporary file on the hard drive. To do that, pop the "protected" cd in your drive, and run this command (all on one line):
cdrdao read-cd --source-device /dev/sg0 --device /dev/sg0 --driver generic-mmc --datafile /tmp/my_cd.dat /tmp/my_cd.toc
This will read the disc from device /dev/sg0 and create two files: /tmp/my_cd.dat and /tmp/my_cd.toc.
The next step is to create a new CD from your temp files. Run this command (all on one line):
cdrdao write --device /dev/sg0 --driver generic-mmc /tmp/my_cd.toc
With luck, you will now have a copy of your disc, minus the annoying copy protection. Use grip to rip the newly created disc.
Occasionally, this will result in a disc with tracks that have blank space at the beginning/end. You can either edit the blank space after ripping, or tell grip to adjust the start/end sectors.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.