.CDG Karaoke-files support for music

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
stcogoli Offline
Member
Posts: 93
Joined: Jul 2004
Reputation: 0
Post: #1
greetings,
i have just written a visualisation for displaying karaoke .cdg
files on the xbox. i recently posted a patch for this on sourceforge but gamester17 suggested that i also post here to attract more developper's attention. the bulk work is done but i am looking for xbmc coders to polish this up. :help:

for those that are interested, you have to
1.) download the patch at sourceforge
2.) recompile xbmc with the source changes
3.) copy xaraoke.vis, xaraokelogo.bmp and xaraoke.xml
to the visualisations folder
4.) select the xaraoke visualisation from the music settings
5.) put "song.cdg" in the same folder as "song.mp3"
6.) play the music file "song.mp3"

the visualisation will then kick in as soon as the file is played
and it will look for "song.cdg" in the same folder as "song.mp3". if the cdg file is not found, it displays a splash screen stating this. if the cdg file is found, it is parsed on the screen at a frequency specified in the settings file xaraoke.xml. you have to tweak this parsing period if the graphics are out of sync with the audio. the theoretical value is 3.3333 ms but this has to be lowered to correct for overhead (i wasn't able to take this overhead automatically into account). note that the overhead is more important when debugging so the parsing period has to be
lowered when running in debug mode. anyways, just play with this value until the sync is good ; once the right value
is found, you shouldn't have to adjust it anymore.

note also that this visualisation is not a standalone plugin so you have to recompile xbmc to use it. i tried to write it as a plugin at first but gave that up because:
1.) it has a lot of functionality (thread functions etc...) that had to be added to the dllloader so a recompile was necessary anyways.
2.)i also think that voice support should be added and it will surely be a hassle to do this in a windows dll.
3.) it doesn't behave exactly as a visualisation because
a.) the visualisation has to start automatically when the file
is played to assure synchronicity.
b.) xbmc must pass the whole music file path to this visualisation (not just the file name) in order for the vis
to be able to find the .cdg file in the same folder.

at last, here is what remains to be done

todo:
-------
1.) fix a mem leak which is visible in debug mode when many cdg files are successively played.
2.) integrate the visualisation more elegantly in the base code if possible.
3.) add voice support for singing through the communicator headset (for now, a separate mixer is needed for singing along). maybe it could be possible to use voice masks and sound like mr roboto!
4.)maybe add a popup osd like the one for movie playback, with buttons for adjusting the volume, parsing period and other settings.

if we get this karaoke machine on track, maybe it can help
with xbox sales in japan Big Grin
find quote
mknight Offline
Senior Member
Posts: 165
Joined: Oct 2003
Reputation: 0
Post: #2
any possibility of making it song.mp3 and song.wma? i have lots of wma/cdg combos that currently work with xbx media mixer, would be cool if they don't need to be converted to mp3s.
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Thumbs Up   
Post: #3
for devs reference; stcogoli's cdg source code patch can be found on sourceforge.net here: "cdg (karaoke) support patch for mp3 (link)".

ps! my suggestion for todo #2 is to integrate the code into xbmc so toggle enable/disable for cdg with same button as subs for video(?),
then always/only look for .cdg if "cdg karaoke support" is enabled in settings for music, + like mknight asked use for mp3/wma/wav, ...etc.

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
stcogoli Offline
Member
Posts: 93
Joined: Jul 2004
Reputation: 0
Post: #4
Quote:any possibility of making it song.mp3 and song.wma?  i have lots of wma/cdg combos that currently work with xbx media mixer, would be cool if they don't need to be converted to mp3s.

sure, it works with any music file that xbmc can play ;
i just used song.mp3 as an example. it also works over
the network and i assume from the dvd but i haven't tested
the latter.

