Moode Forum
[How To] CD playback - Printable Version

+- Moode Forum (https://moodeaudio.org/forum)
+-- Forum: moOde audio player (https://moodeaudio.org/forum/forumdisplay.php?fid=3)
+--- Forum: FAQ and Guides (https://moodeaudio.org/forum/forumdisplay.php?fid=9)
+--- Thread: [How To] CD playback (/showthread.php?tid=2091)

Pages: 1 2 3 4 5 6 7 8 9 10


RE: [How To] CD playback - jonners - 01-19-2020

(01-18-2020, 04:47 AM)TheOldPresbyope Wrote: I have published Version 0 of a CD Playback function in a github repo.

Everything you need to know is contained in the README.md file of the repo.

Regards,
Kent

Thank you for this Kent. My knowledge of Linux is absolutely minimal but with a little help from my friend Google I got there, and I now know a tiny bit more. Cool 
Now I have to wait until my USB DVD drive arrives to be able to try it out! Sad


RE: [How To] CD playback - TheOldPresbyope - 01-20-2020

In the published V0 addaudiocd.sh script, Ashley and I took the "how everybody does it" approach to counting the number of audio tracks on the CD. This approach executes cdparanoia to read the Table of Contents from the CD. 

I hinted in a comment in the V0 script that udev already knows the number of tracks when it triggers the addaudiocd service unit.

As an experiment, I've created a V0.1 version of the script. Rather than executing cdparanoia, it queries the udev database for the track count. This avoids reading (again) the CD.

In a test using the development system described in the README, this change does not have a substantial effect on the time to load a 20-track CD. Perhaps it shaved off a second or two from ca. 14s.

@DRONE7

I'm curious whether you see a bigger effect with your slower drive.

If you want to try, I suggest you first save the V0 script in case my new version bombs for you (although you'll also get a fresh copy in the following step). On the target host
Code:
cd /usr/local/bin
sudo mv addaudiocd.sh addaudiocd.sh.V0


Then download moOdeCDPlay-master.zip again. As before, unzip it in the /home/pi directory of the target host.

All you need from this unzipped file is the experimental script
Code:
cd /usr/local/bin
sudo cp /home/pi/moOdeCDPlay-master/addaudiocd.sh.V0.1 addaudiocd.sh
sudo chmod +x addaudiocd.sh

No need to reboot.

Now, determine the time to load that 20-track audio CD and let us know if it's an improvement compared to your original "nearly a minute". If it is, I'll make the change permanent.

Thanks in advance.

Regards,
Kent


RE: [How To] CD playback - DRONE7 - 01-20-2020

@TheOldPresbyope


WOW!!    Doing cartwheels here... Big Grin

That is such an improvement.....a couple of seconds for the same cd

less than 4 seconds for a new cd.... whoo hoo!! 

Unfortunately....when I select a track to play mpd consumes 100% cpu and Pi2B starts cooking.....then all the tracks disappear from the moode page and top reports mpd at 100% cpu usage.....this does not resolve and a reboot is needed. Sad

Code:
dmesg | tail -20
[   46.732013] scsi 1:0:0:0: CD-ROM            Toshiba  SuperMultiPA3761 TO01 PQ: 0 ANSI: 0
[   46.774655] sr 1:0:0:0: Power-on or device reset occurred
[   46.840442] sr 1:0:0:0: [sr0] scsi3-mmc drive: 8x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[   46.841687] sr 1:0:0:0: Attached scsi CD-ROM sr0
[   46.842299] sr 1:0:0:0: Attached scsi generic sg1 type 5
[   98.823749] usb 1-1.5.4: USB disconnect, device number 8
[   98.863903] scsi 1:0:0:0: rejecting I/O to dead device
[  104.652803] usb 1-1.5.4: new high-speed USB device number 9 using dwc_otg
[  104.784073] usb 1-1.5.4: New USB device found, idVendor=0930, idProduct=0c06, bcdDevice= 6.17
[  104.784093] usb 1-1.5.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  104.784101] usb 1-1.5.4: Product: Ext SuperMulti          
[  104.784109] usb 1-1.5.4: Manufacturer: Toshiba
[  104.784116] usb 1-1.5.4: SerialNumber: SATASLIM00003000000
[  104.788137] usb-storage 1-1.5.4:1.0: USB Mass Storage device detected
[  104.790472] scsi host2: usb-storage 1-1.5.4:1.0
[  105.855903] scsi 2:0:0:0: CD-ROM            Toshiba  SuperMultiPA3761 TO01 PQ: 0 ANSI: 0
[  105.898519] sr 2:0:0:0: Power-on or device reset occurred
[  105.964370] sr 2:0:0:0: [sr1] scsi3-mmc drive: 8x/24x writer dvd-ram cd/rw xa/form2 cdda tray
[  105.966251] sr 2:0:0:0: Attached scsi CD-ROM sr1
[  105.967257] sr 2:0:0:0: Attached scsi generic sg1 type 5


EDIT 2.0 Smile  Ok... yes the dmesg was correct....seems the usb hub has died....replaced and now all is working as expected....your update works !! in toto
cheers..bob


RE: [How To] CD playback - TheOldPresbyope - 01-20-2020

@DRONE7

That's great. Thanks for trying.

Will make this the default method to load the CD.

Regards,
Kent


RE: [How To] CD playback - Norbert - 01-20-2020

@TheOldPresbyope

I don't need that... but it is fantastic !!

Best regards
Norbert


RE: [How To] CD playback - Cholfo - 03-02-2020

Thank you Kent
Easy to install and works great.
Tested my external Rodzon dvd writer with a couple of rpi 3B powered with different power supplies, one with Raspbian and one with moode and both needed a powered hub for the Rodzon to work properly. I don't know if this is a 3B thing or it is the player draining to much power.


Regards.
Cholfo


RE: [How To] CD playback - TheOldPresbyope - 03-02-2020

(03-02-2020, 04:59 PM)Cholfo Wrote: Thank you Kent
Easy to install and works great.
Tested my external Rodzon dvd writer with a couple of rpi 3B powered with different power supplies, one with Raspbian and one with moode and both needed a powered hub for the Rodzon to work properly. I don't know if this is a 3B thing or it is the player draining to much power.


Regards.
Cholfo

You're welcome  Smile

I'm not sure I'd blame this on the RPi3B per se. It's supposed to be able to supply a combined 1.2A draw through its 4 USB ports. I can't find much data out there about current/power consumption by various drives, though. It would seem that the only way to be confident a particular drive wouldn't require a powered hub is to test it. As always, the power supply and power cable have to be up to the task, too. 

And I need to get back to the promised Version 1 of the CDPlay  Rolleyes

Regards,
Kent


RE: [How To] CD playback - Cholfo - 03-03-2020

(03-02-2020, 06:49 PM)TheOldPresbyope Wrote: You're welcome  Smile

I'm not sure I'd blame this on the RPi3B per se. It's supposed to be able to supply a combined 1.2A draw through its 4 USB ports. I can't find much data out there about current/power consumption by various drives, though. It would seem that the only way to be confident a particular drive wouldn't require a powered hub is to test it. As always, the power supply and power cable have to be up to the task, too. 

And I need to get back to the promised Version 1 of the CDPlay  Rolleyes

Regards,
Kent


It is the drive consuming more than the 1.2A limit of the raspberry.
Luckily i remembered having an usb power meter I bought years ago to check phone chargers.
It is on the initial spin of the drive starting to read when it exceeds the 1.2A limit and the raspberry stop powering for a second then the drive stops and start again in a loop. Once the drive is spinning and playing tracks the meter shows 550/650 mA of average power consumption.

Regards


RE: [How To] CD playback - Onionhead - 03-06-2020

Looks like a fantastic way to add more functionality, well done Kent. 

I am having some trouble with the instructions, for sure it is I at fault. Have the sd card with moOde 6.4.2 in my mac. Zip file is on the mac. Using terminal I have navigated to the sd card "boot" and then typed in cd /home/pi which gives error No such file or directory. Either my approach is wrong or I am missing a step. I have tried using @TheOldPresbyope friend but not making any head way. 

Maybe someone has a small suggestion to get me going in the right direction.


RE: [How To] CD playback - TheOldPresbyope - 03-06-2020

@Onionhead

Hi.

Try starting in the root directory (named rootfs on your Mac, probably) instead of the boot directory.

Regards,
Kent

Added after posting:

Let me be more explicit. Once flashed with the moOde image, the uSD card has two partitions, labelled "boot" and "rootfs" respectively. 

Your Mac is automounting the contents of these two partitions to two directories (mountpoints) having the same names.

After an RPi boots from the card, the separate filesystems in these two directories are merged into one running filesystem. You can see this from the command line



Code:
pi@moodecd:/var/www/command $ ls -l /dev/disk/by-label
total 0
lrwxrwxrwx 1 root root 15 Feb 22 13:57 boot -> ../../mmcblk0p1
lrwxrwxrwx 1 root root 15 Feb 22 13:57 rootfs -> ../../mmcblk0p2

pi@moodecd:/var/www/command $ mount|grep mmcblk
/dev/mmcblk0p2 on / type ext4 (rw,noatime)
/dev/mmcblk0p1 on /boot type vfat (rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro)


mmcblk0p2 (e.g. partition 2 on the sdcard) is mounted on /
mmcblk0p1 (e.g., partition 1 on the sdcard) is mounted "beneath" it on /boot
Got that  Rolleyes

Regards,
Kent