Kodi Community Forum
Release Artist Slideshow addon (with skin and addon integration) - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: Release Artist Slideshow addon (with skin and addon integration) (/showthread.php?tid=124880)



RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-02

Good night pkscuot,

I love your add-on and wanted to say thank you. I'd like to point out the fact that you have a very well organised and written wiki so users can find their way, most of the time. An example other add-on creators should certainly follow.

Question:

1) If I am listening to a certain album in the background at the same time as I am reviewing the 'info' pane for a different album, the list of similar artists for the latter will be composed of artists only similar to the artist of the album I am listening to in the background. So, for instance, if I am listening to a Tori Amos' album whilst I am looking at the info pane of the album 'Thriller', all the similar artists I get are those related to Tori Amos and not to Michael Jackson, even though I am within Thriller's information pane.

Is this something expected, a known issue of which a fix is on its way, or neither of them?

Best,

CF



RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-04

(2013-08-31, 23:54)RoboHoboMK2 Wrote: I'm trying to get an artist slideshow running in the tab screen (not sure what the proper name is), but I can't get it to work. The slideshow seems to run just fine in the Home Screen, but as soon as I hit tab, it reverts to a static artist image.

cdART is not required to use Artist Slideshow. While AS can use local artwork, it is designed to download and cache artist images from a few online sources. If you haven't yet, take a look at the AS wiki page (link in my signature). Could you post a couple of screenshots of where it works and where it doesn't. I suspect those questions are going to be best asked in the Aeon Nox support thread, but at least I can help you figure out what they're actually called. Wink

(2013-09-02, 23:51)capfuturo Wrote: If I am listening to a certain album in the background at the same time as I am reviewing the 'info' pane for a different album, the list of similar artists for the latter will be composed of artists only similar to the artist of the album I am listening to in the background. So, for instance, if I am listening to a Tori Amos' album whilst I am looking at the info pane of the album 'Thriller', all the similar artists I get are those related to Tori Amos and not to Michael Jackson, even though I am within Thriller's information pane.

Is this something expected, a known issue of which a fix is on its way, or neither of them?

Artist Slideshow only grabs and makes available information for the currently playing artist. So what you are describing is the expected behavior.

The thing to keep in mind is that, technically, Artist Slideshow doesn't display anything. It really just populates some shared variables that skin developers can use to show things however they want. Given your description, I'm pretty sure you aren't using the default Confluence skin (with the modifications). You might check to see if your skin has a support thread and see if the skin developers have any suggestions.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-04

Good night pkscuot,

Thanks very much for the clarification and explanation! My skin is Aeon Nox; Are you aware of any specific thread that might have suggested anything in the past regarding this matter?


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-04

(2013-09-04, 03:23)capfuturo Wrote: Good night pkscuot,

Thanks very much for the clarification and explanation! My skin in Aeon Nox; Are you aware of any specific thread that might have suggested anything in the past regarding this matter?

Not a specific thread, no. I use a modified version of Confluence, so that's all I really test on. You can find the support section for Aeon Nox at:

http://forum.xbmc.org/forumdisplay.php?fid=142


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-04

Thanks again pkscout!

I searched and think I found it right at the end of this post (comments by phil65). Seems 'it is what it is' Nod


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - McMuzz4 - 2013-09-05

(2013-08-06, 22:27)pkscuot Wrote: Thanks for the info. As you saw, the only analysis of the audio stream I do is via either JSON or XBMC function calls. But 1.5.4 does that more frequently than 1.5.2. I was going to point to the JSON calls as a potential culprit, but I changed over to those in 1.5.2 and thus would have expected AS to cause problems earlier if that was really the case.

Anyway, if folks get some logs and post them here, I'd be happy to take a look.

Hi pkscuot,

Thanks for offering your help with this issue, I've just learnt how to enable debug logging and have captured a log for you, so the skipping audio with AS + Spotimc problem can further be investigated (if it even is related to AS at all). I'm not sure if you've read the full discussion on the issue, but the gist is Spoticmc will begin repeatedly pausing and skipping commencing from the second song in any playlist if AS is also enabled, but the first song will always plays fine. If I disable AS no more skipping in Spotimc.

