WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Gnome-MPlayer Extension - Request for Advice  (Read 12811 times)

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Gnome-MPlayer Extension - Request for Advice
« on: November 16, 2010, 07:11:09 AM »
I'm hoping that a regular TC packager might be able to provide some advice.

I have built an extension of gnome-mplayer which is working OK.  When partnered with Mplayer-nodeps.tcz and edna.tcz it produces a music playing system at a very acceptable resource cost.  It is very close to fulfilling what I want.  Almost...

Presently, it displays an icon in the panel notification area.  Hovering the cursor over this icon displays details of the currently playing track.  What I would like to achieve is for the change of track event to generate an on-screen pop-up display of this information.  This is the way it works in Lubuntu is it possible in TC3.1?  Are there any suitable extensions in the repository? 
   
   

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10965
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #1 on: November 16, 2010, 07:29:20 AM »
I don't know how it's done there, but if you can set a trigger at the song change, flnotify can be used to show the message.
The only barriers that can stop you are the ones you create yourself.

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #2 on: November 16, 2010, 07:58:02 AM »
I don't know how it's done there, but if you can set a trigger at the song change, flnotify can be used to show the message.
Thanks for the tip.  I found flnotify just before reading your post.  It is not visually in keeping with my extension but will assist in testing - if I can find how to trigger it..

I have also found notification-daemon.tcz but have no idea how to use it and there are no instructions in the TC repository.  The app web page is unclear to me, the app does not have a help reference or docs, and the menu executable (/usr/local/bin/notification-properties) generates a segmentation fault.

Perhaps there are other extensions that may also be used.  I'm open to suggestions and also on the way in which to trigger the track change on-screen-display.
   

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #3 on: November 16, 2010, 09:15:59 AM »
notification daemon is accessed with dbus signals and i don't know how to use it directly

but there is an easier alternative notify-send (libnotify.tcz)
Code: [Select]
notify-send -u low "Now playing" "New Song" -t 5000 -i applications-multimedia
please note that i didn't check if notify-send needs notification daemon running
« Last Edit: November 16, 2010, 09:23:36 AM by Arslan S. »

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #4 on: November 17, 2010, 07:58:59 AM »
...there is an easier alternative notify-send (libnotify.tcz)
Code: [Select]
notify-send -u low "Now playing" "New Song" -t 5000 -i applications-multimedia
please note that i didn't check if notify-send needs notification daemon running
I am unable to get this working.

In summary:
TC3.1 machine.
No missing dependencies.
notification-daemon.tcz is listed in OnBoot an the machine is rebooted.

How to tell if the daemon is running or failed?
dmesg | grep notification returns nothing.
ps -A does not indicate the daemon is running.

How is the daemon started?
/usr/local/bin/notification-properties returns:
Code: [Select]
Segmentation fault
dmesg | grep notification returns
Code: [Select]
notification-pr[4101]: segfault at 0 ip b6951b84 sp bfe8bd60 error 4 in libc-2.11.1.so  b68df000+13d000]
ps -A contains
Code: [Select]
4105 tc       dbus-launch --autolaunch 34aec1d9e8b09257197e553b00000028 --binary-syntax --close-stderr
4106 tc       /usr/local/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session

Any of the following fail presumably as a result of the segmentation fault.

Machine rebooted
sudo notify-send -u low "Now playing" "New Song" -t 5000 -i applications-multimedia returns no errors
aoss gnome-mplayer returns
Code: [Select]
Failed to open connection to session message bus: Failed to connect to socket /tmp/dbus-JsJT1tCvnF: Connection refused

Machine rebooted
sudo /usr/local/bin/notification-properties returns
Code: [Select]
Segmentation fault
sudo notify-send -u low "Now playing" "New Song" -t 5000 -i applications-multimedia returns no error message
aoss gnome-mplayer returns
Code: [Select]
Failed to open connection to session message bus: Failed to connect to socket /tmp/dbus-FMb4DJtjl5: Connection refused


Machine rebooted
sudo /usr/local/etc/init.d/dbus start
sudo /usr/local/bin/notification-properties returns
Code: [Select]
Segmentation fault
sudo notify-send -u low "Now playing" "New Song" -t 5000 -i applications-multimedia returns no error message
aoss gnome-mplayer returns
Code: [Select]
Failed to open connection to session message bus: Failed to connect to socket /tmp/dbus-cFbvy8jYsE: Connection refused

Machine rebooted
aoss gnome-mplayer returns no errors, works OK and returns no error message.
   

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14567
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #5 on: November 17, 2010, 09:54:42 AM »
Quote
Failed to open connection to session message bus: Failed to connect to socket /tmp/dbus-JsJT1tCvnF: Connection refused

This is perhaps a result of not having something like this that starts with the x session:
Code: [Select]
$ cat ~/.X.d/dbus
dbus-launch --sh-syntax --exit-with-session

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #6 on: November 17, 2010, 10:58:09 AM »
there is also notification-daemon-xfce you can use

download it and change dep list to
Code: [Select]
lib.y.tcz
libxfcegui4.tcz
libnotify.tcz
shared-mime-info.tcz
hicolor-icon-theme.tcz

also load gnome-icon-theme or any other icon theme

then execute (this is not really needed, just needed for some icons to be visible)
Code: [Select]
sudo gtk-update-icon-cache /usr/local/share/icons/hicolor
now it should work, tested from base, no need to start dbus daemon
Code: [Select]
notify-send "test" "abc" -i applications-multimedia
« Last Edit: November 17, 2010, 01:31:58 PM by Arslan S. »

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #7 on: November 18, 2010, 01:05:53 AM »
Quote from: Juanito
This is perhaps a result of not having something like this that starts with the x session:
Code:
Code: [Select]
$ cat ~/.X.d/dbus
dbus-launch --sh-syntax --exit-with-session
This does stop the error message.

ps -A contains
Code: [Select]
3927 tc       dbus-launch --sh-syntax --exit-with-session
3928 tc       /usr/local/bin/dbus-daemon --fork --print-pid 5 --print-address 7

notify-send -u low "Now playing" "New Song" -t 5000 -i applications-multimedia returns: no error message but also does not display a notification.

/usr/local/bin/notification-properties returns:
Code: [Select]
Segmentation fault

aoss gnome-mplayer returns: no error message and works OK.




there is also notification-daemon-xfce you can use

download it and change dep list to
Code: [Select]
lib.y.tcz
libxfcegui4.tcz
libnotify.tcz
shared-mime-info.tcz
hicolor-icon-theme.tcz

also load gnome-icon-theme or any other icon theme

then execute (this is not really needed, just needed for some icons to be visible)
Code: [Select]
sudo gtk-update-icon-cache /usr/local/share/icons/hicolor
now it should work, tested from base, no need to start dbus daemon
Code: [Select]
notify-send "test" "abc" -i applications-multimedia
notification-daemon-xfce added to OnBoot, dependency list changed as recommended. Reboot.

ps -A contains no reference to dbus or notification-daemon-xfce

notify-send "test" "abc" -i applications-multimedia works OK as it produces the required OSD.

ps -A contains:
Code: [Select]
4593 tc       dbus-launch --autolaunch 95e5f6024d0358e401df0b7d00000029 --bina
4594 tc       /usr/local/bin/dbus-daemon --fork --print-pid 5 --print-address
4596 tc       /usr/local/libexec/notification-daemon-xfce

notify-send -u low "Now playing" "New Song" -t 5000 -i applications-multimedia
aoss gnome-mplayer returns no errors and works OK but does not produce an OSD notification at change of track.




My interpretation of the above is that there are two independent issues.
  • Using notification-daemon.  The daemon only partially loads (segmentation fault?), leading to the failure to display any OSD notifications.
  • Using notification-daemon-xfce. The daemon successfully loads, the OSD notification work OK, but is not triggered by the change of track.
   

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #8 on: November 18, 2010, 02:26:03 AM »
notification-daemon works ok under gnome-desktop session, or even xfce session, i have no idea about segmentation fault

if you compiled gnome-mplayer from source, make sure you have libnotify enabled
« Last Edit: November 18, 2010, 02:30:06 AM by Arslan S. »

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #9 on: November 18, 2010, 08:09:35 AM »
notification-daemon works ok under gnome-desktop session, or even xfce session, i have no idea about segmentation fault
I wonder if this is a dependency issue.  In an earlier post you suggested that I download notification-daemon-xfce and amend the .dep file.  This produced a working OSD.  I was already loading everything mentioned in your amended .dep except libxfcegui4.tcz and its dependencies.  Perhaps this indicates an expectation of  file/files not presently installed by notification-daemon.tcz.


if you compiled gnome-mplayer from source, make sure you have libnotify enabled
I compile and build extensions so infrequently that I have no idea how to do this.  A pointer would be appreciated.  Is it simply a case of having notification-daemon loaded (providing libnotify as a dep) or does it require changes to the compile commands.  My skill set here is limited to the information in the wiki.
  
« Last Edit: November 18, 2010, 08:53:57 AM by SamK »

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #10 on: November 18, 2010, 10:21:05 AM »
usualy having libnotify loaded prior to executing configure command should be ok, but check configure messages for smth like "Checking for libnotify ... yes/no"

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #11 on: November 18, 2010, 10:37:09 AM »
got it now, according to default application preferences notifications disabled, go to Edit-->Preferences-->Interface-->"Show notification popup" to enable notifications

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #12 on: November 18, 2010, 11:41:56 AM »
got it now, according to default application preferences notifications disabled, go to Edit-->Preferences-->Interface-->"Show notification popup" to enable notifications
That's interesting... the option is not listed. This is version 1.0.0.  On the same machine I have Lubuntu 10.10 which includes gnome-mplayer version 0.9.9.2  which does list it.

Might it omit it if libnotify was not found during the compilation?  It wasn't installed until after the extension had been created.
   

Offline Arslan S.

  • Hero Member
  • *****
  • Posts: 825
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #13 on: November 18, 2010, 12:09:29 PM »
you need to load libnotify.tcz and compile it again

Offline SamK

  • Hero Member
  • *****
  • Posts: 713
Re: Gnome-MPlayer Extension - Request for Advice
« Reply #14 on: November 19, 2010, 03:47:58 AM »
you need to load libnotify.tcz and compile it again
Doing this has indeed produced the missing option: Edit-->Preferences-->Interface-->"Show notification popup"

When used in conjunction with notification-daemon-xfce.tcz and the modified .dep list the OSD notification works as expected on change of track.

Having now established a working (but unfinished) reference point I have gone on to investigate the problem with notification-daemon.tcz.

notification-daemon-xfce was replaced with notification-daemon but the amended .dep was retained and loaded. Again notification-daemon failed but with a reference to gconf-2.

At this point I decided to recompile notification-daemon. The configure stage stalls with the following error message:
Code: [Select]
checking for NOTIFICATION_DAEMON... configure: error: Package requirements (gtk+-2.0 >= 2.10.0,     glib-2.0 >= 2.10.0,     dbus-1 >= 0.36, dbus-glib-1 >= 0.36,    lib.y >= 0.1.3,       gconf-2.0,      libwnck-1.0 ) were not met:

No package 'gconf-2.0' found

Which extension in the TC3 repository contains gconf-2.0?  I simply cannot locate it.