Quote:ps! my suggestion for todo #2 is to integrate the code into xbmc so toggle enable/disable for cdg with same button as subs for video(?),
then always/only look for .cdg if "cdg karaoke support" is enabled in settings for music,
yes, that's a good idea because there is functionality in cdg for alpha transparency so that way, you could also start a video clip and overlay the lyrics with a transparent background on top. i didn't do it that way because i would have had to modify much more base code and i basically wanted to modify as little as possible so that a real xbmc dev could do the integration elegantly. however, the lyrics also have to kick in whenever a music file is played and this can't be achieved through the video osd so i think this vis should have its own popup video-like osd.
find quote
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,523
Joined: Sep 2003
Reputation: 9
Location: Sweden
Question   
Post: #5
(stcogoli @ july 16 2004,14:19 Wrote:
Quote:ps! my suggestion for todo #2 is to integrate the code into xbmc so toggle enable/disable for cdg with same button as subs for video(?),
then always/only look for .cdg if "cdg karaoke support" is enabled in settings for music
yes, that's a good idea because there is functionality in cdg for alpha transparency so that way, you could also start a video clip and overlay the lyrics with a transparent background on top. i didn't do it that way because i would have had to modify much more base code and i basically wanted to modify as little as possible so that a real xbmc dev could do the integration elegantly. however, the lyrics also have to kick in whenever a music file is played and this can't be achieved through the video osd so i think this vis should have its own popup video-like osd.
that is actually what i meant, (not use same video-osd, but just similar to it), have own music-osd (so could bring up cdg on any vis too).

to clearify; i think it be best if added new osd on black-screen and/or existing vis when play music audio-files. as an option so only look for and load .cdg if "cdg karaoke support" is enabled in settings for music. then one could toogle on/off with button during vis

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
stcogoli Offline
Member
Posts: 93
Joined: Jul 2004
Reputation: 0
Post: #6
Quote:to clearify; i think it be best if added new osd on black-screen and/or existing vis when play music audio-files. as an option so only look for and load .cdg if "cdg karaoke support" is enabled in settings for music.
i agree.
Quote:(so could bring up cdg on any vis too).
if the cdg file has transparent background, then the lyrics will display on top of the existing vis but most cdg files are not transp. and they will thus simply override the current vis
so i'm not sure if it should be treated as a new vis or as a property for other existing vis.

ultimately, it should probably be integrated in a broader music popup osd. isn't it strange that there isn't an osd for music like there is one for video?

ps: the vis is not limited to mp3 so maybe the thread title should be changed to reflect that.
find quote
lion2 Offline
Junior Member
Posts: 27
Joined: Feb 2004
Reputation: 0
Post: #7
so has any dev decided to add this to the official xbmc build?
find quote
BoomDivX Offline
Junior Member
Posts: 8
Joined: Mar 2004
Reputation: 0
Post: #8
i hope it will soon! i'm a big fan of karaoke and i support you!! good work! any chance to see it in the next cvs? xd
find quote
pitfall Offline
Junior Member
Posts: 7
Joined: Jul 2004
Reputation: 0
Post: #9
(boomdivx @ july 18 2004,21:36 Wrote:i hope it will soon! i'm a big fan of karaoke and i support you!! good work! any chance to see it in the next cvs? xd
oh yea! that would own! :o

wohoo!!!! :bowdown:
find quote
stcogoli Offline
Member
Posts: 93
Joined: Jul 2004
Reputation: 0
Post: #10
about the mem leak: if i run a song, then stop it and restart doing this continuously, the displayed freemem eventually drops. however, i have just noticed that this also occurs for the other visualisations too! can anybody enlighten me on this? is it normal for the freemem to drop or is this some unfixed leak in the xbmc code?
find quote
lion2 Offline
Junior Member
Posts: 27
Joined: Feb 2004
Reputation: 0
Post: #11
just curious, does your plugin have support for the xbox music mixer microphone?
find quote
stcogoli Offline
Member
Posts: 93
Joined: Jul 2004
Reputation: 0
Post: #12
in my todo list, #3 is add voice support so no it doesn't support any microphone for now. however, if the music mixer mike functions like an xblive communicator, then it will probably work when that feature will be added.
find quote
stcogoli Offline
Member
Posts: 93
Joined: Jul 2004
Reputation: 0
Post: #13
i also realized maybe voice support should be integrated more broadly into xbmc. one could add a settings screen for up to four mikes with their own volume settings. this would allow for backing vocals and duettes and since it would not be limited to the karaoke vis, you could also play a movie with its volume turned down and lipsync to it. i remember me and friends used to have a lot of fun lipsyncing improvised stupidities over old eddie murphy movies. (i know there's an official name for this activity but i can't remember what it's called...)  :lookaround:

so in the settings screen, you could set the mikes in uncompressed loopback speaker mode for lipsyncing or in compressed networking mode and have a list of remote contacts you could voice chat with, just like in a xblive game. hmmm this project is getting a bit ambitious for my skills...
find quote
stcogoli Offline
Member
Posts: 93
Joined: Jul 2004
Reputation: 0
Post: #14
update on the todo list.
#1.) i am now 100% sure the mem leak is not in my code but in mplayer. see the bugs thread for more. so this is solved (kinda...).
#2.) i have just changed the sync code for xaraoke to truly behave like a vis, i.e. you can now start the display in the middle of a song with the x button and it should show up in sync (if it doesn't, you can tweak a new av delay parameter in xaraoke.xml). this allowed me to eliminate the previous source changes to application.cpp. the changes to xbmc core files are now very minimal and limited to the visualisations folder so imo i consider the integration problem to be solved.
#3.) i have ordered a communicator from ebay and will start working on this as soon as i get it.
#4.) this is actually just bells and whistles and can be dealt with later.

the only thing i see that could be better is the sync code. right now, it's a bit hacked up and will probably necessitate users to tweak the settings in xaraoke.xml to get good sync.
the values currently in xaraoke.xml work in release mode on my machine but i would like to know if the sync is also good
for everybody else...
find quote
lion2 Offline
Junior Member
Posts: 27
Joined: Feb 2004
Reputation: 0
Post: #15
im trying to compile using the latest(8/6/04) cvs source code. compiling goes through just fine but, im getting some linking errors. below is what i get. anyone have any ideas?

xbmc error lnk2001: unresolved external symbol "public: cdecl cfancontroller::instance(void)" (?instance@cfancontroller@@sapav1@xz)
xbmc error lnk2001: unresolved external symbol "public: static class cfancontroller * cdecl cfancontroller::instance(void)" (?instance@cfancontroller@@sapav1@xz)
xbmc error lnk2001: unresolved external symbol "public: void thiscall cfancontroller::start(int)" (?start@cfancontroller@@qaexh@z)
xbmc error lnk2001: unresolved external symbol "public: void thiscall cguidialogvolumebar::cguidialogvolumebar(void)" (??0cguidialogvolumebar@@qae@xz) referenced in function "public: thiscall cguiwindowpointer::cguiwindowpointer(void)" (??0cguiwindowpointer@@qae@xz) referenced in function "public: thiscall cguiwindowsettingsprofile::cguiwindowsettingsprofile(void)" (??0cguiwindowsettingsprofile@@qae@xz) referenced in function "public: thiscall cprofile::~cprofile(void)" (??1cprofile@@qae@xz) referenced in function "public: void * thiscall cprofile::cprofile(void)" (??0cprofile@@qae@xz) referenced in function "protected: bool thiscall directory::cdaapdirectory::cdaapdirectory(void)" (??0cdaapdirectory@directory@@qae@xz) referenced in function "public: void thiscall xfile::cfiledaap::cfiledaap(void)" (??0cfiledaap@xfile@@qae@xz) referenced in function "public: class xfile::ifile * thiscall cfancontroller::getcputemp(void)" (?getcputemp@cfancontroller@@qaemxz) referenced in function "protected: void thiscall cfancontroller::getgputemp(void)" (?getgputemp@cfancontroller@@qaemxz) referenced in function "protected: void thiscall cfancontroller::getfanspeed(void)" (?getfanspeed@cfancontroller@@qaehxz) referenced in function "protected: void thiscall cfancontroller::getfanspeed(void)" (?getfanspeed@cfancontroller@@qaehxz) referenced in function $l74920
xbmc error lnk2019: unresolved external symbol "public: static class cfancontroller * thiscall capplication::startservices(void)" (?startservices@capplication@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: virtual thiscall capplication::~capplication(void)" (??1capplication@@uae@xz)
xbmc error lnk2019: unresolved external symbol "public: virtual thiscall capplication::~capplication(void)" (??1capplication@@uae@xz)
xbmc error lnk2019: unresolved external symbol "public: virtual thiscall capplication::~capplication(void)" (??1capplication@@uae@xz)
xbmc error lnk2019: unresolved external symbol "public: virtual void thiscall cguiwindowfullscreen::renderfullscreen(void)" (?renderfullscreen@cguiwindowfullscreen@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: virtual void thiscall cguiwindowfullscreen::renderfullscreen(void)" (?renderfullscreen@cguiwindowfullscreen@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: void thiscall cguiwindowsettingssystem::onmessage(class cguimessage &)" (?onmessage@cguiwindowsettingssystem@@uae_naavcguimessage@@@z)
xbmc error lnk2019: unresolved external symbol "public: void thiscall capplication::startservices(void)" (?startservices@capplication@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: void thiscall cguiwindowsettingssystem::onmessage(class cguimessage &)" (?onmessage@cguiwindowsettingssystem@@uae_naavcguimessage@@@z)
xbmc error lnk2019: unresolved external symbol "public: void thiscall capplication::startservices(void)" (?startservices@capplication@@qaexxz)
xbmc error lnk2019: unresolved external symbol "public: void thiscall capplication::stopservices(void)" (?stopservices@capplication@@qaexxz)
xbmc fatal error lnk1120: 21 unresolved externals
find quote
Post Reply