lzoubek / xbmc-plugin-mpdc

XBMC plugin for remote control of multiple MPD servers
GNU General Public License v3.0
20 stars 13 forks source link

script.mpdc error on appletv box #4

Closed jschelfh closed 13 years ago

jschelfh commented 13 years ago

ERROR: Error Type: type 'exceptions.ImportError'

xbmc.log: 10:57:34 T:60530176 INFO: -->Python script returned the following error<-- 10:57:34 T:60530176 DEBUG: Process - The source file to load is /Users/frontrow/Library/Application Support/XBMC/addons/script.mpdc/default.py 10:57:34 T:60530176 DEBUG: Process - Setting the Python path to /Users/frontrow/Library/Application Support/XBMC/addons/script.mpdc:/Users/frontrow/Library/Application Support/XBMC/addons/script.module.simplejson/lib:/Users/frontrow/Library/Application Support/XBMC/addons/script.module.beautifulsoup/lib:/mnt/Scratch/Users/frontrow/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pil/lib:/Users/frontrow/Library/Application Support/XBMC/addons/script.module.elementtree/lib:/mnt/Scratch/Users/frontrow/Applications/XBMC.app/Contents/Resources/XBMC/addons/script.module.pysqlite/lib:/Applications/XBMC.app/Contents/Frameworks:/Applications/XBMC.app/Contents/Frameworks/lib/python26.zip:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-darwin:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/plat-mac/lib-scriptpackages:/Applications/XBMC.app/Contents/Frameworks/libpython2.6/lib-tk:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-old:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload:/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/site-packages: 10:57:34 T:60530176 DEBUG: Process - Entering source directory /Users/frontrow/Library/Application Support/XBMC/addons/script.mpdc 10:57:34 T:60530176 DEBUG: Instantiating addon using automatically obtained id of "script.mpdc" dependent on version 2.0 of the xbmc.python api 10:57:34 T:60530176 INFO: -->Python script returned the following error<-- 10:57:34 T:60530176 ERROR: Error Type: type 'exceptions.ImportError' 10:57:34 T:60530176 ERROR: Error Contents: dlopen(/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload/_tkinter.so, 2): Library not loaded: /System/Library/Frameworks/Tcl.framework/Versions/8.4/Tcl Referenced from: /Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload/_tkinter.so Reason: image not found 10:57:34 T:60530176 ERROR: Traceback (most recent call last): File "/Users/frontrow/Library/Application Support/XBMC/addons/script.mpdc/default.py", line 30, in import gui,xbmpc,dialog File "/Users/frontrow/Library/Application Support/XBMC/addons/script.mpdc/resources/lib/gui.py", line 23, in import pmpd,xbmpc,dialog,albumart,playercontrols File "/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-tk/dialog.py", line 3, in from Tkinter import * File "/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-tk/Tkinter.py", line 39, in import _tkinter # If this fails your Python may not be configured for Tk ImportError: dlopen(/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload/_tkinter.so, 2): Library not loaded: /System/Library/Frameworks/Tcl.framework/Versions/8.4/Tcl Referenced from: /Applications/XBMC.app/Contents/Frameworks/lib/python2.6/lib-dynload/_tkinter.so Reason: image not found 10:57:34 T:60530176 INFO: -->End of Python script error report<-- 10:57:34 T:60530176 INFO: Python script stopped 10:57:34 T:60530176 DEBUG: Thread XBPyThread 60530176 terminating 10:57:34 T:2684407808 DEBUG: waiting for python thread 2 to stop 10:57:34 T:2684407808 DEBUG: python thread 2 destructed 10:57:34 T:2684407808 DEBUG: ------ Window Init (DialogKaiToast.xml) ------ 10:57:34 T:2684407808 DEBUG: Alloc resources: 0.01ms (0.01 ms skin load) 10:57:40 T:2684407808 DEBUG: ------ Window Deinit (DialogKaiToast.xml) ------

lzoubek commented 13 years ago

Thanks for reporting this issue, we hopefully got this work on AppleTV :-)

It looks like there is naming conflict with my dialog.py and some system's dialog. Fix is easy, just renaming my dialog.py to something else.

lzoubek commented 13 years ago

I've created branch with fix https://github.com/lzoubek/xbmc-plugin-mpdc/tree/eden_issue4 Just click 'Downloads' to get the plugin, then unzip & overwrite original files in /Users/frontrow/Library/Application Support/XBMC/addons/script.mpdc.

Please let me know, if it works ;-)