Here are my notes for each notable event that took place and should correspond to the debug log:
1) ~21:13:00 Boot into xbmc (xbmcbuntu) to begin debug log session.
2) ~21:15:15 Begin playing first song in Spotimc
3) ~21:16:15 I press TAB on keyboard to start artist slideshow visualisation
4) ~21:18:00 Artist info and slideshow images begin to populate the screen
5) ~21:19:10 First song ends and next song automatically starts playing.
6) ~21:19:20 Second song begins to repeatedly pause and play for 5 seconds each over and over.
7) ~21:21:00 I stop the song playback here, at which point it had still been repeatedly pausing and playing every 5 or so seconds each.
8) ~21:21:10 I exit out of Spotimc

Hopefully this information proves useful. I love your plugin, so fingers crossed there's its an easy one! I look forward to using the AS plugin again Big Grin and enjoying the recent improvements with the artist information - its looking good.

Here is the link to the debug log:

http://paste.ubuntu.com/6066314/

Thanks again pkscuot!

-Muzza


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-06

Good morning pkscuot,

Three topics I'd like to discuss with you for which I have got a full debug log here:

1) Biography
The AS Wiki says on item 4.1: 'Artist bio and album list come from theaudiodb.com by default and from last.fm if nothing is found on TheAudioDB', however even when the Bios are present in TheAudioDB, they are currently coming from Last.fm and they are being passed to the GUI totally truncated. I have compared the texts present on last.fm and apparently they get truncated right before any url link present on the text. The first bio shown below (B. Marley) is particularly chaotic since it shows random text from 3 different paragraphs present on Last.fm. I have tested it with 4 artists, whose biographies on Last.fm and whatever gets scraped and passed to AS to show on the XBMC GUI, are shown on the links and pictures below, respectively:

Original Bios on Last.fm for each picture shown below:
Bob Marley & The Wailers (1); The Jacksons (2); Marillion (3); Tori Amos (4)

Images from XBMC GUI with truncated Bios:
Image
Now, it is disconcerting to see that the 'bios' presented on the 'Artist Information pane' –which I can tell are from TheAudioDB– are coming perfectly fine and presented with scrolling function to show them in their entirety. So the thing is, why the biography on the previous AS view is coming from Last.fm and not from TheAudioDB, given that the former is obviously truncated and the later present in TheAudioDB and correctly displayed on XBMC? The wiki, and my common sense, say there is a scraping order which I don't see it happening.

Here below you can see the Artists info pane with the Bio in its entirety from TheAudioDB:
The Jacksons (The Jackson 5) Bio on The AudioDB here
Image

2) Artist thumb persistently wrong
The image thumb for the artist 'Bob Marley & The Wailers' is not being shown; instead it shows the image of the last artist played. See image below with 3 different artists (Marillion, Tori Amos and The Jacksons) shown when playing 'Bob Marley' on three different opportunities:
Image
3) Musicbrainz.nfo
I have thousands of albums, each one with its musicbrainz link within an album.nfo placed within the album folder. This is the way I have chosen for getting the right album scraped and all the associated extras such as artist, reviews, styles, moods, etc., specially for album names that have ETIs (extended title information) as suffixes in the album name, e.g. (UK 1978 Special Edition), (France 2003 Maxi-Single), etc..., when I look at the debug log I see some specific lines of code (pasted below) and I get worried because I can't keep creating new NFOs for this and for that, you know what I mean? There are certain standards in XBMC that are desirable to work with and in this sense I'd like to know if there is a way to have AS reading the musicbrainz link (and perhaps some other NFO info) from within the existent album.nfo inside the album folder? Could this be related, to a certain extend, to the issue mentioned on item 2)?
Code in debug log:

Code:
03:24:46 T:4741799936   DEBUG: JSONRPC: Calling player.getitem
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] Looking for a musicbrainz ID for artist Tori Amos feat. Damien Rice
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] Looking for musicbrainz ID in the musicbrainz.nfo file
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] no musicbrainz ID found in musicbrainz.nfo file
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] current artist is Tori Amos feat. Damien Rice with a mbid of
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] looking for local artwork

The full debug log is the result of playing the artists's album in the following order: Tori Amos, Bob Marley, Marillion, Bob Marley, and the Jacksons.

I look forward to hearing from you. Thanks in advance.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-06

(2013-09-06, 09:33)capfuturo Wrote: Three topics I'd like to discuss with you for which I have got a full debug log here:

You've got a number of things here that are sort of interrelated, and at least one that has nothing to do with Artist Slideshow. I'll try and help where I can.

