Auto-run video-DVD, audio-CD

This is so nice! I have finished what I had originally planned for pup_event, now added automatic handling of video-DVD and audio-CD.

Each block device that has an icon on the desktop also has an associated 'handler' script. There is a master script, /usr/local/bin/drive_all, and for each drive icon a copy is made of that script and the icon's run-action associated with that copy. In the case of optical drive /dev/sr0, the associated script is /usr/local/bin/drive_sr0.

Previously, when a drive icon is clicked on, the 'handler' script just ran Pmount. Now, I have added automatic detection if a video-DVD or audio-CD is inserted, and run the media player immediately.

Everything is configurable, via the Event Manager. You can configure no auto-detection and only run Pmount. You can configure to run the 'handler' as soon as the disc is inserted, or only after the desktop icon is clicked on.

The reason for doing this auto-run is I want to make it easier for Windows refugees who do not understand mounting and unmounting. It is extra confusing that mounting is not wanted to play a video-DVD or audio-CD -- but is if it is required to play a media file on the CD/DVD.

As an extra feature a bit later I might put a bit of explanation about this into the 'optical' tab in Pmount.

I have updated the Event management page:
http://puppylinux.com/technical/event-management.htm

Note, the audio-CD is launched with:
defaultmediaplayer cdda://
but the problem with that is there is a delay at startup while Gxine tries to connect to the online CDDA database. A nuisance if you are not currently online. Does anyone know an alternative way to launch the CD from the commandline, that will not have that delay? ...if so, the script could check if online and if not run the alternative commandline.

Posted on 3 Jun 2008, 9:28


Comments:

Posted on 3 Jun 2008, 10:31 by dogone
Auto-run
It looks as if you've just about got event/device management nailed, Barry. Those Event Manager options should satisfy everyone. I am very eager to try it all out. Thanks too for your thorough explanations. I'm learning a lot!


Posted on 3 Jun 2008, 10:53 by ANOSage
GXine
Judging by the adverse comments, the sooner this one is removed the better? No such problems running Xine, although I'm sure there are some technical issues incorporating it?


Posted on 3 Jun 2008, 12:17 by Lobster
No boot up
"Does anyone know an alternative way to launch the CD from the commandline, that will not have that delay?"
I would have suggested cdp (with interface) or cdplay (command line only) which is in Puppy but was not working on my machine for some reason . . .


Posted on 3 Jun 2008, 17:48 by BarryK
Re: cdp, cdplay
The problem with those is the optical drive needs to have the physical analog audio cable installed that links the drive to the motherboard/card audio.

Not all PCs have that, especially in situations where they have more than one optical drive, or a USB optical drive.

I documented problems with Xine-ui and Mplayer in my blog. Incompatibility with JWM. We would have to dump JWM, go to OpenBox/Lxpanel perhaps -- which is on the cards.


Posted on 3 Jun 2008, 18:21 by Dougal
CD/DVD playback
I'm sorry to say that it might not be as simple as it seems...

I tried to implement that in Hotpup about a year ago and found that the URI commands in the media players are not very dependable... I tried Gxine, Xine, Mplayer and VLC and VLC was the only one that worked properly (keep in mind that a cd will **not** always be in /dev/cdrom, so you need to give it the right device).
I also tried hacking XfreeCD to support being given a device as an argument, but couldn't get that to work.


Posted on 4 Jun 2008, 9:28 by Jesse
mut2 for Audio CD
Mut2 Audio CD playback, via drive multimedia cmds (the physical audio cable):
/usr/sbin/mut mutclient --drivecmd play hda
/usr/sbin/mut mutclient --drivecmd next hda
/usr/sbin/mut mutclient --drivecmd stop hda
/usr/sbin/mut mutclient --drivecmd pause hda