View Full Version : Visualisation plugin API for XBMC
hi,
i'm setting up an architecture which allows other devs to develop a visualisation plugin for xbmc
from the settings->music the end-user can select which visz. he/she wants and xbmc will use that one.
so how does it work?
first :
1. visz. plugins are normal .dlls but with the extension .vis
2. visz. plugins should b copied into the visualisations/ subdirectory on your xbox
3. visz. plugins must use a minimal set of dependencies. they should not depend on windows kernel/gdi or other things!
so how to program one?
here's a skeleton of a visz. plugin .dll:
// spectrum.cpp: implementation of the cspectrum class.
//
//////////////////////////////////////////////////////////////////////
#include <xtl.h>
#pragma comment (lib, "lib/xbox_dx8.lib" )
extern "c"
{
struct vis_info {
bool bwantsfreq;
int isyncdelay;
// int iaudiodatalength;
// int ifreqdatalength;
};
};
vis_info vinfo;
static lpdirect3ddevice8 m_pd3ddevice;
extern "c" void create(lpdirect3ddevice8 pd3ddevice, int iscreenwidth, int iscreenheight, const char* szvisname)
{
}
extern "c" void start(int ichannels, int isamplespersec, int ibitspersample, const char* szsongname)
{
}
extern "c" void audiodata(short* paudiodata, int iaudiodatalength, float *pfreqdata, int ifreqdatalength)
{
}
extern "c" void render()
{
}
extern "c" void stop()
{
}
extern "c" void getinfo(vis_info* pinfo)
{
memcpy(pinfo,&vinfo,sizeof(struct vis_info ) );
}
extern "c"
{
struct visualisation
{
public:
// gets called once during initialisation. allows vis. plugin to initialize itself
// pd3ddevice is a pointer to the dx8 device which you can use for dx8
// iscreenwidth/iscreenheight are the gui's screenwidth/screenheight in pixels
// szvisualisationname contains the name of the visualisation like goom or spectrum,...
void (--cdecl* create)(lpdirect3ddevice8 pd3ddevice, int iscreenwidth, int iscreenheight, const char* szvisualisationname);
// gets called at the start of a new song
// ichannels = number of audio channels
// ibitspersample = bits of each sample ( 8 or 16)
// isamplespersec = number of samples / sec.
// szsongname = name of the current song
void (--cdecl* start)(int ichannels, int isamplespersec, int ibitspersample, const char* szsongname);
// gets called if xbmc has new audio samples for the vis. plugin
// paudiodata is a short [channels][iaudiodatalength] array of raw audio samples
// pfreqdata is a array of float[channels][ifreqdatalength] of fft-ed audio samples
void (--cdecl* audiodata)(short* paudiodata, int iaudiodatalength, float *pfreqdata, int ifreqdatalength);
// gets called if vis. plugin should render itself
void (--cdecl* render) ();
// gets called if vis. should stop & cleanup
void (--cdecl* stop)();
// gets called if xbmc wants to know the visz. parameters specified by the vis_info struct
void (--cdecl* getinfo)(vis_info* pinfo);
};
void --declspec(dllexport) get_module(struct visualisation* pvisz)
{
pvisz->create = create;
pvisz->start = start;
pvisz->audiodata = audiodata;
pvisz->render = render;
pvisz->stop = stop;
pvisz->getinfo = getinfo;
}
};
please note that due to a bug in the forums i cant post any underscores. so i replaced the underscores with --
xbmc will first call get_module() to retrieve the visualisation struct. the plugin will give xbmc the visualisation struct filled with function pointers to all visz. routines needed by xbmc
well thats it for now. remember this is all premature.
no plugins are available yet, but hopefully we'll see one soon
frodo
jmarshall
2003-10-12, 23:45
frodo:
what a great interface! ;) i wonder how long it will take me to port the spectrum analyser... ;)
perhaps having the possibility to transfer other information regarding the audio would be a good feature - things such as track, album, artist info etc. might be an idea?
i'll look at compiling up the spectrum analyser plugin - the only other dependencies are xmldocument for loading the config file iirc.
cheers,
jonathan
hehehe, yeah i must admit i copied the ideas from you visz. classes :d
about copying more info, i'll see if i can come up with something
frodo
jmarshall
2003-10-13, 09:59
that's cool. have you implemented the fft code + delay stuff? if so, i'll look at having a play with getting the sa into a dll. (i haven't done any dll based stuff before, so this should be an adventure - i may ask some questions when i get stuck)
cheers,
jonathan
have you implemented the fft code + delay stuff?
yes, well you did. i just copied it into xbmc
anyway i forgot 2 add a method to pass the vis_info struct.
its added now (see updated skeleton above)
when we got a basic plugin working i'll add other things like the album/artist etc info.
about the dll, yes its tricky.
compiling a .dll is easy, but we dont want any dependencies on windows. so i'm writing my own import libraries now which you can use. when its working i'll put it in cvs together with an complete working example plugin project
frodo
Gamester17
2003-10-13, 15:58
very cool, but just wondering how the customizable part in viz such as jmarshall's spectrum analyzer gonna work?
(maybe add a set of parameters inside that can be selected from within gui, and/or a seprate xml file for it?)
but just wondering how the customizable part in viz such as jmarshall's spectrum analyzer gonna work?
for version 1 :seperate xml
frodo
Gamester17
2003-10-13, 16:07
but just wondering how the customizable part in viz such as jmarshall's spectrum analyzer gonna work?
for version 1 :seperate xml
k, for v2 maybe devide xml into sections (each which own name) & make those selectable from gui
jmarshall
2003-10-14, 00:01
sounds good, frodo.
the vis_info struct i figured might be the way to transfer info in the future, but i hadn't really thought about it all that much, though.
i had a play with doing some dll stuff last night. i basically just generated a .dll project, then "modified" it via editing the .vcproj file to use xbox stuff. had to muck around with .lib files to include when linking + still didn't get all the stuff it needed - i was kind of shooting in the dark to be honest!
let me know when you have some import libraries sorted + the example project and i'll do the sa.
cheers,
jonathan
well here's the status so far.
1. i ported your spectrum analyser to a visz. dll
2. xbmc can load it
3. all the function calls seem 2 work (create/stop/start/render...)
but the 2nd time i call render() it crashes
my guess is that there's something wrong with the directx linking, so i'll look into it
frodo
ok, the 1st visualisation works now
i ported the spectrum analyser from jmarshall
just press x when playing a song to switch between visualisation & gui
visualisation can b found in
xbmc/visualisations/
and must b copied -> xbox
source of visualisations can b found in
xbmc/xbmc/visualisations/source
frodo
jmarshall
2003-10-15, 00:37
great work, frodo!
i'll take a look at it as soon as i can grab the source.
cheers,
jonathan
ok,
i ported the goom visz. , so that makes 2.
however there's one challenge left, and thats to port tripex
( see here (http://www.tripex2.fsnet.co.uk/screenshots.html) for screenshots )
i've contacted the author and he gave me the sources of tripex (thx ben!)
but now i'm looking for someone to port it 2 xbmc
jonathan, are you interessted???
frodo
Gamester17
2003-10-17, 13:22
ok, i ported the goom visz. , so that makes 2.
great work frodo, which version of goom did you port the 'old' one or the new one with 'tentacles'?
most users are divded on which one of the two looked/looks best in xbmp, so maybe port both? http://www.xboxmediaplayer.de/forums/non-cgi/emoticons/wink.gif
which version of goom did you port the 'old' one or the new one with 'tentacles'?
the new one with tentacles.will see what we can do with the old one
frodo
jmarshall
2003-10-21, 00:55
hi frodo.
i'll get the new source etc. tonight and have a look at how it all works. then i'll grab the tripex sources and get to know it.
no promises, though - i'm pretty busy atm, so if anyone else would like to look at it feel free. i'll pop back here every now and then and post on any progress or lack of it.
cheers,
jonathan
ok, the 1st visualisation works now
i ported the spectrum analyser from jmarshall
just press x when playing a song to switch between visualisation & gui
visualisation can b found in
xbmc/visualisations/
and must b copied -> xbox
source of visualisations can b found in
xbmc/xbmc/visualisations/source
frodo
just looking at your sources, i'm a little confused by the goom source in xbmc/vis/source/goom.rar - it only seems to contain the wrapper source to make it work with xbmc, i assume the libgoom.a is where all the work is done, but what generates this? is it just one of the normal goom releases which somehow work with the xdk or did you also modify that?
true
the goom visz is just a simple wrapper arround libgoom.a
libgoom.a contains the original & goom visz compiled in an archive. the original goom visz doesnt do d3d @ all so no need for it to import the xdk functions
frodo
true
the goom visz is just a simple wrapper arround libgoom.a
libgoom.a contains the original & goom visz compiled in an archive. the original goom visz doesnt do d3d @ all so no need for it to import the xdk functions
frodo
great, which version of goom did you use to generate this? *there are many different ones listed, itunesgoom, wmp goom etc.
will you be taking the same approach with the codecs, so that all codecs are loaded as plugins like this? *it's a great way of isolating the main application from the effects of many developers working on different codecs etc..
also, i did a bit of hunting for examples of using winamp plugins and found the following http://www.emulinks.de/xmms-winamp/ which shows how to use those plugins in xmms on linux, is there any chance the same technique could be used in xbmc?
Hullebulle
2003-10-23, 03:20
also, i did a bit of hunting for examples of using winamp plugins and found the following http://www.emulinks.de/xmms-winamp/ which shows how to use those plugins in xmms on linux, is there any chance the same technique could be used in xbmc?
i wrote an email to the author of this software 2 monts ago, but he never replied. :(
the main problem is that his code uses wine to work. so we would need to port the wine-windows dlls he is using too.
Gamester17
2003-10-23, 13:43
also, i did a bit of hunting for examples of using winamp plugins and found the following http://www.emulinks.de/xmms-winamp/ which shows how to use those plugins in xmms on linux, is there any chance the same technique could be used in xbmc?
i wrote an email to the author of this software 2 monts ago, but he never replied. :(
the main problem is that his code uses wine to work. so we would need to port the wine-windows dlls he is using too.
another couple of big problem coding this is that you would first have the port the whole xmms plugin system to xbox/xbmc too as libxmms that you can use with mplayer only support input plugins (that means codecs only, not vis), secondly you would probebly have to write a opengl wrapper as all xmms (and most winamp) vis are opengl only. now i think sdlx (http://sourceforge.net/projects/sdlx/) can process opengl in software (using the cpu, not gpu) but i believe that is very cpu intensive, so runnig all this at the same time would not leave much room to process the actual vis and play a music file at the same time, or (i'm not a dev so i don't know the exact details or technical bit behind it)?
also, i did a bit of hunting for examples of using winamp plugins and found the following http://www.emulinks.de/xmms-winamp/ which shows how to use those plugins in xmms on linux, is there any chance the same technique could be used in xbmc?
i wrote an email to the author of this software 2 monts ago, but he never replied. :(
the main problem is that his code uses wine to work. so we would need to port the wine-windows dlls he is using too.
but it only uses wine to provide the windows api because linux doesn't have it. could it be possible that the xdk is similar enough to the windows api, that the dll can be remapped to use the xdk, much like caustix does?
as for opengl, i guess that would be a bit of a stumblind block, unless an thin mapping layer could be used to convert gl calls to directx. never mind.
back on the plugin approach though, are the codec libraries all going to work like this?
jmarshall
2003-10-24, 00:28
the xdk does not contain anything for rendering into windows or all the hwnd stuff etc. the quickest way to get winamp plugins to work in xbmc is to recode it. this is not difficult assuming the graphics are either all drawn direct to a bitmap, or done using direct3d. basically all that needs to be done is to strip out all the windows stuff + all the interactive stuff (if it's has any) and redo the interfacing (just a matter of changing some function names or writing some small wrapper code).
ofcourse, the more complex the visz is, the longer + more complex it is to port (tripex for example).
all the simple winamp plugins that draw into a bitmap + don't have any interaction should be real quick to port, assuming one has source code and permission.
as for codecs: all codecs currently are handled through loading a core (mplayer) as a dll. that is why the current codecs supported are those that mplayer supports. when mplayer uses external win32 codecs, we load them via mplayer using a similar interface (loaddll). this is not 100% working yet, though with monkeyhappy's work it's getting more complete (rm is working in xbmp now). where we are heading is that anything that will play using mplayer on linux, will also play using xbmc. some devs are also looking at porting some other cores (xine for instance) as dlls so that we can get more formats (such as dvd navigation) supported.
hope this helps.
have you implemented the fft code + delay stuff?
about the dll, yes its tricky.
compiling a .dll is easy, but we dont want any dependencies on windows. so i'm writing my own import libraries now which you can use. when its working i'll put it in cvs together with an complete working example plugin project
frodo
dll's on the xbox??
i'm now very confused.
request dumb guy guide to building dll's on the xbox
:)
jippie
DaveHShapiro
2004-01-02, 23:20
wow you giys are doing a lot of work but to omeone like me i have no idea what you are doing....
are you guys trying tomake winamp visulizations work on th xbox? that would be great and look foreward to hearing about it more. if thts not what you are doing then what are you doing? i found this post when looking for more visulizations for xbmc.
sorry for being so confused
Hullebulle
2004-01-16, 03:10
wow you giys are doing a lot of work but to omeone like me i have no idea what you are doing....
are you guys trying tomake winamp visulizations work on th xbox? that would be great and look foreward to hearing about it more. if thts not what you are doing then what are you doing? i found this post when looking for more visulizations for xbmc.
sorry for being so confused
no its not about winamp plugins. its our own viz plugin system.
hi,
how's is it going, is there now an example that i can have a look at?
jippie
Gamester17
2004-01-20, 14:50
is there now an example that i can have a look at?
yes, there are two so far, goom & spectrum analyzer, you can get the source code from the xbmc cvs tree (http://cvs.sourceforge.net/viewcvs.py/xbmc/xbmc/xbmc/visualizations/sources/).
edit: btw, don't forget about the xbmc visualization competition (from 13/01-2004 to 14/03-2004) (http://www.xboxmediaplayer.de/cgi-bin/forums/ikonboard.pl?act=st;f=1;t=1077) http://www.xboxmediaplayer.de/forums/non-cgi/emoticons/wink.gif
happy coding http://www.xboxmediaplayer.de/forums/non-cgi/emoticons/cool.gif
bradbradbrad
2004-01-21, 11:46
1. visz. plugins are normal .dlls but with the extension .vis
i've only got vs .net 2002 here at the moment, so i can only go by what i can read out of the .sln files, but those .dlls are normal windows dlls (i.e. not an xbox static library), correct?
Gamester17
2004-01-22, 13:27
@frodo, jmarshall and all experienced devs, can you please put together some info on where to get started with coding a visualization?, and it would also be great if you explained the process/requirements in making a .vis plugin (dll) for xbmc visualisation interface, ...a how-to guide?
jmarshall
2004-01-23, 02:12
firstly, i suggest that anyone wanting to code a visualisation use xbmp as your development environment, as it is much easier to bugfix etc. - bugfixing dlls is not fun at all. converting it into a .vis dll for xbmc can be done at the end - see the spectrum and goom .vis source code in the xbmc source tree.
another option is to develop completely on windows. basically, just have a function that takes in either the waveform data, or frequency data (or both) and draws some stuff on screen. in order to test, it'd be real easier to just read in a .wav under windows and either just use the waveform data directly, or use the fft code from xbmc to produce a spectrum. probably just random data at first would be ok to get something initially working, though.
once you have something working, then you'll need to either code something up to get audio out (if working in windows) or use the xbmp spectrum analyser code as a base to get it working in xbmp. most directx 8 stuff should transfer over to the xbox reasonably easily. then you can work on sync etc. and making it look pretty.
hope this gives people some ideas.
Gamester17
2004-01-27, 15:42
thought i try to start a technical development discussion on if it is possible or not to port single c/c++ open source winamp plug-ins to xbox and xbmc .vis dll. is it possible to write a wrapper for an open source winamp plug-in so no code from the winamp plugin interface is needed to use it under xbmc?, if so how hard and/or time-demanding would it be to write/port it? what is your coding/programming opinions on this?, example of an open source plugin for winamp is greenshift (http://www.greenshift.net) and this question is for all programmers.
ps! i know that whitecap (http://soundspectrum.com/whitecap/) and g-force (http://soundspectrum.com/g-force/) are better looking open source plugins but they are not only available for winamp.
i posted this over in the visualization contest thread, but gamester17 thought it might get more reponses in here...
i have a vis that i am working on right now. i have it working perfectly as a standalone xbox app, but having trouble converting it to a dll (vis) file for xmbc to load. i copied the spectrum visualization solution as a base, and modified the source to use my files. i am using more directx functions than the spectum xbox_dx8.lib is exporting, so i added the functions i needed to the def file, ran makelib.bat, and managed to get it to compile fine.
so far so good, but when i moved it on to the xbox to try out, nothing happens (with feb 12 build that is--with older builds, the xbox crashes/locks up).
i'm pretty much at a loss here on how to proceed. like i said, it works perfectly as a standalone xbe, so i'm not exactly sure why xbmc is having trouble with it.
it's based on a full particle system, so it should be pretty easy to tweak a few variables here and there and get a pretty wide range of different visualizations.
if anyone has any advice on what steps i should try next, i'd love to hear them.
ok, i've made a little more progress. the particlesystem was a class. as soon as xmbc entered the constructor (which was called in create()), the xbox crashed. not sure if you're not allowed to use classes in extern "c" functions (kind of new to this), so i rewrote it to just be functions and variables (no longer a class). now it doesn't crash xbmc, but still nothing renders to the screen (it still works fine as an xbe).
i did notice that xbmc exports d3dsetrenderstate (why?). for now i'm using: pd3ddevice->setrenderstate so maybe that is the trouble. i will try replacing the setrenderstate calls with d3dsetrenderstate, but if this doesn't work, then i'm once again out of ideas.
on a side note, calling pd3ddevice->createtexturefromfile crashes the xbox (maybe my path is wrong? i'm using q:\\visualisations\\particle.bmp as the path to a file called particle.bmp that exists in the visualisations folder). the function works fine in a standalone xbe, so not sure what is going on there either, but for now i am just trying to get the vis working without the texture. i will cross that bridge once i get over the current one...
let's hope someone with more knowledge can help you if your stuck! i would like to see a nice new viz! so, don't give up... ;-)
Gamester17
2004-02-16, 17:12
i'm not a developer/programmer myself but i suggest you try with jmarshall recommended and first try to add it to xbmp (https://sourceforge.net/projects/xbplayer/), or? ???
Gamester17
2004-02-17, 18:41
@nmrs, see you uploaded the first source code revision of your xbmc vis contest entry ("fountain"). fyi, frodo is looking through the code.
for all devs,
i updated the interface a bit
now you get the name of the visualisation and the name of the current song
see 1st page of this thread or the sources in cvs for more details
frodo
Gamester17
2004-02-18, 16:49
now you get the name of the visualisation
as i understand it with this update the visualisation now also get the file name of the .viz and used the correspoding .xml filename so renaming "spectrum.vis" to "spectrum-whatever.vis" would mean that "spectrum-whatever.vis" will use "spectrum-whatever.xml" (instead of "spectrum.xml" as it was hardcoded to do before), "spectrum-whatever" would then also be selectable from the gui. this means that end-users can have more than one version of the same visualization with a different xml for each, this is great for visualization with many parameter options such a jm's spectrum analyser as end-users can edit and share their prefered preferences.
ex. of what the visualisations folder could look like with this function:
goom.vis
goom.xml
goom my-edit.vis
goom my-edit.xml
spectrum.vis
spectrum.xml
spectrum-whatever.vis
spectrum-whatever.xml
spectrum - cool blue.vis
spectrum - cool blue.xml
spectrum - red orange.vis
spectrum - red orange.xml
fountain.vis
fountain.xml
fountain my xml edit.vis
fountain my xml edit.xml
has anyone got some nice links on the basics of working with audio samples in a similar wayto that used in xbmc vis plugins? or maybe some quick examples (like getting the current volume)?
i've finally got the basics of the d3d stuff working and realised i know nothing about the way the audio part works :)
any help greatly appreciated
questor/fused
2004-03-02, 01:11
as is see, in xbmc you get the audio-stream as short-values. meaning every short is a sample-value and 44100 values are played in one second on one channel. in the example(goomvis) is clipping included, but don't know why (the value-range of one sample should be -32768..32768). perhaps to make the plot "more interessting".
now you can use every sample-value as one input-value (like goom or g-force) or you can calculate the different frequencies the sample is based on (thats for what the fft is needed :) ).
calculating the volume of a whole song is not possible in xbmc, because you always get only the samples from 0.1 second or something like this (not the whole thing).
but start is called everytime a new song starts (just found out, that was my mem-leak ;) ), so you can use some values to track something played so far....
hope that helps....
---=Snyper=---
2004-03-03, 13:37
just wanting to know if i could get the source for the fountain.vis
and no im not going make changes and then try to take any credit.. i jsut want to make so changes for my self and if you like it, have at it.. i could care less about "credit"
thanks
snyper
of course you can. that's what open source is all about. they are in cvs here:
xbmc/xbmc/visualizations/sources/fountain.zip
---=Snyper=---
2004-03-03, 15:19
lol my bad.. i looked and looked.. *http://www.xboxmediaplayer.de/forums/non-cgi/emoticons/tounge.gif
goes to show you i need sleep..
thanks
edit: now that i think of it.. i was looking in the damn xbmp cvs... rofl
Gamester17
2004-03-03, 18:06
i found these browsing nvidia's developers website (http://developer.nvidia.com), not sure if it can be used by audio vis devs but here you go anyway:
fast math routines http://developer.nvidia.com/object/fast_math_routines.html
entire nvidia directx8 sdk 5.0 http://developer.nvidia.com/object/nvidia_dx8_sdk.html
nvidia audio sdk http://developer.nvidia.com/object/nvidia_audio_sdk.html
nvidia audio - generate compelling audio effects http://developer.nvidia.com/object/docs_audio.html
nvidia developers websites: * http://developer.nvidia.com * and * http://nvdeveloper.nvidia.com
http://www.gpgpu.org/
microsoft directx reference for developers http://msdn.microsoft.com/library....8000410 (http://msdn.microsoft.com/library/default.asp?url=/nhp/default.asp?contentid=28000410)
nvidia's list of recommended developer sites and documentation
http://developer.nvidia.com/object/web_print_resources.html
general-purpose computation using graphics hardware
math and graphics sites:
wolfram research - an extensive mathematics resource http://mathworld.wolfram.com/
platonic realms - interactive mathematics encyclopedia and more!
http://www.mathacademy.com/platonic_realms/platohom.html
visual dictionary of special plane curves (in.c good links to other math sites) http://www.best.com/~xah....es.html (http://www.best.com/~xah/specialplanecurves_dir/specialplanecurves.html)
the geometry junkyard - a large collection of stuff http://www.ics.uci.edu/~eppstein/junkyard
ok, i'm getting closer, but maybe someone here can help me.
i'm not getting the depth of stuff rendered properly and its driving me mad :)
if you take a look at this screenshot:
screwed up vis (http://www.random-works.co.uk/visaaargh.jpg)
you can see what i mean.
its just drawing on top of whats there regardless of 3d position. stuff to the right of a row is drawn on whats already been drawn on the left and when drawing a row behind the front one it appears on top of it!
i'm using the spectrum/fountain code as a base and i've checked my winding of verticies. checked the culling and that seems fine and tried with/without z buffer enabled.
any ideas?
Gamester17
2004-04-07, 18:20
@mynci, suggest you post new separate topic in the development frorom to get more attention, (as this thread is for vis interface dev only)
@mynci, suggest you post new separate topic in the development frorom to get more attention, (as this thread is for vis interface dev only)
this was fixed in the main xbmc cvs a while back, but thanks anyway :)
don't think i'm gonna have my vis doing everything i want by the weekend, but i'll have something ready.
there's been discussion in the g-force thread about adding fps to g-force. i was thinking that rather than having questor add framerate to g-force, it should be added to xbmc itself, that way all vis's could benefit from it. a bool could just be added to vis_info struct:
struct vis_info
{
* * * * * * bool bwantsfreq;
* * * * * * int isyncdelay;
* * * * * * bool bdisplayframerate;
};
that way vis's themselves could still determine whether it was being shown (probably from setting in xml), but all vis maker's wouldn't have to duplicate this code.
fps calculations aren't all the complicated really. it would be pretty easy to have the app overlay a fps count on the screen while running the vis, but that would mean the vis author has no control over positioning and style of it.
another alternative is to have the app calculate the frame rate and pass the number into the vis once per frame (this can be done with the audio data update which is now once per frame). it can also pass in sync delay here (as this can vary quite a lot if playing an internet stream).
edit: basicaly what i'm proposing is changing
void audiodata(short* paudiodata, int iaudiodatalength, float *pfreqdata, int ifreqdatalength)
to
void audiodata(short* paudiodata, int iaudiodatalength, float *pfreqdata, int ifreqdatalength, float fsyncdelay, float ffps)
i say screw the authors in this case :)
this sounds like a nice osd toggable option, for now, since we dont have a osd, it could be toggable with title or something
i just realized something. it would be alot more logical if this fps display inherited the info button, and the old popping up info was on title
i sort of agree with pike--i think it should be part of the audio osd. it also think it would be nice to update the audio osd to display artist and song next to the album image. something along the lines of what is shown in the second image from the g-force screen shots:
http://soundspectrum.com/g-force/screenshots.html
i think centralizing the osd as much as possible will give a more cohesive look to xbmc--if all vis makers have to come up with their own osd metaphors, things could get messy.
visualistion interface now updated to pass in the pixel ratio of the current screen resolution on visualisation creation.
void (__cdecl* create)(lpdirect3ddevice8 pd3ddevice, int iposx, int iposy, int iwidth, int iheight, const char* szvisualisation, float pixelratio);
i'm having a problem while trying to make a vis for xbmc..
drawindexedprimitive somehow doesn't work. i tested the same code on windows and in a standalone xbe and both work fine, but when ran as an xbmc vis i get a blank screen.
no crashes and the framerate is 50 fps. the regular drawprimitive worked, but i need drawindexedprimitive. it can't be a memory issue because the index buffer is only 12 bytes large ;)
any ideas what could be causing this?
could it be some renderstate that i'm forgetting?
all clues are welcome, i've been trying to figure it out for about a day but i can't get it to work :(
edit: i solved it for now using drawindexedprimitiveup. i guess there's not much use for vertex- and index buffers anyway on xbox.. now i got some rewriting to do, all my existing code uses them ;)
here's a first screenie of my vis if anyone's interested.. just a little test. i'm still working on porting my existing 3d engine but most of the stuff seems to be working now so soon i can start on the real stuff! :)
http://img401.imageshack.us/img401/2905/screenshot0014mz.jpg
jiz_king
2005-10-15, 12:47
i'm looking forwared to seeing what you can do.
looks good from what we can see so far.
j.
fullscreen screenshot would be nice :o
here's a fullscreen screenie then.. really not that much to be seen yet ;)
http://img426.imageshack.us/img426/1880/screenshot0131oh.jpg
i'm having some trouble getting the audio data to work with my existing fft code (which was originally written for a winamp2 plugin).
so i have some questions about the function audiodata(short* paudiodata, int iaudiodatalength, float *pfreqdata, int ifreqdatalength)
how is the format of paudiodata? is it 1 short left channel, 1 short right channel, 1 left, 1 right, etc.. or iaudiodatalength/2 times left and then iaudiodatalength/2 times right?
how often is it called? once for every call to render(), or when audio data becomes available? how often is that in that case, and about how big is iaudiodatalength usually?
there, lots of questions ;)
(ps i have no idea how to output debug strings or i would've figured it out myself ;))
i would love to help you. you know that sources for all viz'es are in cvs ? http://cvs.sourceforge.net/viewcvs.py/xbmc/xbmc/docs/visualisations/
maybe some clues there ? :cool:
Bobbin007
2005-10-15, 14:57
i have no idea how to output debug strings or i would've figured it out myself ;)
i have no idea how to help you with the other stuff, but you can always use printf inside a dll to get debug output.
greets
bobbin007
snq, this plugin ?!? (http://nicov.com/eonic/)
:bowdown:
i have no idea how to output debug strings or i would've figured it out myself ;)
i have no idea how to help you with the other stuff, but you can always use printf inside a dll to get debug output.
greets
bobbin007
where do i see the output in that case?
i tried just doing printf("test") but nothing shows up on the screen..
anyway, i got the audio processing stuff pretty much sorted now.. unfortunately the power goes down over here about once every 10 minutes, makes testing kind of a pita :( the fact that i have to run around between the bedroom where i have my pc and the livingroom where i have my xbox doesn't make things easier either :)
snq, this plugin ?!? (http://nicov.com/eonic/)
:bowdown:
hehe, yea that's an old one :lol:
i completely forgot i had that page. ".... this new, soon to be released version ...." hehe.. i never released anything :d
that's not the one i'm taking the code from tho because it uses opengl..
but i got a couple more plugins ;)
eonic2
http://download.nullsoft.com/customize/component/2001/10/31/p/large_image/eonic_2.jpg
cubes
http://download.nullsoft.com/customize/component/2003/4/14/p/large_image/cubes_visualization_for_wa2.jpg
btw, wasn't it you that contacted me a couple of years ago about porting the cubes one for xbmp? i didn't have an xbox back then, i finally bought one last week :)
Bobbin007
2005-10-15, 16:12
i have no idea how to output debug strings or i would've figured it out myself ;)
i have no idea how to help you with the other stuff, but you can always use printf inside a dll to get debug output.
where do i see the output in that case?
i tried just doing printf("test") but nothing shows up on the screen..
the output of the printf statement is written to the logfile (q:\xbmc.log) if you have set the log level to debug in xboxmediacenter.xml. if your xbox is attached to the vs.net debugger its also written to the debug output window.
greets
bobbin007
@snq, yeah, i got a crap memory, but i know i tried to contact lots of viz makers back then
glad you "saw the light" and got yourself an xbox :) some real 3d vizes would be nice, milkdrop is 90% cpu i've been told.
would also be nice to get eonic/2 later maybe, hehe
btw, mrc is probably fluent with our vis-api by now, let's hope he finds this thread soon'ish so you can get some help. i read over at winamp forums you like well documented things, sadly our devs dont have time to do both (dev & document)
lycka till
yea i kinda felt like some 3d action was missing ;)
eonic2 for xbmc is unfortunately impossible because i don't own the code.. i got paid for making that one :) but maybe cubes, that might be a good start.
i'm gonna have to write some kind of test framework so i can run the code on my pc, running around thru the house is driving me nuts and i don't want to move either the pc or the xbox.. and it will for sure drive my gf nuts as well when she gets back next week if i'm running back and forward between the bedroom and the livingroom like 20 times per hour ;)
not much to complain about docs here.. i got most info i needed from this thread and from the sources available. developing for winamp3 was a total disaster :)
Gamester17
2005-10-15, 18:38
@snq, have you setup a xdk debug enviroment on your xbox (debug-bios and xdk-launcher/dashboard) so that you can debug over network via visual studio .net 7.1 on your pc?
http://xbox-scene.com/articles/debug-xdk.php
http://www.hydras-world.com/index.php?page=xboxretailtodebug
http://xbox-scene.com/tutorials.php?p=503|#503
http://www.xboxmediaplayer.de/cgi-bin....;t=2113 (http://www.xboxmediaplayer.de/cgi-bin/forums/ikonboard.pl?act=st;f=5;t=2113)
no i haven't set up a debug environment.. as i said i only got an xbox last week so i'm quite a newbie. i bought it mainly for playing games and having a media center so i don't want to risk screwing it up by trying out things i don't understand yet ;)
developing has a lower priority than the rest right now (got enough non-xbox developing to do for work :)), but i'll read up on converting it to a developers xbox and see what i'll do. it would for sure be quite handy. for now i just finished a piece of code that lets me put text on the screen, i'll use that for debugging.
Gamester17
2005-10-16, 10:41
i don't want to risk screwing it up by trying out things i don't understand yet ;)
the "phoenix bios loader" way of running a xdk-debug-enviroment on a xbox is 'non-intrusive', you simply launch the enviroment like any xbox-application or game: so you want to make a retail xbox into an xdk debug, but don't want to switch bios banks, don't have a chip with 512k+ capacity, don't want to mess up your evox/other dash, and still want to be able to play backups and retail games? easy!
this method will allow you to run the xdk dashboard alongside your regular dash, with no interference or side-effects, no need to flash your bios or switch banks, and is launchable directly from evox/your favourite dash.just make sure you read through all the instructions in these guides to get an overall understanding before start and you should have no problems at all :d
ps! know that there several derivatives and alternatves to "phoenix bios loader (http://xbox-scene.com/software/software.php?page=exploits)"; such as "frosted bios loader", "nkpatcher", "pbl - the metoo edition" and "pbl-lite" (http://xbox-scene.com/software/software.php?page=exploits)
edit: ...however if you insist on not using xdk and debug-bios to help you then you might still find xdebugserver (by blackbelt) (http://prdownloads.sourceforge.net/xbplayer/xdebug_0_99.zip) interesting :saint:
(the xdebugserver is a debug-server for developers without debug-bios and what our developers used before debug-bioses was available).
@snq
great work so far mate, your vis is looking very cool.
the problem you were having with drawindexedprimitive not working is because xbmc doesn't currently support it. i have tried to add it but it is currently crashing for some unknown reason.
i have added drawindexedvertices support to xbmc so you might want to get latest code from cvs and try using that instead of drawindexedprimitiveup, it should be a lot faster with large meshes. drawindexedprimitive uses drawindexedvertices anyway.
btw, if you need any d3d functions that are not currently supported you can add them in exports_xbox_dx8.cpp. any functions that you try to use that are not supported will be shown in the log file.
let me know if you have any other probelms or if there is anything that i can help you with.
cheers
mrc
drawindexedprimitive now supported with latest code in cvs.
calling convention is slightly different. you need to use d3ddrawindexedprimitive instead of calling it on the device and *it needs externed and added to your xbox_dx8.def file used to build your lib.
eg.
extern "c" void d3ddrawindexedprimitive(d3dprimitivetype primtype, unsigned int minindex, unsigned int numvertices, unsigned int startindex, unsigned int primcount);
void render()
{
* *g_pd3ddevice->setvertexshader(d3dfvf_myvertex);
* *g_pd3ddevice->setstreamsource(0, g_vertexbuffer,sizeof(myvertex));
* *g_pd3ddevice->setindices(g_indexbuffer, 0);
* *d3ddrawindexedprimitive(d3dpt_linestrip, 0, 0, 0, 3);
}
and in your xbox_dx8.def you need to add:
d3ddrawindexedprimitive
hope that helps.
mrc
@mrc
thanks!
while you're at it, could you add support for the visibility testing functions?
idirect3ddevice8::beginvisibilitytest
idirect3ddevice8::endvisibilitytest
idirect3ddevice8::getvisibilitytestresult
i was hoping to do some neat flare effects using that, it would be great if those functions were supported :)
tia!
idirect3ddevice8::beginvisibilitytest
idirect3ddevice8::endvisibilitytest
idirect3ddevice8::getvisibilitytestresult
are all now supported.
let me know if you need anything else.
mrc
thanks again!
i got pretty sick of running around thru the house while testing, so i decided to make a windows app for testing plugins.. which was of course easier said than done ;)
the goal is to have an app that can run (or at least try to run) existing .vis files without any further changes needed. it's kind of a pain in the ass because the dx8 sdk and xbox sdk use completely different enums, so basically eg every renderstate needs to be translated to pc constants, but i've come a long way with that..
i made my own xbox_dx8.dll which contains all the d3d stuff and does all the translating. the only problem i'm still looking for a solution for is that textures are never swizzled on pc afaik. and of course some stuff is just not supported on pc.
but, to give you an idea, below is a screenshot of what i got so far. the flare in the middle is buggy, i'm working on that. what it loads it the exact same .vis file as i would upload to my xbox. the only thing i did is temporarily remove the texture swizzling because right now i'm working on the drawing functions.
full source will be released when it's more stable :)
http://img368.imageshack.us/img368/3718/xbmcvistester8qg.jpg
a little update.. i added support for swizzled texture formats now.
there's some problems tho. for example creating vertex buffers on xbox requires a lot less parameters than on pc, and it's quite hard to guess the right values from the exported functions.
also d3d on xbox doesn't require unlocking of e.g. textures so i have to keep track of that myself as well.
but, at least i can run my own vis now, without needing to recompile anything :)
http://img403.imageshack.us/img403/1706/xbmcvistester24dp.jpg
think i just creamed my pants here :blush:
i dont wear pants so im in a right mess :blush:
just wanted to let u guys know my little project is not dead ;)
here's some new screenshots:
http://gallery.volvo240.org/v/misc/xbmcvis/
http://gallery.volvo240.org/d/2154-1/screenshot041.jpg
http://gallery.volvo240.org/d/2148-2/screenshot039.jpg
i was wondering about something... if i want to release this thing later on, do i *need* to release the sources as well? because that might be a problem.
for legal stuff with the xdk it shouldn't be a problem, the thing would theoretically be able to compile just fine even without the xdk i guess. but i was thinking are there any requirements for xbmc?
problem is that not all of the sources are mine, i took some stuff from the company i work for and needless to say that's not allowed to go public. and i don't exactly feel like rewriting those things either :)
i was wondering about something... if i want to release this thing later on,
:shocked: let's hope you'll release the vis - any way it plays out :)
for stuff to be in cvs, i *think* sourcecode is required. but i'm not an expert on this topic, we just always played it this way
an alternative would be for users to get your .vis separetely i guess.
let's see what gamester17 thinks
i will release it of course, it's just a matter of time :)
what i could do is have the source partially available, and include the rest as .lib/.h, that shouldn't be a problem i think (for me anyway).
:bowdown: looks amazing!!!
very nice work :kickass:
Hullebulle
2005-10-24, 13:32
i was wondering about something... if i want to release this thing later on,
:shocked: let's hope you'll release the vis - any way it plays out :)
for stuff to be in cvs, i *think* sourcecode is required. but i'm not an expert on this topic, we just always played it this way
an alternative would be for users to get your .vis separetely i guess.
let's see what gamester17 thinks
no. that we are an opensource project doesn't mean everything has to be opensource.
if the code is unique (not based on another gpled project) it is ok to only have the compiled viz in our cvs and to keep the source unreleased.
looks like snq doesnt want to finish this.
gallery is gone, he hasnt logged onto these forums since nov 2005, and he refuses to answer my mails. fun guy....
shame he isnt listed in yellow pages, or id call him