Optical drive icon now on desktop
Forum member CF-DKS reported that when plug in a CD, no icon appears on the desktop:
https://forum.puppylinux.com/viewtopic.php?p=155977#p155977
...whereas, it does appear in Scarthgap.
I have tracked down the cause of the problem. This has value "-1":
/sys/block/sr0/events_poll_msecs
What that means, is it uses the default polling interval, in milliseconds, in this:
/sys/module/block/parameters/events_dfl_poll_msecs
...which has "2000" in Scarthgap, "0" in Excalibur. "0" means
never poll.
The reason for the different values is that there is a udev rule in Scarthgap that writes "2000" to that file, but that rule is missing in Excalibur, due to me having cut down the rules to an absolute minimum.
I did a bit of reading, and decided don't want to turn on polling globally by writing to events_dfl_poll_msecs; instead want to be targeted to the optical drives only. I created this udev rule in /etc/udev/rules.d/92-easyos-poll.rules:
#cd/dvd detect plugin, need to poll...
#"-1" means use default in /sys/module/block/parameters/events_dfl_poll_msecs which is 0 (never poll)
SUBSYSTEM=="block", KERNEL=="sr0", ATTR{removable}=="1", ATTR{events_poll_msecs}=="-1", ATTR{events_poll_msecs}="3000"
SUBSYSTEM=="block", KERNEL=="sr1", ATTR{removable}=="1", ATTR{events_poll_msecs}=="-1", ATTR{events_poll_msecs}="3000"
That works!
When I plugin a data CD, with files, the desktop icon appears, can click on it to mount. Good, desktop snapshot:
![]()
However, when plugged in a music CD, the icon did not appear. Does it appear in Scarthgap? Don't recall, anyway, I edited /usr/local/pup_event/frontend_funcs and inserted this code at line 366:
#20250930 non-data cd create desktop icon...
if [ "$DRV_NAME" == "sr0" -o "$DRV_NAME" == "sr1" ];then
grep -q "drive_${DRV_NAME}" /root/Choices/ROX-Filer/PuppyPin
if [ $? -ne 0 ];then
add_pinboard_func
fi
fi
Optical drives are very old technology, very slow and clunky. That's why special polling is required to detect media insertion and removal -- which imposes a background overhead. After inserting, it takes a little while before the icon appears. For a music CD, click on the icon launches pCD, a music player created by Sigmund:

...I stared at that window, and nothing happened. Don't recall exactly how long I waited, but closed the window and started doing something else, then suddenly this appeared:

...I was then able to play the tracks.
But, why does it take so long to start? This is a project for
someone; I've got too much else to do. The executable is
/usr/local/bin/pcd.
Tags: easy