Thank you for your donation!


Idea: USB CD-Rom + Moode = UPnP streamer
#11
Self control was low so i decided to take a long break and have a look at the code.
Armed with ambition, a few micro sd cards and (unfortunately) not much of an understanding of how the pi works, i was trying to see what could be done to get something to show up under Browse - USB - cdrom.

I had a look at the "how to" by aknaggbaugh and could not figure out how to get the thing going.  The #2 step show a call a start cd-rip.service which i didnt think i needed.

Looking around, i found this:
mkdir /media/cdrom                                        <--- had to be changed to "sudo mkdir /media/cdrom".  Success!
mount -t iso9660 /dev/sr0 /media/cdrom   <--- "only root can use --types option"

So while there now exists: Browse - USB - cdrom,  there is nothing beyond this (cdrom has no contents - failed mount command).

I tried looking for a root password for moode but came up empty.
This is where i am stuck.
Reply
#12
@hifix

That HowTo describes a CD ripping service, not a CD playback service.

I've gotten jammed up with non-moOde tasks ("real life" has a way of raising its ugly head at inconvenient times!) and haven't had time to make sure what Ashley and I did back in July works with moOde 6.3.0.

In the meanwhile, here's a brute-force-and-ignorance approach to playing a CD which doesn't require any additional scripts, services, or modification to Tim's extensive code. Sorry. This description assumes the user knows some basic Linux command line-fu.

1. plug in a USB CD/DVD player. I've used several garden-variety models with success. You should see that /dev/cdrom is now a symlink to /dev/sr0. As root change the permissions of /dev/sr0 to 666. Here's what I see in the /dev directory before and after I've done this

Code:
pi@moode4b:~ $ ls -l /dev|grep cdrom
lrwxrwxrwx 1 root root           3 Oct 21 07:03 cdrom -> sr0
crw-rw---- 1 root cdrom    21,   1 Oct 21 07:03 sg1          # we can ignore this
brw-rw---- 1 root cdrom    11,   0 Oct 21 07:03 sr0

pi@moode4b:~ $ sudo chmod 666 /dev/sr0

pi@moode4b:~ $ ls -l /dev|grep cdrom
lrwxrwxrwx 1 root root           3 Oct 21 07:03 cdrom -> sr0
crw-rw---- 1 root cdrom    21,   1 Oct 21 07:03 sg1          # we can ignore this
brw-rw-rw- 1 root cdrom    11,   0 Oct 21 07:03 sr0

Once in a while I've seen cdrom link to sr1 instead. Not sure why, but if it does, change the permissions on sr1.  Either way, this permissions-setting exercise will have to be done each time you plug in a player or reboot (told you this is brute force! This is automated in the work I haven't posted yet).

2. Tim has already compiled MPD to include its cdda plugin. As root, use your favorite editor to create a custom playlist /var/lib/mpd/playlists/CD.m3u with one entry, cdda://, which tells MPD to use the plugin to play a whole disc. Here's the dump of mine where I used the vi editor:

Code:
pi@moode4b:~ $ sudo vi /var/lib/mpd/playlists/CD.m3u
...edit and save file...
pi@moode4b:~ $ cat /var/lib/mpd/playlists/CD.m3u
cdda://

"CD", or whether name you give the .m3u file, will appear among moOde's playlists.

3. Inset a music CD and add the CD playlist to your current playlist (I usually use "clear/add" or "clear/play" to avoid confusion). Here's a screen capture of my playback panel with just the CD playlist added:

[Image: fJOjUJu.png]


That's pretty raw Rolleyes  Not even an indication of the number of tracks on the CD. But it plays!

The point of our scripts and mods to Tim's code is to take care of the device permissions, to enumerate the tracks on the CD, to clear the current playlist and then load the CD tracks into it with prettier formatting, and to display a default cover. Hope to get back to them soon.

Regards,
Kent

PS - be sure SoX resampling is disabled. I've had problems with aural dropouts when I had inadvertently left resampling enabled.
Reply
#13
(10-20-2019, 03:22 PM)hifix Wrote: ...
So while there now exists: Browse - USB - cdrom,  there is nothing beyond this (cdrom has no contents - failed mount command).
...


To this specific point, there's nothing to browse on a Red Book audio CD. Yes, there's a so-called Table of Contents but it's a data structure providing only "an index of the start positions of the tracks in the program area and lead-out." Compact Disc Digital Audio (CDDA)

But wait, there's more (the old guy said but only after he pressed "post")

In the same reference it says

Quote:Data access from computers

Unlike on a DVD or CD-ROM, there are no "files" on a Red Book audio CD; there is only one continuous stream of LPCM audio data, and a parallel, smaller set of 8 subcode data streams. Computer operating systems, however, may provide access to an audio CD as if it contains files. For example, Windows represents the CD's Table of Contents as a set of Compact Disc Audio track (CDA) files, each file containing indexing information, not audio data.

In Linux systems the app cdparanoia can provide this access. It's available in the Raspbian repository. Ashley and I use it to enumerate the number of tracks on the audio CD (which it does by reading the CD's TOC). It's also used by abcde for ripping the tracks.
Reply
#14
@TheOldPresbyope

Thank you for your feedback Kent.  Its much appreciated.
I think i understand what you have writted.
Unfortunately i am without much command line-fu.  No matter, i will give this a go.

I was confident enough to trim the power management script for my DAC (multiple attempts) but i am out of my depth in these waters.

I will wait for your code development and try that too!
Reply


Forum Jump: