Bug 165544

Summary: Device Notifier does not show audio CDs
Product: [Unmaintained] plasma4 Reporter: Tarmo Johannes <tarmo>
Component: widget-devicenotifierAssignee: Alexis MENARD <darktears31>
Status: RESOLVED WORKSFORME    
Severity: normal CC: alex.merry, aseigo, bobby.culture, contact, jagarni1983, pandamine, pcdoctor01
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Desktop file to open audio cd with Device Notifier
Desktop file for opening audio CD with Device Notifier
CD and DVD predicates for Device notifier KDE 4.x

Description Tarmo Johannes 2008-07-02 01:12:03 UTC
Version:            (using KDE 4.0.4)
Installed from:    SuSE RPMs
Compiler:          gcc (SUSE Linux) 4.3.1 20080507 (prerelease) [gcc-4_3-branch revision 135036] 
OS:                Linux

If to insert an audo CD and choose 'Play Audio CD with Amarok", Amarok (using xine-backend and otherwise able to play CD-s) does not fins the cd. The problem is likely that it the action uses evidently desktop file amarok_play_audiocd.desktop that has command 'Exec=amarok --cdplay %u'. Somehow the device name (%u) leaves unspecified and the device name in amarok's settings gets overwritten with 'file:'. 

I solved the problem for myself changing manually the exec line in the .desktop file to 'Exec=amarok --cdplay /dev/cdrom1' but the device name should be forwarded automatically.

Also, it is not clear or  I could not find documentation, how to configure Device notifier and its actions.
Comment 1 Alexis MENARD 2008-07-14 00:31:32 UTC
Actually for KDE4.0 and KDE 4.1 you can't configure your notification. It will be done.

It's strange normally it should work.

And if you choose to open with dolphin, dolphin open the cd?
Comment 2 Tarmo Johannes 2008-08-13 21:47:46 UTC
I waited until 4.1 to see if it is OK there. Strangely enough, at least in my openSuse 11.0, notifier does not react on audio-cds any more at all. For DVD, cd-rom and usb-storages it offers only "Open with dolphin" and not play/copy/rip/download with digicam or similar. 

How does the notifier actually work? I think it uses some .dektop files to choose it actions. Where? Before it seemed to look for the desktop files in /opt/kde3/share/apps/konqueror/servicemenus/ and now not any more, but maybe I am wrong.

I understand that configuring the applet via GUI will be available in kde 4.2. But is there any way to influence its behavior now? Some rc-file or some line in some other configuration files? Desktop files in some specific folder? 

The device notifier is a very nice thing and I would love to get it work before next february (of course myabe there is something wrong in my system - some upgrade destroyed something or so. Anyway it  would be-good to understand it, I have not found any documentation anywhere.)

greetings,
tarmo
Comment 3 Alexis MENARD 2008-08-15 15:19:07 UTC
you can find the predicates used to display actions in :

$KDEDIR/share/apps/solid/actions/test-predicate-openinwindow.desktop for example
Comment 4 Alex Merry 2008-08-23 14:16:29 UTC
It seems that it doesn't show audio CDs at all in 4.1 or trunk.
Comment 5 Tarmo Johannes 2008-08-25 00:23:30 UTC
Created attachment 27026 [details]
Desktop file to open audio cd with Device Notifier

Place it to $KDEDIR/share/kde4/apps/solid/actions/
Comment 6 Tarmo Johannes 2008-08-25 00:25:19 UTC
Created attachment 27027 [details]
Desktop file for opening audio CD with Device Notifier

