# CLI cd-players obsolete.

## teika

Summary: CLI CD players are obsolete today. In fact, it's not essential they're CLI, but that they depend solely on ioctl, not on alsa/oss.

cdda dependent tools are ok. See answers (1)  and (2) below for details.

I've sent this bug report asking deletion of related packages.

EDIT: Below is the original post on 2015-07-15.

title: Are CLI cd-players obsolete on recent PCs?

(Intentionally avoided the multimedia forum.)

In short, I guess command-line CD players are obsolete on some/most recent hardwares, including mine.

* They look to work correctly, but remain mute.

* The operation is done only with CD ioctl's.

There're several CLI cd-players in media-sound/. At least: cdcd, cdplay, cdtool, dcd, mcdp, takcd.

Let's take mcdp-0.4b for example, of which code is really tiny.

The main loop is mcdp.c, reacting keypresses. If you press 's', cd_start (or cd_stop) is called. It's defined in cddev.c, which eventually call cd_playmsf. It does an ioctl - and that's all! No alsa/oss. If you're not convinced, you can see that even volume control is done by ioctl.

(To understand kernel CD ioctl, all you have to read are:

* /usr/src/linux/drivers/cdrom/cdrom.c

* /usr/include/linux/cdrom.h

* Documentation/cdrom/* )

mcdp reports errors when any, but on my PC, it looks to run without problem. The screen looks OK, and the CD actually sounds turning correctly. It simply stay silent. I believe alsa is set fine.

Similar bug reports are found:

* http://gnats.netbsd.org/45678

* http://mail-index.netbsd.org/netbsd-bugs/2011/11/25/msg025040.html

* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=71527

* https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=709909

Maybe we should delete these packages, or at least einfo upon merging, but before filing a bug request, let us share knowledge. Thanks beforehand.Last edited by teika on Fri Mar 03, 2017 8:30 am; edited 1 time in total

----------

## Maitreya

So you are sending commands to cd player to start playing outside the OS.

This seems like the olden days where I had my sound card connected directly with my cd player with an extra cable to support this  :Wink: 

----------

## teika

Dear readers, could you test a few of these CLI cd-player[1], and report if they work on your PC? (I should have asked in the first post. :p) Most must be so tiny and thus take little time to merge.

[1] I mean: cdcd, cdplay, cdtool, dcd, mcdp, takcd; all found in media-sound/.

----------

## Roman_Gruber

cvlc (command line version of vlc) works quite well for anything for me in the past.

to play the first track of the audio cd next to me, maybe you can tweak it more than ...

```
cvlc cdda://dev/sr0

VLC media player 2.2.1 Terry Pratchett (Weatherwax) (revision 2.2.1-0-ga425c42)

[0000000001d984c8] dummy interface: using the dummy interface module...

[0000000001d7afc8] core playlist: stopping playback

[00007ff4840928a8] core stream error: cannot pre fill buffer

```

You may need to tweak it a bit

and those audio geeks here quarralled about ffmpeg / libav => and than said mpv music / media player whatever needs libav

it seems mpv is the big deal these days, you may try that too.

---

```
emerge -a cdplay

These are the packages that would be merged, in order:

Calculating dependencies... done!

[ebuild  N     ] media-sound/cdplay-1.0 

Would you like to merge these packages? [Yes/No] 

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) media-sound/cdplay-1.0::gentoo

>>> Downloading 'http://gentoo.inode.at/distfiles/cdplay-1.0.tar.gz'

--2015-07-16 11:10:15--  http://gentoo.inode.at/distfiles/cdplay-1.0.tar.gz

Resolving gentoo.inode.at (gentoo.inode.at)... 81.223.20.162

Connecting to gentoo.inode.at (gentoo.inode.at)|81.223.20.162|:80... connected.

HTTP request sent, awaiting response... 301 Moved Permanently

Location: http://gentoo.mirror.dkm.cz/pub/gentoo/distfiles/cdplay-1.0.tar.gz [following]

--2015-07-16 11:10:15--  http://gentoo.mirror.dkm.cz/pub/gentoo/distfiles/cdplay-1.0.tar.gz

Resolving gentoo.mirror.dkm.cz (gentoo.mirror.dkm.cz)... 86.49.49.49, 2a02:8300:8000:3::49

Connecting to gentoo.mirror.dkm.cz (gentoo.mirror.dkm.cz)|86.49.49.49|:80... connected.

HTTP request sent, awaiting response... 200 OK

Length: 12779 (12K) [application/octet-stream]

Saving to: '/mnt/sdb2/usr/portage/distfiles/cdplay-1.0.tar.gz'

/mnt/sdb2/usr/porta 100%[=====================>]  12.48K  --.-KB/s   in 0.02s  

2015-07-16 11:10:15 (633 KB/s) - '/mnt/sdb2/usr/portage/distfiles/cdplay-1.0.tar.gz' saved [12779/12779]

 * cdplay-1.0.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                                                      [ ok ]

>>> Unpacking source...

>>> Unpacking cdplay-1.0.tar.gz to /var/tmp/portage/media-sound/cdplay-1.0/work

>>> Source unpacked in /var/tmp/portage/media-sound/cdplay-1.0/work

>>> Compiling source in /var/tmp/portage/media-sound/cdplay-1.0/work/cdplay-1.0 ...

make -j2 CC=x86_64-pc-linux-gnu-gcc 'CFLAGS=-march=native -O2 -pipe' 'LDFLAGS=-Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads' 

x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe   -c -o cdplay.o cdplay.c

x86_64-pc-linux-gnu-gcc -march=native -O2 -pipe   -c -o utils.o utils.c

cdplay.c: In function 'set_vol':

cdplay.c:276:5: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]

     scanf("%d", &channel);

     ^

cdplay.c:279:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]

  scanf("%d", &volume);

  ^

x86_64-pc-linux-gnu-gcc -Wl,-O1 -Wl,--as-needed -Wl,--no-keep-memory -Wl,--reduce-memory-overheads  cdplay.o utils.o   -o cdplay

>>> Source compiled.

>>> Test phase [not enabled]: media-sound/cdplay-1.0

>>> Install cdplay-1.0 into /var/tmp/portage/media-sound/cdplay-1.0/image/ category media-sound

>>> Completed installing cdplay-1.0 into /var/tmp/portage/media-sound/cdplay-1.0/image/

strip: x86_64-pc-linux-gnu-strip --strip-unneeded -R .comment -R .GCC.command.line -R .note.gnu.gold-version

   usr/bin/cdplay

>>> Installing (1 of 1) media-sound/cdplay-1.0::gentoo

>>> Recording media-sound/cdplay in "world" favorites file...

>>> Auto-cleaning packages...

>>> No outdated packages were found on your system.

 * GNU info directory index is up-to-date.

localhost roman # exit

roman@localhost ~ $ cdplay 

roman@localhost ~ $ cdplay --help

Usage: cdplay <OPTIONS>...

Plays Audio CD from commandline.

  -c, --play[=STARTTRACK]    play whole CD in right order and take STARTTRACK

                             as first track.

  -b, --back                 previous track

  -n, --next                 next track

  -d, --device=CDROM-DEVICE  select cdrom device, from which to play

  -e, --reset           hard-reset the cdrom

  -f, --file=FILE            play from list-FILE

  -h, --help                 this output (usage)

  -i, --listtracks           lists all tracks with length

  -I, --playstatus           gives out the current track and time

  -l, --loop                 it will loop --playtrack, --playcd and --random

  -j, --eject                ejects cd

  -m, --mcn                  reads 'Universal Product Code'

  -o, --readvol              reads out the cdrom volumes

  -O, --setvol               sets cdrom volumes

  -p, --pause                pause playing (resume with -u)

  -r, --random               plays the cd in shuffle modus

  -s, --stop                 stops playing

  -t, --playtrack=TRACK      plays a specified TRACK

  -u, --resume               resumes playing from pause

  -v, --verbose              verbose output

  -V, --version              prints version of cdplay and exits

For bugs, write to elmex@ta-sa.org.

You can get cdplay on http://www.ta-sa.org/?entry=cdplay

roman@localhost ~ $ cdplay -d /dev/sr0

roman@localhost ~ $ cdplay -d /dev/sr0

```

no sound at all.

I am quite sure /dev/cdrom is hardcoded instead of /dev/sr0 these days. I got an error message which indicates this ... in teh other terminal,...

Maybe just edit the source code and redigest the ebuilds, but serious

cvlc and mpv may be the better deal anyway. It is not like that we have the pentium 120 days that we need something that slim anymore. even rasperipi is maybe powerful enough for cvlc (do not have that hardware)

Offtopic, peronsal rant: Good luck on get the stuff out of the tree, i have some other bug requests to prune packages which do not even build but they are still in the tree, and they are "obsolete". Well the tree cleaners have their reasons why they keep packages. => eternal-lands for example. the server refuses old clients and therefore obsolete ... freeorion never worked for myself, the source is a mess, teh client is a mess, ... I also wished tree cleaners would prune more packages, as any ebuild is anyway backuped to some other server forever ...

----------

## NeddySeagoon

In days of old, optical drives provided analogue audio to the sound card. Indeed, some drives could not perform digital audio extraction over the digital (PATA) Interface.

With the analogue audio link in place, playing a CDDA volume is only a matter of sending commands to the drive and making sure that the Master and CD controls on the sound card are set correctly - not muted and sliders set to about 70%.

With the removal of the analogue audio wire from the setup, the digital sound needs to be routed to the PCM input on the sound card.  There is nothing to stop CLI CD players doing this.

I can't test right now as I only have a netbook to hand.

----------

## Cyker

Oooh that's some nostalgia.

My first CD-ROM drive actually had a full set of play/pause etc buttons on it; Could listen to CDs while in the BIOS config or when it had crashed  XD

These days computers, esp. laptops, seem to increasingly come without optical drives  :Sad: 

----------

## Ottre

From the FreeBSD 2.0 release notes:

 *Quote:*   

> 
> 
> 2.1. Disk Controllers
> 
> WD1003 (any generic MFM/RLL)
> ...

 

And the Soundblaster wiki article:

 *Quote:*   

> 
> 
> CD-ROM Support
> 
> Early Intel PCs built after the IBM PC/AT typically only included support for one ATA interface (which controlled up to two ATA devices.) As computer needs grew it became common for a system to need more than 1 ATA interface. With the development of the CD-ROM, many computers could not support it since both devices of the one channel were already used. Several Sound Blaster 16 boards provided an additional IDE interface to computers that had no spare ATA-ports for a CDROM, though the additional drive interface typically only supported one device rather than two, it typically only supported CD ROM drives, and it usually could not support additional hard drives.
> ...

 

 :Cool: 

----------

## teika

I submitted a bug report. If you want CLI cdplayers to remain in the portage tree, please comment there.

Sorry for not updating for a year. ;-)

----------