Quote:The AS Wiki says on item 4.1: 'Artist bio and album list come from theaudiodb.com by default and from last.fm if nothing is found on TheAudioDB', however even when the Bios are present in TheAudioDB, they are currently coming from Last.fm and they are being passed to the GUI totally truncated. I have compared the texts present on last.fm and apparently they get truncated right before any url link present on the text.

Last.fm truncates the bio when you request it via their API. I found something that says they will send you the first 300 characters, but I have found sometimes you get more, and sometimes you get less. So it doesn't matter how complete the bio is on the web site, I can only show what Last.fm decides to send. I'll touch on why you're not getting theaudiodb.com bio further down.

Quote:Now, it is disconcerting to see that the 'bios' presented on the 'Artist Information pane' –which I can tell are from TheAudioDB– are coming perfectly fine and presented with scrolling function to show them in their entirety. So the thing is, why the biography on the previous AS view is coming from Last.fm and not from TheAudioDB, given that the former is obviously truncated and the later present in TheAudioDB and correctly displayed on XBMC? The wiki, and my common sense, say there is a scraping order which I don't see it happening.

The bio on the Artist Information page is taken from the XBMC database and is populated based on your scraper. That is completely independent of what Artist Slideshow displays. I may in the future see if I can pull the stored bio and display that. Last time I checked it didn't seem like there was a way to do that.

Quote:2) Artist thumb persistently wrong

Artist Slideshow doesn't have anything to do with the Artist thumbnail. You will have to ask the developer for the skin you are using about that.

Quote:I have thousands of albums, each one with its musicbrainz link within an album.nfo placed within the album folder. This is the way I have chosen for getting the right album scraped and all the associated extras such as artist, reviews, styles, moods, etc., specially for album names that have ETIs (extended title information) as suffixes in the album name, e.g. (UK 1978 Special Edition), (France 2003 Maxi-Single), etc..., when I look at the debug log I see some specific lines of code (pasted below) and I get worried because I can't keep creating new NFOs for this and for that, you know what I mean? There are certain standards in XBMC that are desirable to work with and in this sense I'd like to know if there is a way to have AS reading the musicbrainz link (and perhaps some other NFO info) from within the existent album.nfo inside the album folder? Could this be related, to a certain extend, to the issue mentioned on item 2)?

Not at this time, and possibly never. The MusicBrainz support in AS was a hack when it looked like htbackdrops.com was gone for good and we needed access to other image repositories. Since full support for storing MusicBrainz IDs didn't make it for XBMC 12, I had to resort to caching the MBID locally. I'm hoping XBMC 13 has complete MusicBrainz support in the scappers so that the MBID can be stored in the XBMC database. Then I can retrieve it that way.

Quote:
Code:
03:24:46 T:4741799936   DEBUG: JSONRPC: Calling player.getitem
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] Looking for a musicbrainz ID for artist Tori Amos feat. Damien Rice
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] Looking for musicbrainz ID in the musicbrainz.nfo file
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] no musicbrainz ID found in musicbrainz.nfo file
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] current artist is Tori Amos feat. Damien Rice with a mbid of
03:24:46 T:4741799936   DEBUG: [Artist Slideshow] looking for local artwork

And here may lie a significant part of your challenge. In this particular example, the artist that was passed to AS was "Tori Amos feat. Damien Rice." There is obviously no artist by that name. For multiple artists you either have to name them so that XBMC can parse them (I think the default is artist1 / artist2) or you have to put the featured artist information in the title (i.e. songname (feat. artist2) ). There were simply too many potential ways to split up multiple artists to keep track of, so that's why I went with whatever XBMC passes as the list of artists.

Back to your bio issue. If you are seeing lots of lines that say something like "current artist is [artist name] with a mbid of " and there is nothing after that, then AS could not find a MBID for the given artist. AS looks in MusicBrainz using the following logic:

1- AS asks for a list of artists based on the artist name passed by XBMC
2- AS then asks for a list of all albums for the first artist in the list
3- if AS finds a matching album to the one that is playing, it stops and returns the MBID
4- If not, it goes to the next artist returned from MusicBrainz.
5- If it gets to the end of the artist list from MusicBrainz, it then goes back to the top and asks for a list of all the songs from the first artist in the list.
6- if AS finds a matching song to the one that is playing, it stops and returns the MBID
7- if not, it goes to the next artist

If after all that AS can't find a match, it returns any empty MBID.

I suspect I haven't helped you much, but these are the best answers I can give you.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-06

