h3x.se spotify remote

24Jan/11Off

Servify, ReSpot, jReSpot updates!

Servify
Big update!
The OpenAL audio backend is implemented and tested on all platforms.
This means one and the same audio backend is used on all platforms (Windows, OS X, Linux) and more importantly it is (hopefully) a more stable solution. Particularly on Linux and OS X platforms.
The downside is that another external dependency may have to be installed.
For Windows and OS X, go here: http://connect.creativelabs.com/openal/Downloads/Forms/AllItems.aspx
For Linux (Ubuntu!) you install the following package: libopenal1

ReSpot
Small bugfixes, incremental improvements. Expect more rapid development here soon.

jReSpot
Small features implemented:
+"DEL" key to remove from queue
+Shuffle
+Repeat

Please report any new issues, regressions, bugs etc ASAP! (as comment to this post or email)

Filed under: ReSpot, servify Comments Off
Comments (57) Trackbacks (0)
  1. Hi Johannes,

    Have everything updated and installed OpenAL, got it all working. One thing i noticed is that the progress bar and time is not updated any more. The play/stop etc buttons are working but the time/bar stays “dead”

    Good to have you back working on ReSpot :).

  2. Xander,

    great! I will have a look at the progress bar not updating, thanks!

  3. Installed it on my Fedora 14 MythTV HTPC box and things are working very well indeed. I get some complaints on jack at startup, from OpenAL I suppose, but things work anyhow so I didn’t investigate further.

    I’m using the Archos 101 tablet for ReSpot. It works very well. However I would like some automatic connect and reconnect facility. Sometimes it will loose the connection to the server and I will have to quit and start ReSpot to get it up and running again. I believe that the wireless connection on the Archos may be a bit flakey. But I suppose there are other cases when the connection may be dropped and it would be nice if it would connect again seamless. As well as trying to connect directly at startup,

    Thank you! At last I have a working HTPC spotify solution that don’t require fetching the keyboard.

  4. Bengt,

    good that it works on Fedora too!
    I will have a look at the disconnects and try to add some automatic reconnect (or some other means of reconnecting without quitting the app, it’s annoying – happens to me a lot because the custom ROM i got basically shuts off WiFi whenever phone goes to sleep mode..!)

  5. Sounds great Johannes. Looking forward to the next release :)

    It looks like you’ve done some refactoring of ReSpot by looking at the video. Today was my first time testing it.

    By looking at your ubuntu-instructions I’m guessing the prerequisite-line should look something like this for fedora:
    yum install mono-wcf mono-data openal-soft
    (I already had those packages installed so I’m not sure.)

    Thanks again.

  6. I’m not sure if this update of respot is to blame about not showing offline playlists’ name and total track count?

  7. Ville, it should show the names of offline playlists too.. Maybe it’s a temporary glitch or can you reproduce this every time?

  8. I got it working by reinstalling respot. Though it still give this occasionally:
    RandomNumber: 419
    Could not execute command:

    “System.NullReferenceException: object reference not set to an instance of an object
    kohteessa Servify.Command.ArtworkRequestCommand.ImageIdForSpotifyUri(St
    potifyUri)
    kohteessa Servify.Command.ArtworkRequestCommand.RequestImageForSpotifyU
    ing spotifyUri)
    kohteessa Servify.Command.ArtworkRequestCommand.ExecuteCommand()
    kohteessa Servify.Command.JsonCommand.Execute()
    kohteessa Servify.ClientConnection.OnPayloadComplete(StateObject state)”
    kohteessa = at
    That error above doesn’t come very often.
    Well atleast now it works again most of the time

  9. Hi
    I just installed Servify on a clean Windows XP but a got an error when a try to start Servify:
    “The application filed to initialized properly (0x0000135). Click to terminate the application.”
    I have installed OpenAL.

  10. I will definitely look into this as soon as i have a chance!

  11. Please provide the log from the Servify window – that way i can (hopefully )look at the actual error, thanks.

  12. I don´t get so far. I got the errormessage before the Servify window even start.
    Just a silly question: In the “OpenTK.dll.config” shouldn´t there be anything about Windows?

  13. In that case, use the “command prompt” to start servify – that way you will get the servify log “printed”.

    OpenTK.dll.config is not really needed at all on windows, the file is there to “translate” the windows shared library names to OS X and Linux names.

  14. I also get the System.NullReferenceException error.
    Except that unfortunately I get the error continuously. I can’t play any song using Servify anymore.
    (win7)

    Below a copy of the Servify window:

    Settings path: C:\Users\Koen en Bregje\AppData\Roaming\libspotify-settings
    Libspotify log: 08:37:30.429 I [ap:1368] Connecting to AP A3.spotify.com:4070
    Waiting for broadcast
    Login result from spotify: OK
    Client connected to server.
    Could not execute command:
    System.NullReferenceException: De objectverwijzing is niet op een exemplaar van
    een object ingesteld.
    bij Spotify.Session.PlayerLoad(Track track)
    bij Servify.Command.TogglePauseCommand.ExecuteCommand()
    bij Servify.Command.JsonCommand.Execute()
    bij Servify.ClientConnection.OnPayloadComplete(StateObject state)

    Exception caught in OnPayloadComplete
    Exception Type : System.NullReferenceException
    Exception Message: De objectverwijzing is niet op een exemplaar van een object i
    ngesteld.
    Exception Stack : bij Spotify.Session.PlayerLoad(Track track)
    bij Servify.Command.TogglePauseCommand.ExecuteCommand()
    bij Servify.Command.JsonCommand.Execute()
    bij Servify.ClientConnection.OnPayloadComplete(StateObject state)

    Could not execute command:
    System.NullReferenceException: De objectverwijzing is niet op een exemplaar van
    een object ingesteld.
    bij Spotify.Session.PlayerLoad(Track track)
    bij Servify.Command.TogglePauseCommand.ExecuteCommand()
    bij Servify.Command.JsonCommand.Execute()
    bij Servify.ClientConnection.OnPayloadComplete(StateObject state)

    Exception caught in OnPayloadComplete
    Exception Type : System.NullReferenceException
    Exception Message: De objectverwijzing is niet op een exemplaar van een object i
    ngesteld.
    Exception Stack : bij Spotify.Session.PlayerLoad(Track track)
    bij Servify.Command.TogglePauseCommand.ExecuteCommand()
    bij Servify.Command.JsonCommand.Execute()
    bij Servify.ClientConnection.OnPayloadComplete(StateObject state)

    Libspotify log: 14:07:47.427 E [metadata.cpp:1455] Unable to save file: metadata
    .bnk

  15. I will have a look at this tonight or tomorrow, hopefully it’s something easily fixed!
    Thanks for the log output!

  16. thanks johannes!

  17. Got an extra one…

    Client connected to server.
    Libspotify log: 14:34:16.335 E [ap:3376] ChannelError(6, 1, playlist)
    Libspotify log: 14:34:16.551 E [ap:3376] ChannelError(16, 1, playlist)
    Libspotify log: 14:34:16.551 E [ap:3376] ChannelError(4, 1, playlist)
    Libspotify log: 14:34:16.551 E [ap:3376] ChannelError(9, 1, playlist)
    Libspotify log: 14:34:17.138 E [ap:3376] ChannelError(35, 1, playlist)
    Libspotify log: 14:34:17.886 E [ap:3376] ChannelError(21, 1, playlist)
    Libspotify log: 14:34:23.300 E [ap:3376] ChannelError(0, 1, playlist)
    Libspotify log: 14:34:23.475 E [ap:3376] ChannelError(0, 1, playlist)
    Could not execute command:
    System.NullReferenceException: De objectverwijzing is niet op een exemplaar van
    een object ingesteld.
    bij Spotify.Session.PlayerLoad(Track track)
    bij Servify.Command.TogglePauseCommand.ExecuteCommand()
    bij Servify.Command.JsonCommand.Execute()
    bij Servify.ClientConnection.OnPayloadComplete(StateObject state)

  18. If I start from commad prompt, I still get the same error befor the Servify window is opened.

    Do I need anything like .NET or Visual C++ paks installed on my Windows?
    I just tryed my old harddisk, on the same computer, and it works. But on my new HD with a clean Windows XP installed Servify crashes.

  19. Yes, you do need .NET, visual c++ should not be needed afaik. I guess .NET isnt installed by default on XP.

  20. Hi
    .NET 3.5 solve the startup issue, not .NET 4.
    But when I login with my HTC Servify crashes:

    Microsoft Windows XP [Version 5.1.2600]

    C:\Program Files\servify>servify

    Servify/C# v2011.01.23

    Username: —-
    Password: ******
    Use defaults? [Y/n]: y

    Servify Server listening on port: ‘1337’
    Servify Server IP Address 0: 192.168.7.111

    Logging on to Spotify servers…
    Cache path: C:\Documents and Settings\haav\Application Data\libspotify-cache
    Settings path: C:\Documents and Settings\haav\Application Data\libspotify-sett
    ings
    Libspotify log: 12:36:38.450 I [ap:1368] Connecting to AP A1.spotify.com:4070
    Waiting for broadcast
    Login result from spotify: OK
    Client connected to server.

    Unhandled Exception: System.MissingMethodException: Method not found: ‘Boolean S
    ystem.Runtime.Serialization.DataContractAttribute.get_IsReference()’.
    at Newtonsoft.Json.Serialization.DefaultContractResolver.InitializeContract(J
    sonContract contract)
    at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract
    (Type objectType)
    at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type
    objectType)
    at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type
    type)
    at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Ob
    ject value)
    at Newtonsoft.Json.JsonConvert.SerializeObject(Object value, Formatting forma
    tting, JsonSerializerSettings settings)
    at Newtonsoft.Json.JsonConvert.SerializeObject(Object value)
    at Servify.MessageBundle..ctor(Message message)
    at Servify.ServifyServer.BroadCast(Message message)
    at Servify.ServifyServer.OnIncomingConnection(IAsyncResult ar)
    at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
    at System.Net.ContextAwareResult.CompleteCallback(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
    ontextCallback callback, Object state)
    at System.Net.ContextAwareResult.Complete(IntPtr userToken)
    at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr u
    serToken)
    at System.Net.Sockets.Socket.AcceptCallback(Object nullState)
    at System.Net.Sockets.Socket.RegisteredWaitCallback(Object state, Boolean tim
    edOut)
    at System.Threading._ThreadPoolWaitOrTimerCallback.PerformWaitOrTimerCallback
    (Object state, Boolean timedOut)

    C:\Program Files\servify>

  21. Hi Johannes,
    No matter what `i try can’t get it to work…
    Chgecked the faq…tried what was said there, installed openAL, Mono, Respot….always the same message: “Could not connect to Servify i/o exception – chosen connection may be unavailable”
    Firewall is off.
    Please help…
    Greets Zlatko

    Mini:servify user$ mono servify.exe

    Servify/C# v2011.01.23

    Username:
    Password: *********
    Use defaults? [Y/n]: n
    ListenPort: 1500
    Bitrate [160 / 320]: 320

    Servify Server listening on port: ‘1500’
    Servify Server IP Address 0: 192.168.1.111

    Logging on to Spotify servers…
    Cache path: /Users/user/.config/libspotify-cache
    Settings path: /Users/user/.config/libspotify-settings
    dyld: lazy symbol binding failed: Symbol not found: ___bzero
    Referenced from: /servify/libspotify
    Expected in: /usr/lib/libSystem.B.dylib

    dyld: Symbol not found: ___bzero
    Referenced from: /servify/libspotify
    Expected in: /usr/lib/libSystem.B.dylib

    Trace/BPT trap
    Mini:servify user$

  22. Zlatko, it seems like you are using OS X? Which version is it that you are using? Certain versions have proven incompatible with Servify / libspotify.

  23. Haav: Have you installed .NET 3.5 with all the service packs? (At least SP1?)

  24. Yes! After alots of Windows updates and equal amount of restarts can I start and login to Servify.

    But I quit often get:
    Libspotify log: 09:46:32.485 E [metadata.cpp:1455] Unable to save file: metadata.bnk
    Do you know why?

  25. I randomly get a message from Windows like: “Windows has discover an error. Will you send an errorreport to Windows?”
    And when I click “Don´t send” I get following in Servify:
    Unhandled Exception: System.Net.Sockets.SocketException: An existing connection
    was forcibly closed by the remote host
    at System.Net.Sockets.Socket.EndAccept(Byte[]& buffer, Int32& bytesTransferre
    d, IAsyncResult asyncResult)
    at System.Net.Sockets.Socket.EndAccept(IAsyncResult asyncResult)
    at Servify.ServifyServer.OnIncomingConnection(IAsyncResult ar)
    at System.Net.LazyAsyncResult.Complete(IntPtr userToken)
    at System.Net.ContextAwareResult.CompleteCallback(Object state)
    at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, C
    ontextCallback callback, Object state)
    at System.Net.ContextAwareResult.Complete(IntPtr userToken)
    at System.Net.LazyAsyncResult.ProtectedInvokeCallback(Object result, IntPtr u
    serToken)
    at System.Net.Sockets.BaseOverlappedAsyncResult.CompletionPortCallback(UInt32 errorCode, UInt32 numBytes, NativeOverlapped* nativeOverlapped)
    at System.Threading._IOCompletionCallback.PerformIOCompletionCallback(UInt32errorCode, UInt32 numBytes, NativeOverlapped* pOVERLAP)

    Servify continue to play until I click “Don´t send”.

  26. Another question:
    I don´t have any “libspotify-settings” directory. I do have “libspotify-cache”.
    Cache path: C:\Documents and Settings\Henrik\Application Data\libspotify-cache
    Settings path: C:\Documents and Settings\haav\Application Data\libspotify-settings
    Shall I create one?

  27. Great!
    The metadata.bnk error is coming from within Libspotify. I dont really know what it means tbh, but there doesn’t seem to be any adverse effects from it :)

  28. Thanks, i will try to supress this / deal with it in a cleaner way. Seems as if whenever ReSpot disconnects from Servify on windows – this exception is raised. Does not happen on linux, so there seems to be some difference in how mono/.net treats this.

  29. Don’t think you have to if libspotify has not done it itself.

  30. Errors like:
    Libspotify log: 09:46:32.485 E [metadata.cpp:1455] Unable to save file: metadata.bnk
    disapeared when I created the “libspotify-settings” directory.

  31. Hi Johannes,
    Thanks for your quick reply. I am using OSX 10.5.8.

  32. Thanks haav for the feedback!

  33. Zlatko, in that case i think Servify *should* work for you.. Other users have reported the same/similar issue – but i think those were using Tiger. As i am not a MAC owner i dont have a good way of debugging this issue. However it seems that some required library is either broken or non-existant.
    Maybe a Mac forum could provide more insights to this?

  34. Hi Johannes.
    I will format it and install a fresh Snow Leopard on it and see if it works. Will let you know. Thanks anyhow.

  35. I really hope that works then! :)

  36. Sometimes when I try to browse artist I don´t get an answer and error in the Servify windows instead:
    Could not execute command:
    System.IndexOutOfRangeException: Index was outside the bounds of the array.
    at Servify.Command.BrowseArtistCommand.ExecuteCommand()
    at Servify.Command.JsonCommand.Execute()
    at Servify.ClientConnection.OnPayloadComplete(StateObject state)

    Exception caught in OnPayloadComplete
    Exception Type : System.IndexOutOfRangeException
    Exception Message: Index was outside the bounds of the array.
    Exception Stack : at Servify.Command.BrowseArtistCommand.ExecuteCommand()
    at Servify.Command.JsonCommand.Execute()
    at Servify.ClientConnection.OnPayloadComplete(StateObject state)

  37. and for Browse album sometimes aswell:
    Could not execute command:
    System.NullReferenceException: Object reference not set to an instance of an obj
    ect.
    at Spotify.Session.BrowseAlbum(Album album, Object state)
    at Servify.Command.BrowseAlbumCommand.ExecuteCommand()
    at Servify.Command.JsonCommand.Execute()
    at Servify.ClientConnection.OnPayloadComplete(StateObject state)

    Exception caught in OnPayloadComplete
    Exception Type : System.NullReferenceException
    Exception Message: Object reference not set to an instance of an object.
    Exception Stack : at Spotify.Session.BrowseAlbum(Album album, Object state)
    at Servify.Command.BrowseAlbumCommand.ExecuteCommand()
    at Servify.Command.JsonCommand.Execute()
    at Servify.ClientConnection.OnPayloadComplete(StateObject state)

  38. Thanks haav, i will follow up on these!

  39. With this version i’m always having a i/o exception on the phone when reconnecting to the server, which results in the server also crashing.
    So… autostart batchfile on htpc, connect to it with phone and start a playlist.
    Back out of app on phone, start app again on phone and click connect results in “…i/o exception connection may not be available…” and then the server crashes.
    HTC Desire and WindowsXP

  40. Crashiola: Looking into it, have fixed one issue which (may) fix this too. Have not been able to reproduce your error though.

  41. I am trying te make Servify work on my HTPC. It is a Ubuntu minimal machine, running just XBMC and a few webfrontends. Servify seems te be running perfectly, ReSpot can connect with it and when i play some music it seems to work. But I don’t get any sound.

    I tried everything in the FAQ (installed the full pulseaudio package), but to no avail.

  42. Jan: Weird, I’ve had another user report a similar issue – do you have multiple soundcards or something like that? Im assuming music works fine from the other apps?

  43. @johannes: No. Not multiple soundcards. But come to think of it, it has multiple sound outputs! It’s an Asrock ION 330. So it has a standard analog, coaxial and an optical output. My gues right now is that is pushing the sound over the analog output.

  44. @johannes Hmmm. I think I have found it. If i use “aplay -l” it lists each output as a seperate card. The first being the analog output. (2nd digital, and 3th HDMI).

    If i run “pacmd list-sinks” it lists the pulseaudio sinks. And indeaad. There is only one sink called “alsa_output.pci-0000_00_08.0.analog-stereo”.

    I used this http://vaioubuntu.wordpress.com/2009/07/08/hdmi-sound-output-switcher-for-pulseaudio/ to add the sinks of all the outputs to the default.pa file.

    Then i tried switching the default sink with “pacmd” and i got the error that pulseaudio isn’t running. But that could be because im doing this over SSH (dbus is picky that way). I’ll try and fix it when I get home this evening and post an update. ;).

  45. Hey, there seems to be a slight memory leak when you search for a track / artist that doesn’t exist.

    Once you’ve done that 2 or 3 times, a reboot is required.

  46. ibwan, will definately have a look! thx

  47. Jan, sorry, didnt see this comment! Did you get it to work finally?
    Could be that i need to tweak the OpenAL code otherwise.. Let me know.

  48. Hi,

    There are still some bugs:
    – when you queue a song, it gets added to the bottom of the playqueue instead of at the top
    – mass dequeueing doesn’t work properly (jrespot-issue)
    – errors when doing a search (“waiting a bit more”-error, or something like that)
    – errors when doing an artist search:
    Libspotify log: 09:08:45.099 E [ap:3376] ChannelError(0, 1, playlist)
    Search Complete
    Libspotify log: 09:09:05.320 E [ap:3376] ChannelError(0, 1, playlist)
    ArtistBrowseComplete!
    Libspotify log: 09:09:40.710 E [ap:3376] ChannelError(0, 1, playlist)
    etc. etc., jReSpot not doing or showing anything

    Also a feature request: last.fm scrobbling :)

  49. Ruud, thanks for your comment (and list of issues).

    I’ve to resume coding on ReSpot / Servify. Have not had much time lately. Will have a look at these and add Last.FM scrobbling if i find an appropriate API.

    Thanks again.

  50. Hi Johannes! Thanks for the great work here with this so far…

    I had servify working on my linux box a few months ago but didn’t use it for a while. Now I am on ubuntu 10.10 and it’s broken. I have updated to the latest servify binaries and played around with other stuff. I can now connect to servify via jrespot etc but can’t get it to display artwork or play any music. The errors in the logs are always:

    Exception caught in OnPayloadComplete
    Exception Type : System.NullReferenceException
    Exception Message: Object reference not set to an instance of an object
    Exception Stack : at Servify.Command.ArtworkRequestCommand.ImageIdForSpotifyUri (System.String spotifyUri)
    [0x00000] in :0
    at Servify.Command.ArtworkRequestCommand.RequestImageForSpotifyUri (System.String spotifyUri) [0x00000] in :0
    at Servify.Command.ArtworkRequestCommand.ExecuteCommand () [0x00000] in :0
    at Servify.Command.JsonCommand.Execute () [0x00000] in :0
    at Servify.ClientConnection.OnPayloadComplete (Servify.StateObject state) [0x00000] in :0

    Thanks again!

    A.


Trackbacks are disabled.