numerous xdg-screensaver's running

This forum is about all development around libVLC.
xpapax
Blank Cone
Blank Cone
Posts: 12
Joined: 30 May 2011 16:56

numerous xdg-screensaver's running

Postby xpapax » 26 Aug 2011 17:14

I'm using the MediaListPlayer to play about 20 videos in a loop. I left them playing through the night last night and when I did a ps -A this morning there was about 30 xdg-screensaver's running, and I was unable to start any programs until I killed my VLC / Java code.

My question is; Is it normal for vlc to start that many copies of xdg-screensaver? Or is this most likely a cause of a bug in my code? If the latter I will post my player code and hopefully someone can help show me where I went wrong.

Thanks

Rémi Denis-Courmont
Developer
Developer
Posts: 15258
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: numerous xdg-screensaver's running

Postby Rémi Denis-Courmont » 26 Aug 2011 18:00

It can be caused by leaks in your code, or bugs in xdg-screensaver itself.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

xpapax
Blank Cone
Blank Cone
Posts: 12
Joined: 30 May 2011 16:56

Re: numerous xdg-screensaver's running

Postby xpapax » 26 Aug 2011 18:56

Oh I can see it being my code. Its pretty hacked together. I'm not sure what section of the code to post, but I will give a brief run down of how I have it working, and a few questions I've had about the proper way doing things.

I have a playlist stored in a local DB, when the player starts its pulls the list from the DB and adds each item into the player. Once they're all added it starts the player in a loop. Here is a good chunk of the code from my player.

If I play only a single video i see two copies of xdg-screensaver running, but if I run multiple videos, it seems to start 2 copies of xdg-screensaver every time a new video starts.

This is the code for creating all the players, and starting it

Code: Select all

System.setProperty("jna.library.path", "\\lib\\"); Canvas c = new Canvas(); c.setBackground(Color.black); p = new JPanel(); p.setLayout(new BorderLayout()); p.add(c, BorderLayout.CENTER); f = new JFrame("VLCJ"); f.setContentPane(p); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setExtendedState(Frame.MAXIMIZED_BOTH); f.setUndecorated(true); mediaPlayerFactory = new MediaPlayerFactory("--no-video-title-show", "-v"); mediaListPlayer = mediaPlayerFactory.newMediaListPlayer(); mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer(new FullScreenStrategy() { public void enterFullScreenMode() { } public void exitFullScreenMode() { } public boolean isFullScreenMode() { return false; } }); mediaPlayer.setVideoSurface(mediaPlayerFactory.newVideoSurface(c)); f.setVisible(true); mediaListPlayer.setMediaPlayer(mediaPlayer); mediaList = mediaPlayerFactory.newMediaList(); loadPlayer(); //grab a list from the DB and add each to the mediaList /** Didnt post all the listeners since it seems to make you include them all. This one is used for something else and shouldnt effect the xdg-screensaver mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer(new FullScreenStrategy() { public void finished(MediaPlayer arg0) { synchronized (mediaPlayer) { mediaPlayer.notify(); } } }); mediaListPlayer.setMediaList(mediaList); mediaListPlayer.setMode(MediaListPlayerMode.LOOP); mediaListPlayer.play();
Here is my video loading code

Code: Select all

private int loadPlayer(){ if(accessList == null){ accessList = new AccessPlayList(); } playList = accessList.getPlayList(); if(playList.size() == 0){ return 0; } Collections.sort(playList); for(int i = 0; i < playList.size(); i++){ if(playList.get(i).getFileType().compareToIgnoreCase("jpg") == 0 || playList.get(i).getFileType().compareToIgnoreCase("jpeg") == 0 || playList.get(i).getFileType().compareToIgnoreCase("png") == 0){ mediaList.addMedia("fake://" + playList.get(i).getLocation(), "fake-duration="+(playList.get(i).getPlayTime() * 1000)); } else if(playList.get(i).getFileType().compareToIgnoreCase("mov") == 0 || playList.get(i).getFileType().compareToIgnoreCase("wmv") == 0 || playList.get(i).getFileType().compareToIgnoreCase("mp4") == 0 || playList.get(i).getFileType().compareToIgnoreCase("flv") == 0){ mediaList.addMedia(playList.get(i).getLocation()); } else{ System.err.println("Error loading video to playlist"); } } return 1; }
Im guessing the problem should be somewhere in these chunks of code, if anyone can see anything im doing wrong.

Thanks
Last edited by xpapax on 29 Aug 2011 16:36, edited 1 time in total.

sherington
Cone that earned his stripes
Cone that earned his stripes
Posts: 491
Joined: 10 Sep 2008 11:57
VLC version: master
Operating System: Linux

Re: numerous xdg-screensaver's running

Postby sherington » 27 Aug 2011 15:39

This is what I see, take vlcj out of the equation, my "C" skills are not so great but I think this is correct:

Code: Select all

#include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <vlc/vlc.h> int main(void) { printf("Starting...\n"); const char* libvlcArgs[] = {}; libvlc_instance_t* libvlc; libvlc = libvlc_new(sizeof libvlcArgs / sizeof *libvlcArgs, libvlcArgs); libvlc_media_player_t* mediaPlayer = libvlc_media_player_new(libvlc); libvlc_media_t* media = libvlc_media_new_path(libvlc, "movie.iso"); libvlc_media_player_set_media(mediaPlayer, media); printf("Before play...\n"); sleep(5); libvlc_media_player_play(mediaPlayer); printf("Playing..."); sleep(10); libvlc_media_player_stop(mediaPlayer); libvlc_media_release(media); libvlc_media_player_release(mediaPlayer); libvlc_release(libvlc); printf("All done.\n"); return EXIT_SUCCESS; }
As soon as libvlc_media_player_play() is called, xdg-screensaver appears *twice* in the process list:

Code: Select all

me 14028 1 0 14:24 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x03e00000 me 14036 1 0 14:24 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x03e00000
As soon as the application terminates, one of the processes goes, but the other remains:

Code: Select all

me 14028 1 0 14:24 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x03e00000
Some time later, maybe a minute or so, this remaining process does go too.

If I change the above test code to play another video before it exits, then each time libvlc_media_player_play() is called you get xdg-screensaver twice in the process list, and each time you stop you get one xdg-screensaver seemingly left over.

I do not know what the correct behaviour is, but I'm pretty sure vlcj is not the cause of what you described.

menkey18
New Cone
New Cone
Posts: 7
Joined: 08 Aug 2011 15:13

Re: numerous xdg-screensaver's running

Postby menkey18 » 22 Sep 2011 15:25

I have exactly the same problem: when I stop playing the last video and start playing a new video, it generates 2 xdg-screensaver, and what the worse thing is that, after a while, the newly playing video is popping up from a new frame, and seperated from my video widget layout.

Can anyone tell me how to stop vlc from generating xdg-screensaver?

Thank you very much in advance!

Rémi Denis-Courmont
Developer
Developer
Posts: 15258
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: numerous xdg-screensaver's running

Postby Rémi Denis-Courmont » 22 Sep 2011 15:44

I am not sure what you expect by "how"? Fix the bug...
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Matt A
New Cone
New Cone
Posts: 1
Joined: 11 Oct 2011 02:45

Re: numerous xdg-screensaver's running

Postby Matt A » 11 Oct 2011 05:53

The call to spawn a xdg-screensaver process is ./vlc/modules/misc/inhibit/xdg.c:155.
Yeah, I see a few of these processes after running VLC with a playlist on loop for the last day. Some of the processes are from yesterday. I can see only suspend executions hanging, I can't see any resume executions hanging. Similar to sherington, I can see the latest process has a duplicate (15767, 15775); so I can probably assume they all had a duplicate at some point, but one was removed. Perhaps two calls to suspend are being made, but only one call to resume?

Code: Select all

ps -fe | grep xdg me 4623 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c1e1f6 me 4849 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c2ed42 me 4949 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c34c30 me 5251 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c44cf8 me 5639 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c554f8 me 5866 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c5b3f3 me 6230 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c6b4db me 6859 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c81c0d me 7384 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c91caa me 7955 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04ca2507 me 8195 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04ca8402 me 8903 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04cb84ea me 9531 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04cc8cdf me 9770 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04ccebde me 10386 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04cdecb9 me 11090 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04cef4a4 me 11353 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04cf53cb me 11817 1 0 14:03 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04ccb62e me 12309 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d054b3 me 13214 1 0 14:16 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04cdbe10 me 13335 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d1bb53 me 13730 1 0 14:21 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04ce1d13 me 14173 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d2bc90 me 14995 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d3c46a me 15384 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d42365 me 15767 1 0 14:39 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04cf7330 me 15775 1 0 14:39 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04cf7330 me 16872 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d52462 me 18183 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d62cd9 me 18577 1 0 Oct10 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d68c02 me 18865 1 0 10:05 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d78fe7 me 19876 1 0 10:18 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d8981e me 20271 1 0 10:22 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d8f749 me 21500 1 0 10:36 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04d9f861 me 22590 1 0 10:49 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04db0048 me 23021 1 0 10:54 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04db5f47 me 24361 1 0 11:08 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04dc6055 me 25528 1 0 11:21 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04dd6884 me 25986 1 0 11:26 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04ddc77f me 29775 1 0 11:53 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04dfe0e7 me 30697 1 0 11:58 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c32638 me 32626 1 0 12:16 ? 00:00:00 /bin/sh /usr/bin/xdg-screensaver suspend 0x04c47d01

Rémi Denis-Courmont
Developer
Developer
Posts: 15258
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: numerous xdg-screensaver's running

Postby Rémi Denis-Courmont » 11 Oct 2011 09:57

I think this issue was addressed in VLC 1.1.12 already.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

reviver
New Cone
New Cone
Posts: 7
Joined: 30 Sep 2009 06:01

Re: numerous xdg-screensaver's running

Postby reviver » 10 Feb 2012 18:22

I still have this issue on VLC 1.1.12 on Linux Mint 12.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 6 guests