"Music Party Mode", Jukebox feature!

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
kraqh3d Offline
Retired Developer
Posts: 7,172
Joined: Dec 2003
Reputation: 4
Location: New York City, USA
Post: #1
i added initial support for music party mode. it requires a music database. enable it from the "party mode" button found in the library window.

it's integrated into the music now playing window. when party mode is enabled, the shuffle, random, and repeat buttons in the now playing window are disabled.

when enabled, xbmc will ensure the now playing window has at least 10 songs in the playlist at all times, by randomly picking songs out of the database. the currently playing song is always at the top of the list. when its finished, its removed from the list, a new song is added, and the top song plays.

from within the now playing window, you can select another song thats already in the queue. this song will start playing and get moved to the top of the list. the previously playing song will be removed.

from the files and library window, you can select/play a song and it will become the currnetly playing song. (autoplay next item is effectively disabled while party mode is enabled.)
play on a folder or playlist is currently ignored during party mode. queue, however, works as normal. the items are added to the end of the playlist.

if something switches or clears the playlist, party mode is disabled. examples: you start a movie, you initiate playback from the web interface, from an http api command, from the internal command, or from python.

there are going to be bugs! there's alot of interaction with other parts of xbmc which i likely missed. start posting the bugs here. please do not post feature requests yet. the system needs to be stabalised first.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
ceomr Offline
Member
Posts: 75
Joined: Mar 2004
Reputation: 0
Post: #2
great new feature..

a few things to consider:

i think the playlist "now playing window" should be opened after party mode is enabled

a party mode button should be added to mymusicsongs window

@ bugs.. disable party mode...

so far cheers ceomr
find quote
Loto_Bak Offline
Fan
Posts: 475
Joined: Sep 2004
Reputation: 0
Post: #3
comoer : mymusicsongs is the file view. as stated party mode uses the database hense only in mymusicnav.

ahhh very nice work kraq.

ive had a couple hard lockups when i first tried it. i have a log of only the 2nd one. i 'selected' a song from the library with party mode on. i then entered the playlist window and watch the song roll over to the next... until it locked hard just as was changing.
the files involved playback fine when tried again. it only happened twise and hasnt occured since.