(2013-09-05, 14:46)McMuzz4 Wrote: Thanks for offering your help with this issue, I've just learnt how to enable debug logging and have captured a log for you, so the skipping audio with AS + Spotimc problem can further be investigated (if it even is related to AS at all). I'm not sure if you've read the full discussion on the issue, but the gist is Spoticmc will begin repeatedly pausing and skipping commencing from the second song in any playlist if AS is also enabled, but the first song will always plays fine. If I disable AS no more skipping in Spotimc.

Here are my notes for each notable event that took place and should correspond to the debug log:
1) ~21:13:00 Boot into xbmc (xbmcbuntu) to begin debug log session.
2) ~21:15:15 Begin playing first song in Spotimc
3) ~21:16:15 I press TAB on keyboard to start artist slideshow visualisation
4) ~21:18:00 Artist info and slideshow images begin to populate the screen
5) ~21:19:10 First song ends and next song automatically starts playing.
6) ~21:19:20 Second song begins to repeatedly pause and play for 5 seconds each over and over.
7) ~21:21:00 I stop the song playback here, at which point it had still been repeatedly pausing and playing every 5 or so seconds each.
8) ~21:21:10 I exit out of Spotimc

I think this is going to be my day of offering nothing helpful. Sad

I looked through the debug log, and whatever issue is causing the playback to hickup is keeping AS from even logging anything that it is doing (which leads me to believe it isn't able to do anything). I do see a JSON call where AS is asking for the artist and MusicBrainz ID of the currently playing artist, but after that nothing until the next JSON request. I can tell that's the AS JSON request because of the data it asks for. So the only thing I can figure is that for some reason making the JSON request of XBMC somehow disrupts the Spotify stream in a way that causes the pausing. I can only assume it is not happening on the first song because the stream got started before AS was invoked. I guess on the second song there is some contention between the JSON call for the currently playing information and something else.

The bottom line here is that there likely isn't anything I can do to fix this, as the JSON call is absolutely critical to how AS functions.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-06

Good night pkscuot,

No worries! We love you anyway!

I will read an digest your answers. I am sure I can get more help out from them than it seems. I hope you don't mind if I get back to you with more questions.

In the meantime, there is one thing I have yet to understand: why AS is not pulling the bio from TheAudioDB before trying Last.fm?

Thank you!


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-07

(2013-09-06, 23:49)capfuturo Wrote: In the meantime, there is one thing I have yet to understand: why AS is not pulling the bio from TheAudioDB before trying Last.fm?

It does try to pull from theaudiodb.com first. But that requires having the MusicBrainz ID. So if for some reason AS can't determine the MusicBrainz ID of the playing artist, it has to fall back to last.fm.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - capfuturo - 2013-09-07

Hi pqscuot,

Thanks for your reply!

Ok, I can see what you mean looking at the extract below (lines 434 to 447) from the debug log I submitted earlier.

We have here a very well known artist whose MBID can be found just by looking for the name 'Tori Amos' on Musicbrainz. You mentioned earlier that "AS looks in MusicBrainz using the following logic:

"1- AS asks for a list of artists based on the artist name passed by XBMC"

The script below says AS is firstly looking for the musicbrainz ID for the name 'Tori Amos' and seems there is nothing returned (although it doesn't say so), so then it goes looking into musicbrainz.nfo, right? (which is non existent in my folders) Then at then end, AS retrieves the truncated Bio from Last.fm by simply submitting the name of 'Tori Amos' (no ID needed) via ws.audioscrobbler.com

Correct me if I am missing something I am not aware of yet: The artist name is correctly being passed to AS by XBMC, then how come a simple query for 'Tori Amos' would not retrieve the MBID? Do you see there is something out of place here?Furthermore, I get no return of MBIDs for any of the individual artists on my library using AS, being everything diverted via Last.fm. As a last resource, as you mentioned on item 6: "if AS finds a matching song to the one that is playing, it stops and returns the MBID", not even that is happening and perhaps it should since all my songs are tagged with MB Picard.

Is there a way to double-check that the API call for the artist's MBID on Musicbrainz is actually taking place?

Code:
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] Looking for a musicbrainz ID for artist Tori Amos
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] Looking for musicbrainz ID in the musicbrainz.nfo file
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] no musicbrainz ID found in musicbrainz.nfo file
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] current artist is Tori Amos with a mbid of
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] looking for local artwork
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] cachedir = /Volumes/HD02-4TB Hitachi12.2012/Pictures/XBMC Extra Artwork/Local Artists/Tori Amos/extrafanart
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] start download
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] cachedir = /Users/futuro/Library/Application Support/XBMC/userdata/addon_data/script.artistslideshow/ArtistSlideshow/7b0c89ee/
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] cached images found
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] checking for local artist bio data
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] checking filename /Volumes/HD02-4TB Hitachi12.2012/Pictures/XBMC Extra Artwork/Local Artists/Tori Amos/override/artistbio.nfo
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] invalid or missing local xml file for bio
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] [Errno 2] No such file or directory: u'/Volumes/HD02-4TB Hitachi12.2012/Pictures/XBMC Extra Artwork/Local Artists/Tori Amos/override/artistbio.nfo'
03:24:36 T:4741799936   DEBUG: [Artist Slideshow] trying to get artist bio from http://ws.audioscrobbler.com/2.0/?autocorrect=1&api_key=afe7e856e4f4089fc90f841980ea1ada&method=artist.getInfo&artist=Tori+Amos

<<UPDATE>>: Eureka pkscuot! I think I found the problem... I unselected "Use override slideshow" under Settings and also deleted the whole folder 'artistSlideshow' within 'script.artistslideshow' in 'add-on_data', then restarted XBMC, played a song and voila! TheAudioDB Bio for Tori Amos started to scroll on the screen. I will run some tests tomorrow to see if same behaviour extends to the rest of the artists and albums.

Now, can you explain to me what was happening? :-)
Image


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - scott967 - 2013-09-07

(2013-09-06, 23:32)pkscuot Wrote: The bio on the Artist Information page is taken from the XBMC database and is populated based on your scraper. That is completely independent of what Artist Slideshow displays. I may in the future see if I can pull the stored bio and display that. Last time I checked it didn't seem like there was a way to do that.

Funny thing is what I would like is to take the AS lastfmbio data and push it into the database!

scott s.
.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - pkscout - 2013-09-09

(2013-09-07, 04:48)capfuturo Wrote: <<UPDATE>>: Eureka pkscuot! I think I found the problem... I unselected "Use override slideshow" under Settings and also deleted the whole folder 'artistSlideshow' within 'script.artistslideshow' in 'add-on_data', then restarted XBMC, played a song and voila! TheAudioDB Bio for Tori Amos started to scroll on the screen. I will run some tests tomorrow to see if same behaviour extends to the rest of the artists and albums.

Now, can you explain to me what was happening? :-)

Um, not really. Big Grin

In theory the override slideshow option shouldn't keep the bio from showing correctly, and I just checked the code to make sure. By deleting the addon_data folder for AS, you mostly reset it to factory default. AS is complicated enough now that it is possible that some set of settings are somehow conflicting, or that the upgrade from 1.5.3 to 1.5.4 just didn't go well for you.

Anyway, I'm glad stuff is working for you.

BTW, the actual order of searching for the MBID is:

1- ask XBMC
2- check for the .nfo file
3- ask MusicBrainz (via the logic I provided before)

That way once an artist MBID has been found and cached, AS doesn't have to ever ask for it again. If AS doesn't find one, after a couple of weeks it will try again. Retrying every time slows things down and is hard on the MusicBrainz server.


RE: [RELEASE] Artist Slideshow 1.3.0 addon (with skin and addon integration) - McMuzz4 - 2013-09-10

(2013-09-06, 23:42)pkscuot Wrote:
(2013-09-05, 14:46)McMuzz4 Wrote: Thanks for offering your help with this issue, I've just learnt how to enable debug logging and have captured a log for you, so the skipping audio with AS + Spotimc problem can further be investigated (if it even is related to AS at all). I'm not sure if you've read the full discussion on the issue, but the gist is Spoticmc will begin repeatedly pausing and skipping commencing from the second song in any playlist if AS is also enabled, but the first song will always plays fine. If I disable AS no more skipping in Spotimc.

Here are my notes for each notable event that took place and should correspond to the debug log:
1) ~21:13:00 Boot into xbmc (xbmcbuntu) to begin debug log session.
2) ~21:15:15 Begin playing first song in Spotimc
3) ~21:16:15 I press TAB on keyboard to start artist slideshow visualisation
4) ~21:18:00 Artist info and slideshow images begin to populate the screen
5) ~21:19:10 First song ends and next song automatically starts playing.
6) ~21:19:20 Second song begins to repeatedly pause and play for 5 seconds each over and over.
7) ~21:21:00 I stop the song playback here, at which point it had still been repeatedly pausing and playing every 5 or so seconds each.
8) ~21:21:10 I exit out of Spotimc

