From owner-freebsd-questions@FreeBSD.ORG Thu Jul 31 11:01:45 2014 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0514FE34 for ; Thu, 31 Jul 2014 11:01:45 +0000 (UTC) Received: from mailrelay001.isp.belgacom.be (mailrelay001.isp.belgacom.be [195.238.6.51]) by mx1.freebsd.org (Postfix) with ESMTP id 9A17C2B0A for ; Thu, 31 Jul 2014 11:01:44 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoMGAFUh2lNR8my9/2dsb2JhbABZgw5SV8snh08BgQYXd4QEAQU6HCMQCw4KCSUPKh4GE4hGAbwoF450D0kHhEoBBIR8AoEGhAiRV4FTkwGDSzsvgQMBHw Received: from 189.108-242-81.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([81.242.108.189]) by relay.skynet.be with ESMTP; 31 Jul 2014 13:01:31 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.9/8.14.9) with ESMTP id s6VB1ULG002066; Thu, 31 Jul 2014 13:01:30 +0200 (CEST) (envelope-from tijl@FreeBSD.org) Date: Thu, 31 Jul 2014 13:01:30 +0200 From: Tijl Coosemans To: Dutch Ingraham Subject: Re: Audio CDs Not Playing Message-ID: <20140731130130.44eced30@kalimero.tijl.coosemans.org> In-Reply-To: <53D6E32B.7030103@gmx.us> References: <53D6E32B.7030103@gmx.us> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jul 2014 11:01:45 -0000 On Mon, 28 Jul 2014 19:56:27 -0400 Dutch Ingraham wrote: > Greetings: > > I'm having trouble with playing audio CDs; specifically, they won't > play at all. Secondarily, it appears as though, if they would play, I > would need to be root to do so. > > My system stats are as follows: : > FreeBSD dutch.freebsd.net 10.0-RELEASE-p7 FreeBSD 10.0-RELEASE-p7 #0: > Tue Jul 8 06:37:44 UTC 2014 > root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64 > > > I am issuing the command and the CD > simply will not play, or move in any way. However, if I issue > , the CD will eject; if I issue > , I will receive the tracks information, etc. > So it appears as though communication is happening, but the CD will not > play. If I issue these commands as a regular user, I receive a > "permission denied" message; if run as root, simply nothing happens - > no error, nothing. In fact issuing returns 0. > > I have read the handbook sections on multimedia and setting up the > sound card, and believe I've done everything by the book. For example, > returns: > > hdac0@pci0:0:27:0: class=0x040300 card=0x04201028 > chip=0x3a6e8086 rev=0x02 hdr=0x00 vendor = 'Intel Corporation' > device = '82801JD/DO (ICH10 Family) HD Audio Controller' > class = multimedia > subclass = HDA > > and I have loaded, individually, both the snd_hda and snd_ich drivers > with the same result (the hardware notes are ambiguous on this note). > > The only somewhat useful information is returned by -f /dev/cd0 debug on> which returns: > > "cdcontrol: Inappropriate ioctl for device" However, a google search > has not informed me as to what this means or how to correct. > > If someone could point me in the correct direction, I'd be appreciative. > > PS - This issue is not limited to CLI commands; VLC will issue the > error "VLC is unable to open the MRL 'cdda:///dev/cd0'. Check the > log for details." There is no log info that I can find. In addition, I > can burn a cd with xfburn, but only as root. cdcontrol sends a special command to let the drive itself play an audio cd. This requires that the firmware supports those commands and that the drive is connected to your sound card. Modern media players like VLC don't play an audio cd like that. Instead they basically read the raw data of the cd, apply effects to it like bass, treble and volume changes and then send that to your sound card. This is much more flexible and is probably the reason why more and more cdrom drives no longer support the cdcontrol commands. To let users play an audio cd they must have access to /dev/cd0. On desktop systems I create a separate group for that called plugdev (pluggable devices) and then set permission on /dev/cd0 like this: crw-rw---- 1 root plugdev 0x4e 31 jul 08:56 /dev/cd0 Now users in the plugdev group can access the cdrom. To set these permissions you can use chgrp(1) and chmod(1) but this will be reset when you reboot. To make these permissions permanent you have to create (or modify) /etc/devfs.rules. Mine looks like this: -------------------- [local_ruleset=10] #allow plugdev to access the cdrom add path cd0 user root group plugdev mode 0660 #allow plugdev to access usb mass storage add path 'da*' user root group plugdev mode 0660 -------------------- To activate these rules you must also add the following line to /etc/rc.conf: devfs_system_ruleset="local_ruleset" These rules also give access to /dev/da* which are usb storage devices, but also fixed SCSI disks and you shouldn't allow access to those. It's unlikely that you have these in a desktop system, but in case you do you can add additional rules to restrict permissions again. For instance if /dev/da0 is a fixed SCSI disk add the following: add path 'da0' user root group operator mode 0640