log follows
Quote:19-02-2006 22:15:59 debug playback has started
19-02-2006 22:15:59 debug cguiinfomanager::setcurrentsong(musicdb://3/85/1137.mp3)
19-02-2006 22:15:59 debug current m_vecpathhistory:
19-02-2006 22:15:59 debug 00.[]
19-02-2006 22:15:59 info party mode: reaping played song at 0:[smb://username:password@host/share/sata1/media/music/full albums/2pac - all eyez on me/all eyez on me (book 1)/2pac_all eyez on me (book 1)_11_tradin war stories.mp3]
19-02-2006 22:15:59 info party mode: reaping played song at 9:[musicdb://3/85/1137.mp3]
19-02-2006 22:16:00 debug current m_vecpathhistory:
19-02-2006 22:16:00 debug 00.[]
19-02-2006 22:16:00 info party mode: moving current song at 9 to 0
19-02-2006 22:16:01 info finished crossfading
19-02-2006 22:16:02 debug current m_vecpathhistory:
19-02-2006 22:16:02 debug 00.[]
19-02-2006 22:16:02 debug 01.[musicdb://3/]
19-02-2006 22:16:02 debug 02.[musicdb://3/85/]
19-02-2006 22:16:02 debug cguimediawindow::getdirectory (musicdb://3/)
19-02-2006 22:16:02 debug parentpath = []
19-02-2006 22:16:02 debug cutil::getmatchingshare, testing original path/name [musicdb://3/]
19-02-2006 22:16:02 debug cutil::getmatchingshare, testing url [musicdb://3/]
19-02-2006 22:16:02 debug cutil::getmatchingshare, comparing url [musicdb://1/]
19-02-2006 22:16:02 debug cutil::getmatchingshare, comparing url [musicdb://2/]
19-02-2006 22:16:02 debug cutil::getmatchingshare, comparing url [musicdb://3/]
19-02-2006 22:16:02 debug found matching bookmark at index 2: [musicdb://3/], len = [12]
19-02-2006 22:16:02 debug loading fileitems [z:\5aa145ae.fi]
19-02-2006 22:16:02 debug -- items: 598, directory: musicdb://3/ sort method: 12, ascending: true
19-02-2006 22:16:03 debug saving fileitems [musicdb://3/]
19-02-2006 22:16:03 debug -- items: 598, sort method: 12, ascending: true
19-02-2006 22:16:03 debug current m_vecpathhistory:
19-02-2006 22:16:03 debug 00.[]
19-02-2006 22:16:03 debug 01.[musicdb://3/]

19-02-2006 22:16:28 debug player has asked for the next item
19-02-2006 22:16:28 info mp3codec: loaded decoder at 00c2e750
19-02-2006 22:16:28 error exception in capplication::process()
19-02-2006 22:16:34 debug udpclient tx: 267042 -> 'kai_client_get_metrics;'
19-02-2006 22:16:34 debug udpclient rx: 267048 <- 'kai_client_metrics;speakeasy.net;not yet;70.66.1.88;2212;7.0.0.4;kaistation;mineiro;br0;1;0;0;0;0;0;0;libpcap;n/a;0;0;0;0;'
19-02-2006 22:16:34 info caudiodecoder::getdata() ending track - only have 2816 bytes left
19-02-2006 22:16:34 info paplayer: end of playback reached
19-02-2006 22:16:34 debug playback has finished
19-02-2006 22:16:34 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/2pac - all eyez on me/all eyez on me (book 1)/2pac_all eyez on me (book 1)_11_tradin war stories.mp3)
19-02-2006 22:16:34 info mp3codec: loaded decoder at 00c2e750
19-02-2006 22:16:34 error exception in capplication::process()
19-02-2006 22:16:34 debug freevisualisation() started
19-02-2006 22:16:34 debug freevisualisation() done
19-02-2006 22:16:34 debug current m_vecpathhistory:
19-02-2006 22:16:34 debug 00.[]
19-02-2006 22:16:34 info party mode: reaping played song at 0:[smb://username:password@host/share/sata1/media/music/full albums/2pac - all eyez on me/all eyez on me (book 1)/2pac_all eyez on me (book 1)_11_tradin war stories.mp3]
19-02-2006 22:16:35 debug current m_vecpathhistory:
19-02-2006 22:16:35 debug 00.[]
19-02-2006 22:16:35 info party mode: moving current song at 1 to 0
19-02-2006 22:16:36 info party mode: adding random song at 9:[smb://username:password@host/share/sata1/media/music/full albums/danko jones - i'm alive and on fire/05 danko jones - i'm alive and on fire.mp3]
19-02-2006 22:16:36 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:36 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:39 error exception in capplication::process()
19-02-2006 22:16:39 debug current m_vecpathhistory:
19-02-2006 22:16:39 debug 00.[]
19-02-2006 22:16:39 info party mode: reaping played song at 1:[smb://username:password@host/share/sata1/media/music/full albums/anti-flag - underground network/anti-flag_-_underground_network_-_05_-_vieques_puerto_rico_bikini_revisited.mp3]
19-02-2006 22:16:40 info party mode: adding random song at 9:[smb://username:password@host/share/sata1/media/music/full albums/treble charger - wide awake board/treble charger_wide awake bored_01_brand new low.mp3]
19-02-2006 22:16:40 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:40 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:40 error exception in capplication::process()
19-02-2006 22:16:40 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:40 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:40 error exception in capplication::process()
19-02-2006 22:16:40 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:40 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:40 error exception in capplication::process()
19-02-2006 22:16:40 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:40 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:40 error exception in capplication::process()
19-02-2006 22:16:40 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:40 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:40 error exception in capplication::process()
19-02-2006 22:16:41 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:41 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:41 error exception in capplication::process()
19-02-2006 22:16:41 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:41 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:41 error exception in capplication::process()
19-02-2006 22:16:41 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:41 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:41 error exception in capplication::process()
19-02-2006 22:16:41 debug cplayercorefactor::getplayers(smb://username:password@host/share/sata1/media/music/full albums/limp bizkit/[limp bizkit] - stink finger.mp3)
19-02-2006 22:16:41 info mp3codec: loaded decoder at 00bf6010
19-02-2006 22:16:41 error exception in capplication::process()
19-02-2006 22:16:41 error capplication::process(), too many exceptions
19-02-2006 22:16:41 fatal exception_access_violation (0xc0000005)
at 0x0016749a

dont know if that will help you much.

besides these two isolated crashes it seems to be working fantastic. a few minor interface quirks but ill leave thoes for another day

tanks again :kickass:
loto

[Image: loafamotive.gif]
find quote
kraqh3d Offline
Retired Developer
Posts: 7,172
Joined: Dec 2003
Reputation: 4
Location: New York City, USA
Post: #4
@coemr
it could open up the now playing window when first enabled. thats easy. i'll throw that in. the reason i didnt put the button in files view is because its library view dependant.

and what you mean by "@ bugs.. disable party mode..."? you can certainly disable it, but you need to do it from the button library view. i'll add a context menu option of "cancel party mode" to the now playing window context menu. that's simple enough.

@loto
you've experienced this lock up twice out of how many times? it looks like something could be wrong with the stink finger file, but you said it plays fine. its as if the file got to the top of the playlist, and it kept trying to repeatedly play it but couldnt. in this case, you should get a message that the item is unplayable.

an unplayable song should be reaped from the list after it errors and party mode moves onto the next song. i've noticed some quirks with the paplayer related to how it loads the next song outside of the playlist player and then just tells the playlist player to move ahead. it could be related.

please double check that this file plays ok outside of party mode. queue up some files, and put this one in the middle.

and definately explain these interface quirks you've found. i'm interested in those to.

** edit **
i just threw in those two suggestions. now, when party mode is enabled, xbmc switches to the now playing window, and you can watch it get populated. there's also a "cancel party mode" option in the context menu so you can turn it off without going back to the library window. i also added some code to disable the "move" options in the now playing context menu when appropiate since party mode moves stuff on its own.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
DonJ Offline
Team-Kodi Member
Posts: 524
Joined: May 2005
Reputation: 5
Post: #5
is there a way to use the party mode with videos? i'd like to use it for mvids...
i guess the answer is no though as it depends on the music library [Image: cry.gif]

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
reddington Offline
Junior Member
Posts: 13
Joined: Jan 2006
Reputation: 0
Post: #6
wow this is great!! i was just reading some of the other party mode threads yesterday and became really interested in this.

i'm going to get a new build and start contributing to this thread... thanks for the work kraqh3d.
find quote
Loto_Bak Offline
Fan
Posts: 475
Joined: Sep 2004
Reputation: 0
Post: #7
kraq, i'm absolutly positive the file plays properly when added to a queue. it has worked 20+ times since.

regarding little quirks, they were feature requests is why i omitted them.
could 'enqueue' add items in front of the randomly populated items? i think this is more usable because users would want to listen too their selectedf songs before all the random songs.
the ability to specify the 'source' of the randomly selected songs is needed as well. otherwise songs like limp bizkit - stink finger come up Big Grin being able to use playlists, genres, or specific artists as sources would be neat. perhaps a context menu item 'party this directory'

thanks
loto

[Image: loafamotive.gif]
find quote
chadoe Offline
Team-XBMC Developer
Posts: 628
Joined: Nov 2003
Reputation: 0
Location: Home
Post: #8
i get this error sometimes when starting party mode:
Quote:20-02-2006 20:35:16 info party mode: adding random song at 3:[<a path to mp3 file>]
20-02-2006 20:35:17 debug current m_vecpathhistory:
20-02-2006 20:35:17 debug 00.[]
20-02-2006 20:35:17 error party mode: cannot get songs from database. aborting.
then there are 4 songs in the list and it doesn't remove items when played or add new items.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
kraqh3d Offline
Retired Developer
Posts: 7,172
Joined: Dec 2003
Reputation: 4
Location: New York City, USA
Post: #9
@donj: no, music party mode has no video support.

@loto: no feature requests yet, but to answer you:
Quote:could 'enqueue' add items in front of the randomly populated items? i think this is more usable because users would want to listen too their selectedf songs before all the random songs.
eventually. right now there is no way to easily push more than one song to the top of the list, nor is there a way to distinguish between user added songs and randomly added songs. so for now, queue puts items at the bottom as it does normally, play on a folder/playlist is completely ignored, and select or play on a file makes that file the current song.

Quote:the ability to specify the 'source' of the randomly selected songs is needed as well. otherwise songs like limp bizkit - stink finger come up. being able to use playlists, genres, or specific artists as sources would be neat. perhaps a context menu item 'party this directory'
unfortunately, this requires a database update. all songs will be available by default with a context menu option to both enable or disable a file/folder. and i dont see playlists ever being used as random sources as they are still outside of the database.

@charly: when did you last sync with cvs? there was a bug that existed in cvs for a short while yesterday which could cause this.

that error is supposed to only be generated when getrandomsong fails. since i dont see the accompanying getrandomsong failed error message, it looks like you may have synced when the bug existed.

and the reason why no more songs are added, and no songs are removed is because it aborted. if party mode encounters any errors, it disables itself to prevent it from getting stuck in a spiraling loop of errors.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
pike Offline
Project Manager
Posts: 4,834
Joined: Sep 2003
Reputation: 29
Location: Sweden
Post: #10
same tune shouldnt enqueue 'auto' more than once in current 10 playing, i had this happen more than once with a selection of 38 tunes

ex: (with 2 tunes queued 2 times)
[Image: screenshot1811hn.jpg]

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,230
Joined: Oct 2003
Reputation: 177
Post: #11
regarding the randomness, i don't think that calling srand(timegettime()); rand() is necessarily a reliable random sequence - the "random" number is tied to close to the current time. it gets even worse if you modulo it as the low bits of rand() are less variable than the high bits. this is used elsewhere in xbmc as well and is the reason for a number of other phenomena such as the slideshow random angles not being particularly random.

perhaps we could have a random number class that seeds once and then uses the one sequence (up until a set number of drawings, then re-seed it) so that we can get reasonable randomness? i think using srand() and rand() is fine as long as we do it sensibly.

also, we could have a history vector of song ids for database::getrandomsong() to eliminate the issues pike is seeing for say 100 songs or so.

party mode looking great though - i like it Smile

cheers,
jonathan

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
kraqh3d Offline
Retired Developer
Posts: 7,172
Joined: Dec 2003
Reputation: 4
Location: New York City, USA
Post: #12
i agree that the randomness isnt that good, but its the same randomness thats used elsewhere. but, lets put the randomness aside for now. there is a larger question to answer which can mask the problem.

today, the only check is that the user has atleast one song in the database which is why there's no duplicate stripping yet. i like jm's idea of keeping a history of the last 'x' songs but it still presents a question... what should be the minimum number of songs in the database to enable party mode?

once this question is answered, we can figure out what history size to use for duplicate detection to strip them out.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
sollie Offline
Fan
Posts: 354
Joined: Nov 2005
Reputation: 6
Post: #13
kragh3d, thanks for this great job. i am very happy with this.

but the way of adding songs to the list is not right for me. now the playing song stops and the added songs plays. this will interupt the party everytime adding a new song. my suggestion is to add a new song to the second place. the next to the third place and so on.

i have also a feature request: is it possible to enable partymode with boot? i like an option for this in settingsmenu.

thanks for all,

sollie.

[Image: sollie.gif]
find quote
kraqh3d Offline
Retired Developer
Posts: 7,172
Joined: Dec 2003
Reputation: 4
Location: New York City, USA
Post: #14
sollie,
please read the entire thread. it works like that because that's all that was relatively easy to do at the moment. (relatively easy... it took me a week to shoehorn this feature into xbmc and have it work as good as it does for the first iteration.)

trust me, its not as simple as "add a new song to the second place, the next to the third place and so on" as you describe. not only is there a timing issue as the list dynamicly shifts, there's no way yet to determine what's a randomly added song, and whats a user added song. so, if you dont like it, then dont use select/play today. use queue which will not disturb the currently playing song, but the songs will go to the bottom of the queue.

but, this presents some questions for discussion... how should select/play and queue ultimately work during party mode?

should select/play put the selected items beneath the currently playing item as sollie suggests, or should it interupt the list as it does now? (i really think that select/play should work as it does today. if someone plays something, it means they want to hear it immediately.)

where should queue put the items? underneath the currently playing song, underneath the last user added item, or at the bottom like it does today?

** edit **
regarding a "start party mode on boot" option... i dont know. right now, i tend to say no as it can conflict with an autoexec.py script. though, at some point, an autoexec.py script may be a way to start it on boot.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find quote
sollie Offline
Fan
Posts: 354
Joined: Nov 2005
Reputation: 6
Post: #15
Quote:use queue which will not disturb the currently playing song, but the songs will go to the bottom of the queue

i am sorry, this is good enough for me. i didnt know the "queue" function worked that way.

thanks, sollie

ps: its fine this way, now i use the "remove" (contextmenu) function to delete songs from the list.

[Image: sollie.gif]
find quote
Post Reply