Connecting CD drive to qube and ripping (how do I rip a CD to MP3?)

I’m trying to rip a CD, ideally to mp3 files, and I’m not concerned about the secrecy of those files (this isn’t really a security question).

First, I tried connecting my CD drive to my media qube, which resulted in a /dev/xvdi in media.

Then I started up VLC and pointed it to /dev/xvdi, and whether I’m trying to rip or play, it gives this error:
VLC is unable to open the MRL 'cdda:///dev/xvdi'. Check the log for details.
So I check the log, but can’t make head nor tail of it:
vlc.log (11.2 KB)

If VLC is at fault here, please propose an alternative (a CLI method to rip CDs would be awesome). If my qube setup is at fault, can you help me fix it?

I only have USB3 optical drives anymore, and doing USB passthrough to an AppVM works perfectly with various encoders - I typically use fre.ac, but it shouldn’t matter what you use.

It looks, from the log, like VLC is being confused by the CD-ROM passed through as a standard block device, not a CD drive. There are… differences, and I don’t know what they are.

But an external USB3 reader/burner will absolutely work.

How do I pass it through as a CD drive?

I don’t know. I don’t have any machines that have SATA CD-ROM drives anymore.

If it is in fact a USB connected CD drive, use the “USB Devices” section (instead of the “Data (Block) Devices” section) in the Qubes Devices widget - or the qvm-usb command - to forward it from sys-usb.

But if it is an internal drive connected over SATA, it’s not possible regardless of which program you use for ripping.

Not possible outside dom0 (for Internal IDE/SATA drives) and outside sys-usb for external USB drives. It has been discussed here by core team members:

I am not sure if the forthcoming new devices API would do anything about it. Most probably will not be a part of Qubes OS 4.2 but rather 4.3

1 Like

OK, I tried dding in dom0, but that still didn’t work:

[nathan@dom0 ~]$ sudo dd if=/dev/sr0 of=./QubesIncoming/arabic1read.iso bs=1M oflag=direct,sync status=progress
dd: error reading '/dev/sr0': Input/output error
0+0 records in
0+0 records out
0 bytes copied, 0.0354135 s, 0.0 kB/s

I guess I’ll ask if I can borrow a Windows computer.
Complete Qubes FAIL

No, user error. Running a generic tool like dd on the drive will attempt to read the data track from the CD, which in this case doesn’t exist and if it did, might not contain what you want anyway. To read the audio tracks from the CD, you need to run a specialized audio CD ripping tool. This is true even if you’re doing it in dom0. (Which is insecure BTW: Even a pure audio CD without an additional data track could in principle contain malformed Red Book metadata crafted to exploit the ripping tool. Probably not a realistic concern if it’s some decades old factory-pressed CD, but if it’s a CD-R someone just burned for you…)

The other problem is I don’t yet have a ripping tool I trust enough to put in dom0.

Also I’m baffled as to how a ripping tool won’t be able to rip from a .iso image of a disk… or can it?

As far as the tool itself not being outright malicious, I get the impression that e.g. whipper is well-respected, and it’s available in the Fedora repositories. :person_shrugging:

For audio CDs, ripping in the sense of dividing into multiple songs etc. is tangled up with imaging. It’s not like with data CD-ROMs or video DVDs where those are separate stages that are cleanly layered: Except for copy protection (which deliberately introduces layering violations and complicates things), just copying “everything” from a data CD-ROM or a video DVD is trivial; for audio CDs that’s already the hard part. Hence the need for specialized tools.