[RELEASE] Subsonic

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
t0mm0 Offline
Fan
Posts: 486
Joined: Mar 2011
Reputation: 8
Location: UK
Post: #1
hi!

here is a subsonic plugin (check out http://www.subsonic.org/ for info)

current features(v0.3.0):
  • browse and play all your music
  • play at full quality (original files) or transcode to the bitrate of your choice in settings (full quality currently require DVDPlayer)
  • search for artist, album and songs
  • view random, newest, top rated, most played and recently played albums
  • play playlists from subsonic server
  • generate random playlists by range of years and/or genre

Changelog:
Version 0.3.0
- add facility to view random, newest, top rated, most played and recently played albums
- add support for subsonic shortcuts
- fix for indexes with only one artist

Version 0.2.3
- fix for artist names that only contain numbers
- fix for titles with unicode names

Version 0.2.2
- fix silly cut and paste error causing script errors on some xbmc versions
- reduce api requirement to 1.4.0 (allows subsonic 4.2 servers)

Version 0.2.1
- Fix bug when there was more than one playlist (doh!)
- rejig debugging so no need for specific debug setting for this addon

Version 0.2.0
- Add capability to play subsonic playlists
- Add custom random playlists

Version 0.1.1
- small fix for little or no content in subsonic

Version 0.1.0
- Initial version


don't forget to set up your server info in the plugin settings. by default it points at the demo server (http://demo.subsonic.org) so you can try it out of the box.

video seems to work but i haven't done any special handling of it yet so there is nothing in the interface indicating videos.

available from my repository: https://github.com/downloads/t0mm0/t0mm0...-1.0.3.zip

xbox users can install from xbmc4xbox-addons using SVN repo installer.

comments, bug reports and feature requests welcomed, but no promises Wink

you might get better results if you force using DVDPlayer. if you don't already have a playercorefactory.xml in your userdata directory then make a file and add the following in it.

Code:
<playercorefactory>
    <rules action="prepend">
        <rule name="subsonic" filename=".*/rest/(stream|download).view.*" player="dvdplayer"/>
    </rules>
</playercorefactory>

if you already have one, just insert the line:
Code:
<rule name="subsonic" filename=".*/rest/(stream|download).view.*" player="dvdplayer"/>
directly after the <rules> tag.

see http://wiki.xbmc.org/index.php?title=HOW...a_playback for more info on playercorefactory.xml


thanks,

t0mm0
(This post was last modified: 2011-05-15 11:48 by t0mm0.)
find quote
Jimcando Offline
Junior Member
Posts: 40
Joined: Nov 2009
Reputation: 0
Post: #2
Thanks for this! Big Grin

I'm getting an error when I run it though Sad
When I first run it, it returns my Music folder correctly, when I try open that music folder, it returns an error.

(EDIT: I never actually tried the demo before I changed my server settings, I'll try that tomorrow - I'm way too tired)

The log can be found here: http://pastebin.com/uKFwcmj0
(This post was last modified: 2011-04-18 03:43 by Jimcando.)
find quote
t0mm0 Offline
Fan
Posts: 486
Joined: Mar 2011
Reputation: 8
Location: UK
Post: #3
Jimcando Wrote:Thanks for this! Big Grin

I'm getting an error when I run it though Sad
When I first run it, it returns my Music folder correctly, when I try open that music folder, it returns an error.

(EDIT: I never actually tried the demo before I changed my server settings, I'll try that tomorrow - I'm way too tired)

The log can be found here: http://pastebin.com/uKFwcmj0

sorry you're having problems.

when you try it again can you also put http://192.168.1.40:8083/rest/getIndexes...on&v=1.5.0 in a browser an paste the result?

thanks!
find quote
t0mm0 Offline
Fan
Posts: 486
Joined: Mar 2011
Reputation: 8
Location: UK
Post: #4
actually i think i fixed it - i take it you had just one folder in the music folder you were trying to browse?

if that's the case then i just released 0.1.1 to the repo and that should fix the problem.

let me know if it works!

thanks,

t0mm0
find quote
josquin Offline
Junior Member
Posts: 2
Joined: Apr 2011
Reputation: 0
Post: #5
Hi there, and thanks for the job!

I have a strange behavior here, files doesn't play and I sometimes get an error.

Here a re the logs

Code:
10:32:00 T:140206102100032 M:3245395968   DEBUG: StartScript - calling plugin Subsonic('plugin://plugin.audio.subsonic/','0','?mode=play&id=2f6175746f6d6e742f6d757369632f496e636f6d696e672f4d696775656c20456e7269717​5657a202d204772616e64657320457869746f732f3130202d20416272652051756520566f7920284​26f6e757320547261636b292e6d7033')
10:32:00 T:140206102100032 M:3245395968    INFO: initializing python engine.
10:32:00 T:140206102100032 M:3245395968   DEBUG: new python thread created. id=9
10:32:00 T:140206102100032 M:3245395968   DEBUG: WaitOnScriptResult - waiting on the Subsonic plugin...
10:32:00 T:140205578905344 M:3245395968   DEBUG: thread start, auto delete: 0
10:32:00 T:140205578905344 M:3245395968   DEBUG: Python thread: start processing
10:32:00 T:140205578905344 M:3245412352  NOTICE: -->Python Interpreter Initialized<--
10:32:00 T:140205578905344 M:3245412352   DEBUG: Process - The source file to load is /home/alfred/.xbmc/addons/plugin.audio.subsonic/default.py
10:32:00 T:140205578905344 M:3245412352   DEBUG: Process - Setting the Python path to /home/alfred/.xbmc/addons/plugin.audio.subsonic:/home/alfred/.xbmc/addons/script.module.simplejson/lib:/usr/lib/xbmc/addons/script.module.pil/lib:/usr/lib/xbmc/addons/script.module.pysqlite/lib:/usr/lib/xbmc/system/python/python24.zip:/usr/share/xbmc/system/python/lib/python24.zip:/usr/share/xbmc/system/python/lib/python2.4/:/usr/share/xbmc/system/python/lib/python2.4/plat-linux2:/usr/share/xbmc/system/python/lib/python2.4/lib-tk:/usr/share/xbmc/system/python/lib/python2.4/lib-dynload
10:32:00 T:140205578905344 M:3245412352   DEBUG: Process - Entering source directory /home/alfred/.xbmc/addons/plugin.audio.subsonic
10:32:00 T:140206102100032 M:3245182976   DEBUG: WaitOnScriptResult- plugin returned successfully
10:32:00 T:140205578905344 M:3245182976    INFO: Scriptresult: Success
10:32:00 T:140206102100032 M:3245182976   DEBUG: new file set audiostream:0
10:32:00 T:140205578905344 M:3245248512    INFO: Python script stopped
10:32:00 T:140205578905344 M:3245264896   DEBUG: Thread 140205578905344 terminating
10:32:01 T:140206102100032 M:3244765184   DEBUG: CFileCurl::GetMimeType - http://www.foobarjo.org:4040/rest/download.view?p=%3DGeneric&c=xbmc&u=jo&f=json&v=1.5.0&id=2f6175746f6d6e742f6d757369632f496e636f6d696e672f4d696775656c20456e7269717​5657a202d204772616e64657320457869746f732f3130202d20416272652051756520566f7920284​26f6e757320547261636b292e6d7033 -> application/x-download
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerCoreFactory::GetPlayers(http://www.foobarjo.org:4040/rest/download.view?p=%3DGeneric&c=xbmc&u=jo&f=json&v=1.5.0&id=2f6175746f6d6e742f6d757369632f496e636f6d696e672f4d696775656c20456e7269717​5657a202d204772616e64657320457869746f732f3130202d20416272652051756520566f7920284​26f6e757320547261636b292e6d7033)
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: system rules
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: system rules
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtv
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: hdhomerun/myth/rtmp/mms/udp
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: lastfm/shout
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: rtsp
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: streams
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: matches rule: streams
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: flv/aacp/sdp
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: mp2
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvd
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdfile
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: dvdimage
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: sdp/asf
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerSelectionRule::GetPlayers: considering rule: nsv
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerCoreFactory::GetPlayers: matched 0 rules with players
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerCoreFactory::GetPlayers: adding audiodefaultplayer (3)
10:32:01 T:140206102100032 M:3244765184   DEBUG: CPlayerCoreFactory::GetPlayers: for video=0, audio=1
10:32:01 T:140206102100032 M:3244769280   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: PAPlayer (3)
10:32:01 T:140206102100032 M:3244769280   DEBUG: CPlayerCoreFactory::GetPlayers: for video=1, audio=1
10:32:01 T:140206102100032 M:3244769280   DEBUG: CPlayerCoreFactory::GetPlayers: adding player: DVDPlayer (1)
10:32:01 T:140206102100032 M:3244769280   DEBUG: CPlayerCoreFactory::GetPlayers: added 2 players
10:32:01 T:140206102100032 M:3244769280   ERROR: CAudioDecoder: Unable to Init Codec while loading file http://www.foobarjo.org:4040/rest/download.view?p=%3DGeneric&c=xbmc&u=jo&f=json&v=1.5.0&id=2f6175746f6d6e742f6d757369632f496e636f6d696e672f4d696775656c20456e7269717​5657a202d204772616e64657320457869746f732f3130202d20416272652051756520566f7920284​26f6e757320547261636b292e6d7033
10:32:01 T:140206102100032 M:3244769280   DEBUG: CAnnouncementManager - Announcement: PlaybackStopped from xbmc
10:32:01 T:140206102100032 M:3244769280   ERROR: Playlist Player: skipping unplayable item: 1, path [plugin://plugin.audio.subsonic/?mode=play&id=2f6175746f6d6e742f6d757369632f496e636f6d696e672f4d696775656c20456e7269717​5657a202d204772616e64657320457869746f732f3130202d20416272652051756520566f7920284​26f6e757320547261636b292e6d7033]
10:32:01 T:140206102100032 M:3244769280   DEBUG: Playlist Player: no more playable items... aborting playback
10:32:01 T:140206102100032 M:3244769280   DEBUG: python thread 8 destructed
10:32:01 T:140206102100032 M:3244769280   DEBUG: python thread 9 destructed
10:32:01 T:140206102100032 M:3244769280    INFO: CheckIdle - Closing session to http://feeds.feedburner.com (easy=0x3ab6780, multi=0x38cd190)
10:32:01 T:140206102100032 M:3244769280    INFO: CheckIdle - Closing session to http://xoap.weather.com (easy=0x7f842c032fd0, multi=0x7f842c02d130)
10:32:01 T:140206102100032 M:3244769280    INFO: LIRC Initialize: using: /dev/lircd
10:32:01 T:140206102100032 M:3244769280   DEBUG: Failed to connect to LIRC. Retry in 40s.
10:32:09 T:140206102100032 M:3245506560   DEBUG: UPower: Recieved an unkown signal DeviceChanged
10:32:11 T:140206102100032 M:3238744064    INFO: Python, unloading python24.dll because no scripts are running anymore
10:32:11 T:140206102100032 M:3238744064   DEBUG: UnloadExtensionLibs, clearing python extension libraries
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: strop.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: _socket.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: _ssl.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: time.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: math.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: binascii.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: _random.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: fcntl.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: cStringIO.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: collections.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: struct.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: md5.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: sha.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: _bisect.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: datetime.so
10:32:11 T:140206102100032 M:3238711296   DEBUG: Unloading: python24-x86_64-linux.so

Note that the file play fine when downloaded manualy.

Thanks for your help and have a nice day
find quote
t0mm0 Offline
Fan
Posts: 486
Joined: Mar 2011
Reputation: 8
Location: UK
Post: #6
i have noticed that on some installs i have to use 'play using' and select dvd player when the settings are set to not use transcoding.

i have yet to find a way to force the player type while using IsPlayable/setResolvedUrl (http://forum.xbmc.org/showthread.php?tid=99430) but i'm still looking into it.

so there are a couple of workarounds, use the config file as suggested in the above thread (not tried this myself), hit 'play using' and manually select dvd player, or turn on transcoding (if you set the bitrate high then it will only actually transcode if the files bitrate is above the rate you set)

sorry there is no better solution at the moment (if anyone has any ideas please let me know!)

t0mm0.
find quote
t0mm0 Offline
Fan
Posts: 486
Joined: Mar 2011
Reputation: 8
Location: UK
Post: #7
version 0.2.0 is released (including xbox version) see first post for links

this version adds support for playing subsonic playlists, and generating random playlists by range of years and/or genre.

enjoy!
find quote
aaronb Offline
Senior Member
Posts: 202
Joined: Apr 2007
Reputation: 0
Location: Colorado
Post: #8
I'm getting "ERROR: CAudioDecoder: Unable to Init Codec while loading file" unless I tell it to play using DVD player. This is with transcoding turned on. Any ideas? I can post a full log if you need it, I'd have to clean passwords out of it first.
find quote
t0mm0 Offline
Fan
Posts: 486
Joined: Mar 2011
Reputation: 8
Location: UK
Post: #9
aaronb Wrote:I'm getting "ERROR: CAudioDecoder: Unable to Init Codec while loading file" unless I tell it to play using DVD player. This is with transcoding turned on. Any ideas? I can post a full log if you need it, I'd have to clean passwords out of it first.

can you try it with the demo server (server: http://demo.subsonic.org, user: guest2, password: guest)?

that way we can rule out your server config and you won't have to clean passwords if posting logs.

t0mm0
find quote
aaronb Offline
Senior Member
Posts: 202
Joined: Apr 2007
Reputation: 0
Location: Colorado
Post: #10
It worked fine with the demo server. My server config is pretty much the default.

The full error:

Code:
22:19:53 T:7720 M:1814597632   ERROR: CAudioDecoder: Unable to Init Codec while loading file http://192.168.0.10:8082/rest/stream.view?p=password&c=xbmc&maxBitRate=128&u=user&f=json&v=1.5.0&id=483a5c4d757369635c546865205477696c696768742053696e676572735c44796e616d697​4652053746570735c3034202d20476574204c75636b792028416c62756d292e6d7033

If I copy that url into my browser what looks like a flash player comes up, but nothing plays. I can see in the Subsonic log that it's trying to play it.
find quote
Minime1 Offline
Junior Member
Posts: 1
Joined: Apr 2011
Reputation: 0
Smile  Working Fine for me
Post: #11
Hi t0mm0,

Just wanted to say i have installed your plugin in my linux based Dharma edition of xbmc and i have to say i love it so far. Everything is working fine and i really love the feature "create smart playlists". Nice work man. Thank you
find quote
t0mm0 Offline
Fan
Posts: 486
Joined: Mar 2011
Reputation: 8
Location: UK
Post: #12
aaronb Wrote:It worked fine with the demo server. My server config is pretty much the default.

The full error:

Code:
22:19:53 T:7720 M:1814597632   ERROR: CAudioDecoder: Unable to Init Codec while loading file http://192.168.0.10:8082/rest/stream.view?p=password&c=xbmc&maxBitRate=128&u=user&f=json&v=1.5.0&id=483a5c4d757369635c546865205477696c696768742053696e676572735c44796e616d697​4652053746570735c3034202d20476574204c75636b792028416c62756d292e6d7033

If I copy that url into my browser what looks like a flash player comes up, but nothing plays. I can see in the Subsonic log that it's trying to play it.

can you post more of the log?

have you changed the transcode settings on your server at all?
find quote
t0mm0 Offline
Fan
Posts: 486
Joined: Mar 2011
Reputation: 8
Location: UK
Post: #13
Minime1 Wrote:Hi t0mm0,

Just wanted to say i have installed your plugin in my linux based Dharma edition of xbmc and i have to say i love it so far. Everything is working fine and i really love the feature "create smart playlists". Nice work man. Thank you

thanks! glad you like it Wink
find quote
aaronb Offline
Senior Member
Posts: 202
Joined: Apr 2007
Reputation: 0
Location: Colorado
Post: #14
t0mm0 Wrote:can you post more of the log?

have you changed the transcode settings on your server at all?

Sure, here is the entire section of the log from when I enter a directory until it starts giving the error. Let me know if there's a different section you need.

http://pastebin.com/TBzXHY3t

I'm pretty sure I've never changed the transcode settings on the server. Here's a screenshot of my settings:

http://img862.imageshack.us/img862/4012/subsonic.jpg

Also, I've tried this with and without transcoding turned on, and at a couple different bitrates.

Thanks
find quote
t0mm0 Offline
Fan
Posts: 486
Joined: Mar 2011
Reputation: 8
Location: UK
Post: #15
aaronb Wrote:Sure, here is the entire section of the log from when I enter a directory until it starts giving the error. Let me know if there's a different section you need.

sorry to be a pain, but can you turn on debugging in xbmc?

aaronb Wrote:I'm pretty sure I've never changed the transcode settings on the server. Here's a screenshot of my settings:

http://img862.imageshack.us/img862/4012/subsonic.jpg

Also, I've tried this with and without transcoding turned on, and at a couple different bitrates.

looks ok.

couple more questions....
what type of file is the original you are trying to stream (mp3, aac etc.)?
do any files stream?
and have you tried 'play using' and choosing dvd player - does that work?

thanks,

t0mm0
find quote
Post Reply