I think this is going to be my day of offering nothing helpful. Sad

I looked through the debug log, and whatever issue is causing the playback to hickup is keeping AS from even logging anything that it is doing (which leads me to believe it isn't able to do anything). I do see a JSON call where AS is asking for the artist and MusicBrainz ID of the currently playing artist, but after that nothing until the next JSON request. I can tell that's the AS JSON request because of the data it asks for. So the only thing I can figure is that for some reason making the JSON request of XBMC somehow disrupts the Spotify stream in a way that causes the pausing. I can only assume it is not happening on the first song because the stream got started before AS was invoked. I guess on the second song there is some contention between the JSON call for the currently playing information and something else.

The bottom line here is that there likely isn't anything I can do to fix this, as the JSON call is absolutely critical to how AS functions.


Hi pkscuot,

Your statement is very untrue - your information was actually very, very helpful and drove me find motivation to explore to discover a solution and create a patch!! Big Grin

tl;dr: For some reason Spotimc doesn't like the many repeated JSON requests to the API (though i'm not sure why it only stutters beginning from playback of the second song) - I've posted my solution below.

long version:
After studying the debug log I determined that the pausing occurs exactly when the info is logged "CSoftAEStream::GetFrame - Underrun". Each time this occurred was shortly after a JSON query from artist slideshow that you mentioned. After a bit of googling i discovered that audio stutting + JSON queries could be related to a possible bug with Linux and AudioEngine: http://forum.xbmc.org/showthread.php?tid=147822 where large amounts of JSON queries cause stuttering. I'm still at a loss why the stuttering occurs only after the first song finishes - but anyway..

So I perform some testing:

My first test was I edited the Artist Slideshow python script to allow the first song play through then sleep the artist slideshow script when the second song starts for 10 to 40 seconds, just before the JSON request. This didn't result in anything positive it began stuttering/skipping when AS script finished sleeping.

My second test was to detect if a Spotify stream is playing and pause every second before the JSON query. This resulted in a little less stuttering, so i continued to adjusting until i found a sweet spot at 10 seconds to stop the songs stuttering/skipping. But this was frustrating because while it solved the problem it prevented AS from functioning nice and quickly and took a very long time for artist information to populate, sometimes not until a few songs of playback.

My third test which I have put below is my solution - it will detect if a new song is playing that is a Spotify stream, and if so it will perform the JSON call once and store the response value in a variable. It will then use the stored JSON response to query artist information and not won't call the JSON API again until a different song starts playing

My patch consists of the following, I made changes to two functions:

(btw I'm sure it could be done better I've never used python before - also sorry but I've never contributed to code before so apologies if I should be doing this differently)

At the end of def _init_vars( self ): I put the following lines:
Code:
    self.playing_file_last_value = -1
    self.response_last_value = ""

And I modified the first couple dozen lines of def _get_current_artists_info( self, type ):
Code:
def _get_current_artists_info( self, type ):
        featured_artists = ''
        artist_names = []
        artists_info = []
        mbids = []
        if( xbmc.Player().isPlayingAudio() == True ):
            # Grab currently playing music file and check if it is a Spotimc stream
            playing_file = xbmc.Player().getPlayingFile()
            if "X-Spotify-Token" in playing_file:
                # Check if a new track is playing by comparing the current song file name to the last playing song file name
                if playing_file != self.playing_file_last_value:
                    # wait 1 seconds for audio stream to begin
                    time.sleep(1)
                    log ( "Spotimc Detected: Limiting JSON calls to occur once per song to prevent audio stuttering/skipping" )
                    log ( "Playlist Position: %d " %(xbmc.PlayList(0).getposition()) )
                    # Perform JSON call
                    response = xbmc.executeJSONRPC ( '{"jsonrpc":"2.0", "method":"Player.GetItem", "params":{"playerid":0, "properties":["artist", "musicbrainzartistid"]},"id":1}' )
                    # store JSON response for continued usage
                    self.response_last_value = response
                    log ( "JSON response: " + response )
                    self.playing_file_last_value = playing_file
                # If still playing the same track, use the stored JSON response
                else:
                    response = self.response_last_value
            # If Spotimc not in use, normal operation
            else:    
                response = xbmc.executeJSONRPC ( '{"jsonrpc":"2.0", "method":"Player.GetItem", "params":{"playerid":0, "properties":["artist", "musicbrainzartistid"]},"id":1}' )
            try:
...