jschelfh commented 13 years ago

Thanks a million !! the fix is is working... however it now fails at a later stage

When I select a Profile I get these errors:

09:20:34 T:60713472 NOTICE: PMPDClient 09:20:34 T:60713472 ERROR: Exception in python script callback execution 09:20:34 T:60713472 ERROR: Traceback (most recent call last): 09:20:34 T:60713472 ERROR: File "/Users/frontrow/Library/Application Support/XBMC/addons/script.mpdc/default.py", line 125, in onClick 09:20:34 T:60713472 ERROR: ui = gui.GUI( 'mpd-client-main.xml',addon.getAddonInfo('path'), self.skin,seekid) 09:20:34 T:60713472 ERROR: File "/Users/frontrow/Library/Application Support/XBMC/addons/script.mpdc/resources/lib/gui.py", line 159, in init 09:20:34 T:60713472 ERROR: os.makedirs(art_dir) 09:20:34 T:60713472 ERROR: File "/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/os.py", line 150, in makedirs 09:20:34 T:60713472 ERROR: makedirs(head, mode) 09:20:34 T:60713472 ERROR: File "/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/os.py", line 150, in makedirs 09:20:34 T:60713472 ERROR: makedirs(head, mode) 09:20:34 T:60713472 ERROR: File "/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/os.py", line 150, in makedirs 09:20:34 T:60713472 ERROR: makedirs(head, mode) 09:20:34 T:60713472 ERROR: File "/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/os.py", line 150, in makedirs 09:20:34 T:60713472 ERROR: makedirs(head, mode) 09:20:34 T:60713472 ERROR: File "/Applications/XBMC.app/Contents/Frameworks/lib/python2.6/os.py", line 157, in makedirs 09:20:34 T:60713472 ERROR: mkdir(name, mode) 09:20:34 T:60713472 ERROR: OSError 09:20:34 T:60713472 ERROR: : 09:20:34 T:60713472 ERROR: [Errno 30] Read-only file system: 'special:' 09:20:39 T:61228032 DEBUG: Thread Jobworker 61228032 terminating (autodelete) 09:20:39 T:60877312 DEBUG: Thread Jobworker 60877312 terminating (autodelete)

lzoubek commented 13 years ago

Seems like we are getting closer :-) oh, this is a nice bug, that has not been discovered before, you're running latest eden build? Anyway, it's hopefully fixed, please update your sources from eden_issue4 branch.

jschelfh commented 13 years ago

yes, we are defenitely getting closer :-)

It now works - fantastic !!, I'm able to control my MPD Server There are still 2 issue :-(, and one feature request...

  1. Once selected a profile, you are stuck in the next screen - normally on the apple remote you can hit the 'menu' button to go back - this is a problem because the only way to get back to the other XBMC functionality is by rebooting the box Its probably not that easy to code this given the fact that you don't have an apple box - but maybe a 'back' button can be integrated... (to be clear I'm stuck in the screen with the tabs "Queue,Artists,Playlists,Files")
  2. Volume control is not working. Again on the apple remote you can use the "+" and "-" buttons to control the audio volume but these are interpretted as 'up' and 'down'
  3. I'm using MPD to control a multiroom/zone setup. In the latest MPD releases you can define multiple outputs on a single server - and this is the way I configured it :-), so it would be great if you could select the desired output (an example of such thing can be found in the clients DroidMPD(Android) or KatoembaMPD(apple) ) Workaround: the alternative, as you intended it I guess, is to create several servers each with his own audio output

PS: I'm using version mpdclient 2.0.4 on the XBMC Dharma nigthtly Built on Oct 3 2011

Many Thanks Jurgen

lzoubek commented 13 years ago

re 1: I've tried to fix it + added some debug code - I need to know which action or signal is being sent using apple remote. On PC it works for backspace or escape.

re2: same as 1 :) but without fix

re3: Intention was not to workaround multiroom setup. I didn't know about that. Unfortunately I don't own mac neither android, could you link. I always thought, that outputs in MPD must always play the same music. From what I see in mpc, you can only enable/disable outputs using clients. Is that what you are suggesting?

jschelfh commented 13 years ago

Wow, I wish all support/help was like this :-)

  1. issue fixed, hitting the "menu" button now lets you get back
  2. hopefully this is what you were looking for: I hitted a few times the "+" and "-"-buttons these are the lines at the end:

