Results 1 to 7 of 7

Thread: Phonon in standalone app via py2app - backend plugin error

  1. #1

    Default Phonon in standalone app via py2app - backend plugin error

    Hi, everybody,

    I'm attempting to use phonon in a standalone app on Mac OS X.

    At the moment, I am using py2app to bundle the application. When I try to play audio in the resulting app on a machine that doesn't have Qt installed, I receive the following error:

    Phonon::FactoryPrivate::createBackend(void) phonon backend plugin could not be loaded

    When I run the original python script locally (where I have PyQt and Qt w/ phonon installed), it performs exactly as expected. When I run the py2app-generated app locally, it plays audio as expected (the app does throw a threading error, but we'll save that one for another day).

    When I run the same py2app-generated app on a different machine and then try to play an audio file, I get the above "phonon backend plugin" error.

    My environment:
    - python 2.6.1
    - MySQLdb 1.2.2
    - Qt 4.4.3
    - sip 4.7.7
    - PyQt 4.4.3
    - py2app 0.3.6

    FWIW:
    All Macs involved have QuickTime 7.5.5
    I create my app via python setup.py py2app --includes sip


    Thank you for reading. Any advice about creating a standalone app that uses phonon would be deeply appreciated.

  2. #2
    Join Date
    Jan 2009
    Location
    Istanbul
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Phonon in standalone app via py2app - backend plugin error

    I had a similar problem in windows. When I moved the executable from local directory, application needs the QtCore.dll QtGui.dll phonon.dll. When these are not included, it produces error like "could not find QtCore.dll". Even I copied these dlls, phonon backend couldn't be loaded. Luckily, I found that phonon backend uses QtOpenGL4.dll. If you don't include QtOpenGL4.dll, app doesn't say that "could not find QtOpenGL4.dll". I hope including QtOpenGL4.dll (I don't know how can you do this in mac) will resolve your problem.

  3. #3
    Join Date
    Jan 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Phonon in standalone app via py2app - backend plugin error

    Quote Originally Posted by tory108 View Post
    Thank you for reading. Any advice about creating a standalone app that uses phonon would be deeply appreciated.
    I am having the same issue and have yet to discover the issue. The phonon framework seems to be copied in by py2app and I put the dylib in by hand but had no success.

  4. #4

    Default Re: Phonon in standalone app via py2app - backend plugin error

    Here's specifically how I was able to cure my phonon backend plugin error (on Mac OS X, etc., all listed above):

    In the main method of my application's script, I added a library path to include a folder named "Plugins." Thus my main method looks like this:

    if __name__ == '__main__':

    app = QtGui.QApplication(sys.argv)
    QtGui.QApplication.addLibraryPath(QtGui.QApplicati on.applicationDirPath() + "/../Plugins")
    app.setApplicationName("Music Player")
    form = radioUI()
    form.show()
    sys.exit(app.exec_())



    Then I manually copy (every time I run py2app) the phonon_backend directory into a Plugins directory in my application. There may be a better way to do this, but this is how I do it.


    What this means in practice:


    - Search for the "phonon_backend" directory in your Qt installation. On my machine, it was in "~/Trolltech/Qt-4.4.3/plugins/phonon_backend." This directory should contain two files:
    ------ libphonon_qt7_debug.dylib
    ------ libphonon_qt7.dylib
    (I'm not sure if you need both of these -- I take both just for safety.)


    - Make a folder named "Plugins" somewhere and copy the "phonon_backend" directory into it. I make the "Plugins" folder on my desktop, so the resulting directory is "~/Desktop/Plugins/phonon_backend/" and contains the two *.dylib files listed above.


    - Run py2app normally (assuming it runs normally for you).

    - "Show Package Contents" of the resulting application. You should see a structure like

    Contents
    --- Frameworks
    --- info.plist
    --- MacOS
    --- PkgInfo
    --- Resources



    - Copy your "Plugins" directory into the Contents folder. The resulting structure should look like

    Contents
    --- Frameworks
    --- info.plist
    --- MacOS
    --- PkgInfo
    --- Plugins
    --- Resources



    That should do it.

    Let me know if this is unclear or doesn't work for you. I was so happy to get past the backend plugin error.

    Of course, now I'm on to a threading error...

  5. #5
    Join Date
    Jan 2009
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Phonon in standalone app via py2app - backend plugin error

    Yeah I have followed your instructions but the app still crashes whenever I try to use phonon. Hopefully I will have better luck eventually.

  6. #6

    Default Re: Phonon in standalone app via py2app - backend plugin error

    FWIW, I got around the backend-plugin error with this fix, but I still had a threading error which prevented my application from actually playing audio. After much, much trying, I eventually learned that phonon's thread used a Qt object not registered with PyQt -- and definitively I could not access the object from python to register it!

    I eventually abandoned phonon, implemented everything I needed (asynchronous playback, seekSlider) using pyaudio and wave -- which are both built-in to python -- and deployed a working application.

    I spent five weeks trying to deploy a working python application with phonon, and I couldn't make it happen. If you succeed, God bless you -- you're a better developer than I!

  7. #7

    Default Re: Phonon in standalone app via py2app - backend plugin error

    Also FWIW, I had to recopy that Plugins directory (described in #5) after *every time* I ran py2app. Not a great workaround, I know...

Similar Threads

  1. nmake error during .pro compiling
    By mattia in forum Installation and Deployment
    Replies: 5
    Last Post: 18th June 2008, 11:15
  2. Compile 4.4.0
    By LordQt in forum Installation and Deployment
    Replies: 18
    Last Post: 29th May 2008, 14:43
  3. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 13:57
  4. Error compiling psql plugin
    By vieraci in forum Installation and Deployment
    Replies: 4
    Last Post: 7th October 2007, 03:49
  5. qt 4.2.2 install on aix
    By try to remember in forum Installation and Deployment
    Replies: 2
    Last Post: 28th March 2007, 13:19

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.