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