Place it to /usr/share/kde4/apps/solid/actions/ (or similar)
Comment 7 Tarmo Johannes 2008-08-25 00:28:18 UTC
(In reply to comment #4)
> It seems that it doesn't show audio CDs at all in 4.1 or trunk.
> 

Hello!

As I have understood, what the notifier shows, depends on the .desktop files  in folder $KDEDIR/share/apps/solid/actions/ (/usr/share/kde4/apps/solid/actions/ in my case). So far there is nothing more than test-predicate-openinwindow.desktop written by Alexis Menard that handles only storeage devices.   Likely the notifier used in earlier versions (kde 4.04) some desktop files from kde3 directories but now not any more.

So one should write additional .desktop files to that directory (I guess Amarok2 etc will do it automatically). Using example of http://kollide.net:8060/browse/DragonPlayer/misc/dragonplayer-opendvd.desktop?r=17116 and some info from http://api.kde.org/4.0-api/kdelibs-apidocs/solid/html/classSolid_1_1OpticalDisc.html I managed to write the .desktop files that manage your audio cd. For me it worked fine. I attache the files, place to the folder /usr/share/kde4/apps/solid/actions/ , retsart kde and see if it helps.

Alexis, maybe it helped other users to make such files (including actions for dvd, camera etc) available? As the 'X-KDE-Solid-Predicate' variable in desktop file is actually hard to understand?

tarmo
Comment 8 Alexis MENARD 2008-08-25 00:41:56 UTC
In fact each application should add a desktop file for an action. the installation path is $KDEDIR/share/apps/solid/actions/ and the notifier will add this action if the predicate match to the device.

This predicate is a solid predicate. In the doc you can find how construct a predicate. I haven't take a look in the Suse desktop they add because actually in trunk there is only the test predicate. I talk to lot of developpers in aKademy because they have to add .desktop in application.
Comment 9 Javier G. 2008-12-24 01:39:46 UTC
Using KDE 4.2 beta 2 (4.1.85) I can't see Audio CD notifications and isn't showed in the Device notifier applet or Dolphin "places", then I can't play audio CDs in Amarok 2 (I haven't tested Amarok 1.x), VLC, etc. 

Only I'm able to access to the audio CD data when I'm using the Audio CD player "KsCD" and K3b (a KDE 3 application). I haven't tried to mount manually the CD.
Comment 10 Dario Andres 2008-12-26 17:55:29 UTC
*** Bug 178814 has been marked as a duplicate of this bug. ***
Comment 11 Tarmo Johannes 2008-12-28 01:55:21 UTC
Created attachment 29686 [details]
CD and DVD predicates for Device notifier KDE 4.x

Extract the content to $KDEDIR/share/apps/solid/actions/
Comment 12 Tarmo Johannes 2008-12-28 01:58:52 UTC
I agree with Alexis that "each application should add a desktop file for an action" but as far they have not done it, I have written for myself predicates that handle audio-CDs and video-DVDs (when you insert a Cd or DVD, device notifier offers 'Open with Amarok', 'Copy with K3b' etc). I attache an archive with these files. Extract them to /usr/share/kde4/apps/solid/actions/ and I hope it helps.

I did not manage to write a predicate for a photo-camera thoug (it has to use some paramters for the Solid::Camera class but I did not get it. Please see http://api.kde.org/4.0-api/kdelibs-apidocs/solid/html/classSolid_1_1Camera.html if anyone can help.

But generally: Device notifier is great! Thanks, Alexis!
Comment 13 David Todd 2008-12-29 12:40:41 UTC
I have just tried to play an audio CD, in KDE 4.1.2 on Mandriva 2009) and cannot because it is not detected (mounted).  If I reboot into KDE3 then it is detected and plays fine in amarok 1.4.
Comment 14 Tarmo Johannes 2008-12-29 14:04:49 UTC
(In reply to comment #13)
> I have just tried to play an audio CD, in KDE 4.1.2 on Mandriva 2009) and
> cannot because it is not detected (mounted).  If I reboot into KDE3 then it is
> detected and plays fine in amarok 1.4.
> 

Try to download the archive above and put file amarok-play-audiocd-predicate.desktop to your /usr/share/kde4/apps/solid/actions/ (and why not all the other files in the package), maybe you need logout-login from kde and device notifier should offer then "x actions for this device" when you insert an audio-cd.
I think the way device notifier handles the media is much more elegant and flexible than the icons and dialogs in kde 3.5.x, I personally like it a lot.

The question is just, when will the applications write their own predicates that the notifier can read. It is clear that it will not happen to KDE3 applications, so the volunteers' help and spreading possible predicate.desktop could fill the gap!
Comment 15 Aaron J. Seigo 2009-01-06 17:28:34 UTC
ok, so this has nothing to do with plasma really at all, but individual applications. what i'm going to do is write a blog entry urging app devs to write those .desktop files.
Comment 16 Mathew de Detrich 2009-02-02 09:00:33 UTC
I can also confirm this bug

The directory where you place the .desktop files in KDE 4.2 appears to be /usr/share/apps/solid/actions (Archlinux default install)
Comment 17 G.G. 2010-05-18 08:53:44 UTC
I'm going to try this and see if Amarok will play an audio cd after applying this fix manually.
I have a dual dvd drive system and it's a known problem with trying to mount an audio cd using kde4.  I never had this problem with kde3.
I don't have this problem with gnome.