16:34:56 T:61605376 NOTICE: Connecting to MPD 192.168.1.64:6601 16:34:56 T:62907904 NOTICE: Starting time poller thread 16:34:56 T:61605376 NOTICE: Connected 16:34:56 T:61605376 NOTICE: Handling changes - ['mixer', 'playlist', 'player', 'options'] 16:34:56 T:2684407808 DEBUG: ------ Window Init (DialogKaiToast.xml) ------ 16:34:56 T:2684407808 DEBUG: Alloc resources: 0.01ms (0.01 ms skin load)
16:34:57 T:2684407808 DEBUG: ------ Window Deinit (DialogProgress.xml) ------ 16:35:01 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0 16:35:04 T:2684407808 DEBUG: ------ Window Deinit (DialogKaiToast.xml) ------ 16:35:09 T:61605376 NOTICE: Action id=7 buttonCode=0 amount1=1.0 amount2=0.0 16:35:09 T:64411136 NOTICE: Handling changes - ['player'] 16:35:09 T:2684407808 DEBUG: ------ Window Init (DialogKaiToast.xml) ------ 16:35:09 T:2684407808 DEBUG: Alloc resources: 0.01ms (0.01 ms skin load) 16:35:15 T:2684407808 DEBUG: ------ Window Deinit (DialogKaiToast.xml) ------ 16:35:15 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0 16:35:16 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0 16:35:16 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0 16:35:16 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0 16:35:17 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0 16:35:17 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0 16:35:17 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0 16:35:17 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0
16:35:18 T:61605376 NOTICE: Action id=3 buttonCode=0 amount1=1.0 amount2=0.0 16:35:19 T:61605376 NOTICE: Action id=3 buttonCode=0 amount1=1.0 amount2=0.0 16:35:20 T:61605376 NOTICE: Action id=3 buttonCode=0 amount1=1.0 amount2=0.0 16:35:21 T:61605376 NOTICE: Action id=3 buttonCode=0 amount1=1.0 amount2=0.0 16:35:22 T:61605376 NOTICE: Action id=4 buttonCode=0 amount1=1.0 amount2=0.0

  1. I probably didn't explain it correctly.. all the outputs in MPD indeed play the same music. but you can toggle on/off the outputs. In my setup I have a server for each remote, and each server has all the outputs

Maybe this clarifies: octopus:~# mpc -h localhost -p 6601 outputs Output 1 (Keuken) is enabled Output 2 (Living) is disabled Output 3 (Bureau) is disabled Output 4 (Slaapkamer) is disabled Output 5 (Badkamer) is disabled

thanks, Jurgen

lzoubek commented 13 years ago

Exactly, I needed to know action Ids :-). I'll fix setting volume soon, and I'll implement outputs too, thanks for helping out with testing.

My intention with server profile was my current setup. I have music storage on remote machine with streaming enabled. I want to listen to my stream from anywhere and at the same time my wife can listen to anything else using her stream. Each MPD has also mpdscribble :)

btw. XBMC Dharma nightly builds are not dharma anymore (dharma was released last year) new version is called eden and you seem to use it (not sure if dharma runs on apple tv) and MPD Client 2.x is same source as 1.x bud 1.x is targeted to dharma and 2.x to eden.

lzoubek commented 13 years ago

I cannot fix your volume keys issue. It conflicts with UP and DOWN actions. According to https://github.com/xbmc/xbmc/blob/master/xbmc/guilib/Key.h I have (after the navigation back) fix, correctl handling of actoion IDs. Please try to setup your keymap.xml (http://wiki.xbmc.org/?title=Keymap.xml) to get it work or raise an issue in XBMC directly.

jschelfh commented 13 years ago

hmm, thats too bad. The apple remote only has a few keys on it and indeed the "+" and "-" are also used as Up-DOWN in XBMC it works in the way that if you are playing a video and you hit those keys the mapping is changed to volume control instead of Up/Down - I cannot change the keymappings as this would mess up all the rest :-)

In the music section this is not working either, but in practice you can control the music volume with the remote of the television, put with MPD you can't as you want to control the volume remotely

One way to solve it, and I know I'm asking a lot here, is if the volume control is visible added to the screen, something like 'VolumeUP' and VolumeDOWN' buttons

lzoubek commented 13 years ago

Ah, so. You are not asking alot. It is actually a good idea. One of the deawbacks of current solution is, that using volume keys you change MPD volume together with XBMC volume, which is not good too.

lzoubek commented 13 years ago

MPD Client 2.0.5 has been accepted by official repo, it contains all fixes mentioned here + implementation of outputs + volume buttons, please reopen if you have still some issues