mmsv2.Player only plays first title (playlist is empty)

Discussion about user contributed plugins

Moderator: Moderator

User avatar
marleaux
Posts: 8
Joined: Sat Oct 31, 2009 8:17 am

mmsv2.Player only plays first title (playlist is empty)

Postby marleaux » Mon May 24, 2010 10:13 am

Hi all,

i wrote a litte python plugin for my personal use which should play different ablums immediately after external input.
No matter if I use

Code: Select all

self.player = mmsv2.Player()
self.player.play(folder)

or
fill a playlist and run

Code: Select all

self.player = mmsv2.Player()
self.playList = mmsv2.PlayList()
for root, dirs, files in os.walk(playPath+'/'):
   for name in files:       
       filename = os.path.join(root, name)
       if (filename.endswith('.mp3') | filename.endswith('.ogg')):
      sys.stdout.write('add: '+ root + '|' + name +'\n')
      try:
          self.playList.add(root,name)
          sys.stdout.write(str(self.playList.size()) + ' songs in list\n')
          sys.stdout.flush()
      except Exception:
          sys.stdout.write("Add " + name + " failed.")
          sys.stdout.flush()
self.player.play(self.playList)

it only plays the first song and the screensaver shows "playing 1/0" although

Code: Select all

self.player.play(self.playList)
sys.stdout.write(str(self.playList.size()) + ' songs in list\n')
sys.stdout.flush()

shows that the playlist has 17 entries like expected.

Do you have any idea what is going wrong here?
It seems that the internal playlist I created will not replace the mms playlist with the play() method, although it is said in the documentation.

I use mms 1:1.1.2~pre5-0prodeia1~karmic1 from "http://ppa.launchpad.net/mms-prodeia/ppa/ubuntu karmic" under Ubuntu.

Kind regards,
marlaux

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: mmsv2.Player only plays first title (playlist is empty)

Postby acmelabs » Wed May 26, 2010 2:53 pm

marleaux wrote:Hi all,
1.2~pre5-0prodeia1~karmic1 from "http://ppa.launchpad.net/mms-prodeia/ppa/ubuntu karmic" under Ubuntu.

Kind regards,
marlaux


Hi,
1st: you gotta use python 2.5 only!
2nd: nevertheless this whole thing is buggy (http://forum.mymediasystem.org/viewtopic.php?p=18655#p18655)

I've already coded a completely new YouTube Pyglet few months ago, but never published it, because of some strange effects in the python module. Even the simplest lines of codes (see link) didn't work reliably.
The problem is, we need support from Fredde (the inventor), but he's missing in action.

Regards,
Andreas

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Re: mmsv2.Player only plays first title (playlist is empty)

Postby Uatschitchun » Thu May 27, 2010 6:31 am

acmelabs wrote:1st: you gotta use python 2.5 only!

Until Karmic, the packages are build against python2.5!
Lg
Roman

User avatar
marleaux
Posts: 8
Joined: Sat Oct 31, 2009 8:17 am

Re: mmsv2.Player only plays first title (playlist is empty)

Postby marleaux » Thu May 27, 2010 3:45 pm

Hi.

Thanks for the answers. But I can not imagine that Python is the problem here. My plugin talks to another hardware over USB, reads and parses an XML file to find the right album and it is possible to print text and images on the mmsv2gui. All of that works fine. (Until there were 2 exceptions - that kills mms... ;-))

The interesting part is: if I create a playlist, fill it with entries, run play(playlist) and ask for the amount of titles in the playlist it returns the right number! So in general the Player calss and the PlayList class work well. MMS is showing the right title in the screensaver.

I think, the problem is the c++ method behind the python wrapper. It should iterate the given playlist and add the entries to the MMS-playlist. I'm sure that was said in the manual. Is there anyone who would be interested in this problem except me? Would it make sense for me to download the source, get it running in the debugger and try to find the error on my own? Or should I try to test my plugin with the latest developer version of mms to see if it's fixed allready?

Have a nice day, :wink:
marleaux

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: mmsv2.Player only plays first title (playlist is empty)

Postby acmelabs » Thu May 27, 2010 6:52 pm

marleaux wrote:Hi.

Thanks for the answers. But I can not imagine that Python is the problem here. My plugin talks to another hardware ove :wink:
marleaux


No, the problem certainly persists in the latest development version, too.
If you can make these simple lines work in a Pyglet, you're in the game again.
It's probably not even related to MMS, but a ugly python race condition itself.

Code: Select all

#!/usr/bin/env python
import subprocess

ret=subprocess.Popen(['ls', '-l'], stdout=subprocess.PIPE).communicate()[0]
print ret

But nevertheless you might be right, because I'm not fully understand what you are trying to do within the Pyglet, so my answer may be inappropriate for your problem.

Regards,
Andreas

User avatar
marleaux
Posts: 8
Joined: Sat Oct 31, 2009 8:17 am

Re: mmsv2.Player only plays first title (playlist is empty)

Postby marleaux » Thu May 27, 2010 7:45 pm

Hello acmelabs,

this small pyglet runs well. Thanks for the hint to the python race condition.
If the weather will be bad at the weekend I will give the c++ debugger a try... ;-)

I found out something different that surprises me. The mmsv2.Player() only works if I use Alsaplayer in MMS - what I always did. Might this be a hint to my problem? Is there a reason why Xine and Gstreamer work in MMS but not in the pyglet?

Best regards,
marleaux

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Re: mmsv2.Player only plays first title (playlist is empty)

Postby Uatschitchun » Fri May 28, 2010 5:50 am

Could be a reason of xine was re-coded without adapting changes to pythin-plugin and gstreamer was somehow neglected eversince ;)

Fredde, the one behind the python-plugin, is out of reach for ages ... so if you're willing to take some care of the python-plugin, you would make a whole bunch of people happy!
Lg

Roman

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Re: mmsv2.Player only plays first title (playlist is empty)

Postby acmelabs » Mon May 31, 2010 9:34 am

marleaux wrote:Hello acmelabs,

this small pyglet runs well.
marleaux

Does this small app runs fine in a Pyglet, or did you let it run standalone?

Regards,
Andreas

User avatar
marleaux
Posts: 8
Joined: Sat Oct 31, 2009 8:17 am

Re: mmsv2.Player only plays first title (playlist is empty)

Postby marleaux » Wed Jun 02, 2010 8:33 pm

Oh, I see. My fault. :-(

I thought this code would make problems with python in general. I ran it as a pyglet in mms (python 2.5 and 2.6) and it did NOT work.

Do we have a collection of known problems with python in mms? I think it would make sense to share our knowledge about this problem.

Anyway, I debugged the whole Player.play() chain in mmsv2 and alsaplayer. My problem is, that the playlist is replaced by "playlist.first". Then the rest of the playlist got lost.
I found the corresponding TODO:

Code: Select all

_str = urls[0]; /* TODO: Handle multiple playlist entries here */

Looks like some more work to do for me. ;-)

Best regards,
marleaux

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Re: mmsv2.Player only plays first title (playlist is empty)

Postby Uatschitchun » Fri Jun 04, 2010 5:45 pm

Here's the bug collection for python-plugin:
http://bugs.mymediasystem.org/index.php ... =&do=index

If you would like to add work to the plugin, it is more than welcome ;)

Do a bzr-checkout, do your patches and post them here as "bundles" (http://blogs.gnome.org/jamesh/2007/07/3 ... r-bundles/) and one of us will upload them to upstream with fun!
Lg

Roman


Return to “user plugins”

Who is online

Users browsing this forum: No registered users and 1 guest