Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


[How To] CD playback
#82
@felix

Aha, you have some Linux command-line skills.

Here's some nitty gritty details. Yours should be substantially similar in name, location, permissions, etc.

Preliminaries

1. The install script places two files in the directory /etc/systemd/system

Example from my player

Code:
pi@m82x64b:~ $ ls -l /etc/systemd/system/*audiocd*.service
-rw-r--r-- 1 root root 138 Oct 15 22:38 /etc/systemd/system/addaudiocd.service
-rw-r--r-- 1 root root 137 Oct 15 22:38 /etc/systemd/system/remaudiocd.service

The script also places two files in the directory /usr/local/bin 

Code:
pi@m82x64b:~ $ ls -l /usr/local/bin/*audiocd*
-rwxr-xr-x 1 root root 503 Oct 15 22:38 /usr/local/bin/addaudiocd.sh
-rwxr-xr-x 1 root root 341 Oct 15 22:38 /usr/local/bin/remaudiocd.sh


When the USB CD drive is plugged in

The syslog (/var/log/syslog) or dmesg output should show it has been recognized. Here is the relevant dmesg output when I plugged in the LG drive mentioned in the github README.


Code:
[  124.040149] usb 1-1.3: new high-speed USB device number 5 using xhci_hcd
[  124.145609] usb 1-1.3: New USB device found, idVendor=0e8d, idProduct=1887, bcdDevice= 0.00
[  124.145627] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  124.145633] usb 1-1.3: Product: Portable Super Multi Drive
[  124.145639] usb 1-1.3: Manufacturer: Hitachi-LG Data Storage Inc
[  124.145644] usb 1-1.3: SerialNumber: M03J3E12019         
[  124.149939] usb-storage 1-1.3:1.0: USB Mass Storage device detected
[  124.151509] scsi host0: usb-storage 1-1.3:1.0
[  125.185580] scsi 0:0:0:0: CD-ROM            HL-DT-ST DVDRAM GP65NB60  PF00 PQ: 0 ANSI: 0
[  125.202724] scsi 0:0:0:0: Attached scsi generic sg0 type 5
[  125.223416] sr 0:0:0:0: Power-on or device reset occurred
[  125.232137] sr 0:0:0:0: [sr0] scsi3-mmc drive: 24x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[  125.232152] cdrom: Uniform CD-ROM driver Revision: 3.20
[  125.238856] sr 0:0:0:0: Attached scsi CD-ROM sr0


Note that it is identified as sr0 and includes "cdda" (audio CD) and "tray" among its attributes.

Note also, the cdrom driver is invoked. When an audio CD is inserted in the drive, a new device link should appear. For my system

Code:
pi@m82x64b:~ $ ls -l /dev/cdrom
lrwxrwxrwx 1 root root 3 Oct 18 10:10 /dev/cdrom -> sr0

As you can see, it is a symlink to the correct drive.

When an audio CD is inserted in the drive

The addaudiocd.service should be invoked. Here is a snippet from my system log (/var/log/syslog)

Code:
Oct 18 10:10:25 m82x64b systemd[1]: /etc/systemd/system/addaudiocd.service:1: Unknown section 'UNIT'. Ignoring.
Oct 18 10:10:25 m82x64b systemd[1]: Started addaudiocd.service.
Oct 18 10:10:25 m82x64b systemd[1]: addaudiocd.service: Succeeded.


[Probably should fix the harmless UNIT issue but as the syslog shows, it's ignored.]

MPD proceeds to index the tracks on the audio CD.

Code:
pi@m82x64b:~ $ mpc playlist
cdda:///1
cdda:///2
cdda:///3
cdda:///4
cdda:///5
cdda:///6
cdda:///7
cdda:///8
cdda:///9
cdda:///10
cdda:///11
cdda:///12
cdda:///13
cdda:///14
cdda:///15
cdda:///16
cdda:///17
cdda:///18


and that's what appears on the moOdeUI display.

Regards,
Kent
Reply


Messages In This Thread
[How To] CD playback - by TheOldPresbyope - 01-18-2020, 04:47 AM
RE: [How To] CD playback - by CallMeMike - 01-18-2020, 07:43 AM
RE: [How To] CD playback - by DRONE7 - 01-18-2020, 08:35 AM
RE: [How To] CD playback - by CallMeMike - 01-18-2020, 08:57 AM
RE: [How To] CD playback - by rh2018 - 01-18-2020, 12:31 PM
RE: [How To] CD playback - by TheOldPresbyope - 01-18-2020, 01:16 PM
RE: [How To] CD playback - by Tim Curtis - 01-18-2020, 01:59 PM
RE: [How To] CD playback - by DRONE7 - 01-19-2020, 01:49 AM
RE: [How To] CD playback - by TheOldPresbyope - 01-19-2020, 03:21 AM
RE: [How To] CD playback - by ztb5129 - 01-19-2020, 06:09 AM
RE: [How To] CD playback - by jonners - 01-19-2020, 08:26 PM
RE: [How To] CD playback - by TheOldPresbyope - 01-20-2020, 03:01 AM
RE: [How To] CD playback - by DRONE7 - 01-20-2020, 04:02 AM
RE: [How To] CD playback - by TheOldPresbyope - 01-20-2020, 01:54 PM
RE: [How To] CD playback - by Norbert - 01-20-2020, 11:44 PM
RE: [How To] CD playback - by Cholfo - 03-02-2020, 04:59 PM
RE: [How To] CD playback - by TheOldPresbyope - 03-02-2020, 06:49 PM
RE: [How To] CD playback - by Cholfo - 03-03-2020, 10:10 AM
RE: [How To] CD playback - by Onionhead - 03-06-2020, 01:45 AM
RE: [How To] CD playback - by TheOldPresbyope - 03-06-2020, 02:05 AM
RE: [How To] CD playback - by Onionhead - 03-07-2020, 04:39 AM
RE: [How To] CD playback - by TheOldPresbyope - 03-06-2020, 02:51 AM
RE: [How To] CD playback - by DRONE7 - 03-06-2020, 05:47 AM
RE: [How To] CD playback - by CallMeMike - 03-06-2020, 06:11 AM
RE: [How To] CD playback - by DRONE7 - 03-06-2020, 06:20 AM
RE: [How To] CD playback - by TheOldPresbyope - 03-07-2020, 04:04 PM
RE: [How To] CD playback - by Onionhead - 03-09-2020, 07:03 PM
RE: [How To] CD playback - by TheOldPresbyope - 03-07-2020, 08:24 PM
RE: [How To] CD playback - by fdealexa - 03-08-2020, 11:23 AM
RE: [How To] CD playback - by Tim Curtis - 03-09-2020, 12:17 AM
RE: [How To] CD playback - by TheOldPresbyope - 03-09-2020, 01:19 AM
RE: [How To] CD playback - by Onionhead - 03-09-2020, 06:19 PM
RE: [How To] CD playback - by Tim Curtis - 03-09-2020, 02:17 AM
RE: [How To] CD playback - by eslei - 03-21-2020, 10:24 AM
RE: [How To] CD playback - by TheOldPresbyope - 03-21-2020, 01:23 PM
RE: [How To] CD playback - by eslei - 03-23-2020, 09:35 AM
RE: [How To] CD playback - by fdealexa - 04-08-2020, 07:54 PM
RE: [How To] CD playback - by TheOldPresbyope - 04-08-2020, 09:48 PM
RE: [How To] CD playback - by fdealexa - 04-09-2020, 07:23 AM
RE: [How To] CD playback - by fdealexa - 04-30-2020, 10:46 AM
RE: [How To] CD playback - by TheOldPresbyope - 04-30-2020, 07:29 PM
RE: [How To] CD playback - by fdealexa - 07-06-2020, 09:23 PM
RE: [How To] CD playback - by TheOldPresbyope - 07-06-2020, 11:14 PM
RE: [How To] CD playback - by fdealexa - 07-07-2020, 04:37 PM
RE: [How To] CD playback - by yannig - 08-06-2020, 10:16 AM
RE: [How To] CD playback - by TheOldPresbyope - 08-06-2020, 12:59 PM
RE: [How To] CD playback - by yannig - 08-07-2020, 07:35 PM
RE: [How To] CD playback - by largo - 11-06-2020, 05:20 PM
RE: [How To] CD playback - by fdealexa - 11-06-2020, 05:25 PM
RE: [How To] CD playback - by largo - 11-06-2020, 08:37 PM
RE: [How To] CD playback - by fdealexa - 11-06-2020, 09:16 PM
RE: [How To] CD playback - by largo - 11-09-2020, 08:29 PM
RE: [How To] CD playback - by Jempie - 01-08-2021, 11:54 AM
RE: [How To] CD playback - by TheOldPresbyope - 01-08-2021, 12:59 PM
RE: [How To] CD playback - by Jempie - 01-08-2021, 01:08 PM
RE: [How To] CD playback - by fdealexa - 01-09-2021, 08:14 AM
RE: [How To] CD playback - by Jempie - 01-11-2021, 10:07 AM
RE: [How To] CD playback - by TheOldPresbyope - 01-11-2021, 03:40 PM
RE: [How To] CD playback - by Jempie - 01-12-2021, 08:41 AM
RE: [How To] CD playback - by Jempie - 01-12-2021, 09:45 AM
RE: [How To] CD playback - by Jempie - 01-12-2021, 09:52 AM
RE: [How To] CD playback - by TheOldPresbyope - 01-12-2021, 12:51 PM
RE: [How To] CD playback - by Jempie - 01-12-2021, 01:51 PM
RE: [How To] CD playback - by Tim Curtis - 01-12-2021, 02:35 PM
RE: [How To] CD playback - by yannig - 07-31-2022, 05:44 AM
RE: [How To] CD playback - by TheOldPresbyope - 07-31-2022, 11:53 AM
RE: [How To] CD playback - by fdealexa - 07-31-2022, 03:45 PM
RE: [How To] CD playback - by TheOldPresbyope - 08-01-2022, 02:09 PM
RE: [How To] CD playback - by yannig - 08-05-2022, 11:09 AM
RE: [How To] CD playback - by fdealexa - 08-05-2022, 11:00 PM
RE: [How To] CD playback - by felix - 10-15-2022, 09:39 PM
RE: [How To] CD playback - by TheOldPresbyope - 10-16-2022, 02:49 AM
RE: [How To] CD playback - by felix - 10-16-2022, 07:01 AM
RE: [How To] CD playback - by felix - 10-16-2022, 05:46 PM
RE: [How To] CD playback - by fdealexa - 10-16-2022, 11:05 PM
RE: [How To] CD playback - by felix - 10-17-2022, 05:43 PM
RE: [How To] CD playback - by TheOldPresbyope - 10-17-2022, 06:06 PM
RE: [How To] CD playback - by felix - 10-17-2022, 06:31 PM
RE: [How To] CD playback - by felix - 10-17-2022, 06:37 PM
RE: [How To] CD playback - by fdealexa - 10-17-2022, 09:52 PM
RE: [How To] CD playback - by felix - 10-18-2022, 06:54 AM
RE: [How To] CD playback - by TheOldPresbyope - 10-18-2022, 02:45 PM
RE: [How To] CD playback - by felix - 10-18-2022, 04:25 PM
RE: [How To] CD playback - by fdealexa - 10-18-2022, 05:06 PM
RE: [How To] CD playback - by TheOldPresbyope - 10-18-2022, 05:14 PM
RE: [How To] CD playback - by felix - 10-18-2022, 06:59 PM
RE: [How To] CD playback - by TheOldPresbyope - 10-18-2022, 08:41 PM
RE: [How To] CD playback - by felix - 10-18-2022, 09:08 PM
RE: [How To] CD playback - by fdealexa - 10-18-2022, 09:44 PM
RE: [How To] CD playback - by TheOldPresbyope - 10-18-2022, 11:56 PM
RE: [How To] CD playback - by felix - 10-19-2022, 06:05 AM

Forum Jump: