Thank you for your donation!

Instruction Guide An extension to support OLED, IR control, and CD playback
[My personal preference is to break out the various functions into separate guides since, for example, a user might want only to implement CD playback.]

Good stuff!

I'll restrict my comments to the CD playback portion of this post, and, please, consider this to be commentary by a techie, not criticism! The code here works. As I type I'm listening to a Stan Getz CD using this code.

There's considerable similarity between the udev rule and associated script here and the material Ashley Cox sent me on which we subsequently worked jointly. It was new to me but I'm guessing it's one of those "how everybody does it" things.

I think it's clever to create a playlist when the CD is inserted. Ashley and I were experimenting instead with adding the tracks directly to the MPD current queue. I can see pros and cons to both approaches.

However, while the code here creates the playlist when the CD is inserted, it doesn't remove the playlist when the CD is ejected [1], leaving a playlist of zombie tracks. Fixable with a change to the udev rule and the addition of another shell script. Note that ejecting the CD also turns into zombies any tracks already copied to the current queue. This is a hard one; even with the fixes I allude to, the user will have to clear the offending queue entries manually. As an aside, in my tests, if a CD track is playing at the moment the CD is ejected, playback continues until an internal buffer is emptied. On my test system, playback ceases some dozen seconds after the eject button is pressed. [2]

The code here doesn't deal with the case I ran into with the CD drive occasionally being enumerated as /dev/sr1 instead of /dev/sr0. Fixable with a change to

What remains is the challenge of modifying the moOde playback screen so we get something intelligent instead of strings like "cdda:///1", "File does not exist" and "Unknown artist - Unknown album".  One would  also like to display some sort of CD logo instead of the default moOde logo when a track is playing. Fixing these issues requires modification of core moOde code and is a work in progress.

Clearly I need to create a github repo of Ashley's and my work rather than just post to the forum. 


[1] Indeed, I don't see any code here which deals explicitly with CD ejection. Perhaps I overlooked it?

[2] In our approach, we clear the queue when the CD is inserted and then load the CD track list into the queue. We stop the player and clear the queue when the disc is ejected. This avoids all the points I raised with my "however" paragraph. In the approach here, on the other hand, the current queue and the currently playing track may be from some other source and shouldn't simply be cleared.

Messages In This Thread
RE: An extension to support OLED, IR control, and CD playback - by TheOldPresbyope - 01-15-2020, 07:11 PM

Forum Jump: