kXd -- kX Project driver control plugin via PervTalk

Xlobby plugin development

kXd -- kX Project driver control plugin via PervTalk

Postby P3rv3rt B3ar on Fri Aug 04, 2006 5:37 am

Currently kXd is distributed with zoneskin3

kXd is PervTalk device which allows setting of register values in kX drivers DSP plugins. kX driver is freeware driver for Creative Labs' Live and Audigy soundcard suite. U can download newest release of kX driver from driverheaven.net forum. kXd also allows u perform "fades" on those registers, changing their values over time.

kX drivers and kXd open many new possibilities for XLobbyist armed with those particular cards. Most know of these must be controlling volume levels of different zones. However this tutorial present use of kXd for other purpose: mixing 5.1 channel analog audio, where first source is HTPC and the other source is external equibment. This can be accomplished with Live Drive and audigy cards equibbed with corresponding unit.

this is what we set to accomplish:


Image

but before we can start to go trough skin... we need to install PervHub, and xPerT if u havent done that yet. Check out the thread dedicated to PervTalk to accomplish this.

Next copy kXd to your PervWare folder. U need to also setup file called xxx.ini to your PervWare folder, where xxx is name choosed by u, "default.ini" is the default. Before going details of this file, u better take a look to your DSP though... mine looks like this:


Image
See those 3 stereo mixers on right hand side... registers inside those are the ones we plan to control. Take a note how every plugin has number in brackets, that is important when we fill our .ini file. This is not a tutorial how to build your own DSP so we rush on... Now its time to familiarize your self with kxctrl.exe commandline application which comes included with your kX driver bundle, that is father of kXd. look its help and find away to list information about DSP plugins, and there u will notice other piece of crucial information, address of registers (or sliders on plugins) in our stereo mixers case, these are 0x8002 and 0x8003. armed with this information we set to make our .ini file.

Theres two kind of beasts in .ini file aliases and fades. Aliases are human rememberable names for registers, and fades are collection of registers and their target positions:

Alias:DC:ID:RA

where Alias is name u wanna call this register, DC is dont care integer value reserved for later use, ID is number we saw in brackets on DSP plugins, and RA is the register adress we inspected with help of kxctrl. So .ini file should contain one of these lines per each sliders u intend to control.

Fade{
Alias1:target1
Alias2:target2
.
.
.
Aliasn:targetn
}

Also your .ini file can contain of any number of fades, these are like snapshots of DSP at some moment, containing any number of registers and their target positions, when fade is initialized, registers start to approaching their target positions. Above Fade is name u choose to address it, AliasX is certain register defined by u as alias (just use the name u gave) and target is integer in range [0-1000], that is to make giving value for register intuitive.

Im too sleepy now... have to continue from this after few hours of sleep... i also send software out for alpha testers after finishing these instructions...
Last edited by P3rv3rt B3ar on Fri Mar 02, 2007 12:42 pm, edited 1 time in total.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby P3rv3rt B3ar on Fri Aug 04, 2006 4:40 pm

Ok now finally back at the documentation duty. I tried to get it to alpha testers already yesterday, but i was hunting few bugs into morning and couldnt anymore document any further... but lets continue now fully rested.

So now u should know how .ini ile should look like in theory, here is example of my "default.ini" file for 6ch mixer:

Code: Select all
Aux Front:0:4:0x8002
Comp Front:0:4:0x8003
Aux Center/Sub:0:5:0x8002
Comp Center/Sub:0:5:0x8003
Aux Rear:0:6:0x8002
Comp Rear:0:6:0x8003
FadeToAux{
Aux Front:1000
Aux Center/Sub:1000
Aux Rear:1000
Comp Front:0
Comp Center/Sub:0
Comp Rear:0
}
FadeToComp{
Aux Front:0
Aux Center/Sub:0
Aux Rear:0
Comp Front:1000
Comp Center/Sub:1000
Comp Rear:1000
}



U should not that .ini file have to be perfectly correct for (alpha version of) kXd working correctly, so take your time double checking the formality of the file. Also note the aliases we have given for registers and fades, well be using them later in Xlobby skin.

So u should now have your .ini file ready. U can name it anyway u want. but if u name it to "default.ini" it will be the loaded when u dont give commanline parameters for kXd when launching it. U can have several different .ini files for different configurations. U tell kXd which configuration to load by setting commandline parameter. There is also other commandline attributes... usage of kXd is following:

kXd.exe Alias Config CN

where Alias is PervHub alias for this particular device, name PervHub can address this particular instance of kXd device. U can name it anyway u want, and it doesnt have huge effect unless u have several kXd devices running. Config is name of the configurations or .ini to be loaded, one we just made, without .ini extension. CN is number of card, if u just have one kX compatible card it should be 0. Note that u can put this line to autorun.ini of PervHub and kXd will be automaticly launched when u run your Xlobby, but in that case u have to leave .exe extension out. If u dont enter commandline parameters kXd will be launched with default values which are:

kXd0 default 0

Now its time to build the skin, lets have a look at it again to refresh our memory:


Image

Lets take the bars first. These are only debug bars, ill hope to make real graphics possible to beta version. These bars are just text fields accomplished with some WebDings magic. Theyre not pretty but pose huge challenge to skinners cause even they can be made look decent with creative skinning.

Also these bars respond your mouse clicks and change values of kX registers they describe accordingly.

Unfortunately, because of "recv lag" bug in xPerT, which im currently unable to fix, bars dont accurately present current situation of kX registers, but they do so with cumulative lag. As soon as i have new version of xPerT out this will be ok though. Also allthoug bars dont reflect current status correctly, but response in kX registers is instant when u click the bar. Anyway this bug hugely hinders testing, and i hope to get it fixed soon.

So how to make one of those register representing bar? lets take a look...

First bar in my example skin is text field which contains following text:

Code: Select all
plugins>xPerT>Variable>Comp Front>kX driver>Comp Front bar


now lets chew that in bitesize fashion. two of first parts are obvious, just regular plugin use. "Variable" is xPerT code word which refers to information which should be kept up to date. Next piece "Comp Front" just tells to updater what field needs to refreshed in xlobby screen, thats why ID in default page is also "Comp Front", neither it is accidently same than our alias in configuring ".ini" file, it needs to be same so that clicks targeting to it can be directed to right register. Next piece ("kX driver") simply refers to kXd, if u would be using other device there would be something else here. Finally "Comp Front bar" specifies variable we are fetching from kXd, format of this is your alias for register in .ini file +" bar".

Take a note that system might crash during inserting this text... and might be easier for u to set it while xPerT is not active.

Now u have to do three other tasks to get bar work just right:

1. Change font of text field to WebDings, so bar will look like a bar.
2. Resize the text field to match as exactly as possible so that 20 characters of your chosen font size just fit in it. This will quarantee more accurate cliks.
3. Name ID value on default tab to correspond your alias name for this particular register in ".ini" file

We will take a look on fades set on buttons on the skin in next post.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby P3rv3rt B3ar on Fri Aug 04, 2006 8:07 pm

Ok last pieces of documentation marathon on this one now...

So implementing fades is rather straighforward... u just need to make one event in setup and set it to the button, when user click the button, fade is initialized. on my fade to aux event there is just single command:

xPerT

Delegate

kX driver;Slide;FadeToAux>10>6

Thats is what u should see in events menu... select plugin->command and then go for comboboxes, select options xPerT and Delegate from them and set above text on final line.

Ok now lets explain that... Delegate is xPerT command meant to command some PervTalk device to do something. format of command is:

Delegate;<device>;<command>;<parameters>

Notice that when entering this to XLobby Delegate is chosen from combobox and only rest of command is written out, in that case ';' between command and device is omitted.

"device" in our example is kX driver, but can be any other of installed PervTalk devices as long as "command" belongs to vocabulary of device. "command" in our example is Slide which is for initiating fades in kXd. Notice that parameters are separater from each other with XLobby style of notation, first parameter in our example specifies name of the Fade (remember these are in your ".ini" file) to be carried out. Second parameter specifies how long fade should take in seconds. take a note that it always lasts longer than that. All together it takes this time + time it takes for machine to perform those instructions. Last parameters tells how many steps there are in the fade... ofcourse adding more steps makes fade more natural, but also consumes more resources and at some degree adds to total time of the fade... try to balance these parameters until u find ne u r looking for. Mine is not good at all, i just put something to perform some tests... i need to set more steps and take the time down...
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby P3rv3rt B3ar on Tue Aug 08, 2006 1:13 am

If there is kind souls out there, whos keen on doing some alpha testing for me, i could still send few more copies out.

(Incase theres too much interest, owners of two or more kX compatible cards are preferred, otherwise FIFO principle is applied in selection.)
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby P3rv3rt B3ar on Thu Aug 10, 2006 4:18 am

New version available for alpha testers

Command line support for launching fades was added. So now kXd is not just PervTalk device but it can also be used as independent software. Allthough this way it can only launch fades. So independent mode is not planned for XLobby users as way to avoid installing xPerT and PervHub. Theres two reasons why command line operation was added:

- To ease testing, now u dont have to make everything ready (even XLobby skin) to just test fades in your .ini file. But u can just setup kXd make your .ini file and start testing fades right away. If these work, then do the rest of setupping and design skin for XLobby.

- To allow kX forum users, who dont use Xlobby to benefit from kXd. Surely they have kxctrl, but based on my empirical testing making batch files which uses kxctrl and using that aproach to implement fades, just aint fast enough.

and then finally the usage:

Code: Select all
kXd fade file card time steps


where "fade" is alias of fade to be performed (notice that if u plan to use command line do not put spaces in your aliases),

and "file" tells the .ini file where to find this particular fade. (without .ini extension as usual)

"card" is the number of your kX-compatible sound card, most commonly 0.

"time" is added time in seconds fade should last.

and finally "steps" are how many separate levels are gone trough during the fade.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby P3rv3rt B3ar on Sat Sep 30, 2006 2:56 pm

I guess i own explanation for alpha testers why i haven't been active with the project lately. Reason was my health situation. Shortly after releasing kXd for testing it became apparent as huge surprise to me that i had something on my body which needed immeadiate removal. Worrying about nature of situation caused me to loose interest on certain things and made for example software development extremely hard. So now that shadow of hades has lifted from my shoulders its time to continuwe the project.

However this doesnt mean that theres any hurry on testing, cause public beta release is pending on release of new version of xPerT, which ive lost motivation for awhile cause of bog of bugs. New version of xPerT is needed to support decent bars. Current character based bars are for debugging only.

For now kXd alpha testers should use version 0.91 of xPerT, allthough it has its share of bugs (for example deepcat bug), these however shouldnt affect on functionality needed for kXd testing.

Ive myself tried kXd on j and k release of kx drivers and it seems to be working fine with both. Im interested to know if it works as well with new l release.

I will place a bid for second live card today, and if ill win the auction, we can realy boost two card testing.

Next thing to be developed in kXd will be controlling of ac-97 part of kX mixer... if u want more background info about this, check my thread on kx forums
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby scalt on Tue Oct 10, 2006 4:13 am

Hello

I wanted to test out kXd, but I can't seem to find PervHub anywhere. Looked everywhere I could think of, but can't seem to find a link where I could download it!

Thanks
scalt
 
Posts: 75
Joined: Tue Dec 06, 2005 10:53 pm

Postby P3rv3rt B3ar on Tue Oct 10, 2006 9:00 am

Yes, its still on alpha test phase, so u didnt find pervhub or kXd cause theyre not publicly available yet.

but im happily accepting more alphatesters. So if u think u are able to run me some tests and provide feedback let me know how to contact u and ill inform u about details how to get the files.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby scalt on Thu Oct 12, 2006 8:17 pm

Hi

I'd like to try it out. You can reach me at "*** [at] ***** . com"

Also, does it support multiple cards? I have two Audigy2 ZS cards in my system that are used to provide 6 zones.

Thanks

edit : edited out e-mail
Last edited by scalt on Tue Oct 24, 2006 10:07 pm, edited 1 time in total.
scalt
 
Posts: 75
Joined: Tue Dec 06, 2005 10:53 pm

Postby P3rv3rt B3ar on Thu Oct 12, 2006 9:48 pm

Hi, sorry about delay... been trying to read for exam and not prowling on forums as much as usual... But ill mail u details right away.

Also it should support two cards, but that is so far totally untested (i didnt win the bid for second card, so im stuck only with my original one). Tell me when u have system setup (which is btw your first testcase) and ill give u afterwards details about using two cards.

Other setup and usage details u should be able to find on this thread and thread about xPerT plugin/ pervtalk. If something remains unclear dont hesitate to ask (either by mail or here on forum, question which can benefit others, should be asked rather here, and its safe to say u can expect faster response here on forum... but use your own judgement) however because of upcoming exam be prepared to wait answer for a while.

Also atleast first (until u get feeling of system) use kXd only to command kX plugins called "stereo mixers" those are only one ive tested and now i have reasons to believe that other kX plugins dont necessarily work similar way, like i believed first. If it indeed turns out that other plugins dont work correctly some changes (not too big) are needed in code. That is something still left to experiment.

Note that u should use version 0.91 of xPerT (allthough buggy in deep-cat processing) it is certainly less buggy of released versions when it comes to interaction with kXd.
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby scalt on Tue Oct 24, 2006 10:24 pm

Hi

My setup is a bit "special". First of all, I am using 2 Audigy 2 ZS for 6 zones (actually only using 4 right now, but I have a 6 zone amp and I'm planning on adding the 2 others). Also, i'm using the latest KX drivers, 3538l.

The "special" part of my setup regards the multi-zone control. I am using "Virtual Audio Cables" (http://software.muzychenko.net/eng/vac.html) with the WinAmp line-in plug-in. This allows me complete independent control between the "players" (ie. Music, DVD, Video, Radio) and the zones.

So back to my use of the plug-in, I'd like to be able to control a "10 Band Eq" plug in for each of my outputs. However, I could always add another stereo mix plug in in-line to simplify kXd use. But basically, I'd like to have sliders control the volume of each zone.

Also, the addresses for my different cards are [a000] and [a800], if that will be relevant to 2 card use.
scalt
 
Posts: 75
Joined: Tue Dec 06, 2005 10:53 pm

Postby P3rv3rt B3ar on Wed Oct 25, 2006 7:33 pm

I took a look at that VAC, very interesting piece of software indeed. With that it seems to be easy to add party channel without wasting a real output for that.

BTW did i understand right it cant intercept audio output stream unless software in question allows it to be set on virtual cable? cause if im wrong it could solve pandora zoning problem...

Only reason id like u to add stereomixer is so u can test kXd first with it, so we can confirm that its correctly setup and working on your system, and also to give u feel how kXd works. If u get that working ill give instructions for 2 card use, and u can also test 10 channel eq... if it doesnt work ill change code so it will, i also need to make it with work with "thedelay" plugin for meself...
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby P3rv3rt B3ar on Thu Oct 26, 2006 9:56 am

Thanks for bringing VAC into my attention. been thinking whole night how i could practically abuse this software in my htpc, ive been trying hard to make a case against myself not to buy it, but i have to say im loosing very fast cause possibilities it presents are tremendous.

Here is me thinking out loud:

1) As mention before some of cards, like my live! have as many physical output connections as they have output ports, that means if they are used in zoning u need to waste one output port for party zone which means ull end up with one useless physical output. By creating virtual output port which connects to each real output port of the card as party zone, u can avoid this and have four real zones + party zone out of live card.

2) Above concept taken little further gives u possibility to separate concepts of zones and rooms altogether. Rooms are represented with real output ports, while zones or "virtual zones" rather are represented by virtual audio cables. Also there would exists one player instance per zone, not per room, and to which zone room belongs to could be controlled from Xlobby with plugin to VAC (or actually audio repeater).

3) Because of its capability to interface between dshow pins and input/output ports it can bring some of those hardware pieces which otherwise are non accessible to general software available. For example i have old timer tv-card in my system, it has ADC but its currently unusable for many software cause it doesnt appear on list of input ports (currently im loopin it back to soundcard) yet it has dshow filters with audio in pin, if i hook this pin up with a virtual cable in graphedit and run the graph then i wont need loop back cable cause it is available for software trough virtual cable.

As those werent strong enough points for support buying of software but im still very curious about your setup. I understanded u route each software trough winamp. Im curious which are practical advantages of this arangement? i can see it makes whole system conceptualy more neat, and for me thats enough, but im still keen to hear can u get practical benefits out of that arangement?
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Postby scalt on Thu Oct 26, 2006 7:26 pm

First of all, let me remind you that you can download the demo on the website. It's fully functional (from what I remember...might be a limit on the number of cables) except for a voice looping in the cable. Every 10-15 seconds you hear a women saying something like "testing"

Now the main reason I am using this setup is for synchronization purposes. At first when I started using XLobby, I couldn't get everything to sync perfectly, which is a must for me because my different zones are adjacent in my house. I also wanted to be able to conveniently sync different zones together when I wasn't using a music player (ei WinAmp or foobar).

So basically, what I can get now is complete control on how I match my "sources" (Music Player 1, Music Player 2, DVD Player, Video Player, TV Tuner, Radio Tuner) and my zones (A, B, C, D, E). The way I do this is that I created 6 virtual audio cables for each of my sources and I can then point my zones to the corresponding source.

At first I was (and still am most likely) planning to do this by using the Line-In plugin for WinAmp (http://home.hccnet.nl/th.v.d.gronde/dev/lineinWA2/index.html). I chose to do this since WinAmp control was included in XLobby. The main issue with this is the trouble I have with volume control of different zones without changing to the said zone (a feature I know has been asked for in the past). Also, i can consume alot of resources, but by using the lite version of winamp, it isn't that much of an issue, especially when you have enough RAM.

Now what I am contemplating on doing is use your kXd plug-in for the volume control of the different zones and maybe use the Audio Repeater. The problem with the audio repeater is that it can't be started remotely or changed once started. I e-mailed the creator yesterday about this and he told me he would add a command line interface so you can specify the parameters at start-up. However, there wouldn't be a way to change the associations (ie VAC1 to Zone D) once started. The only way to get around that would be to close the instance of the audio repeater and open a new one every time the associations would change. This is why I'm still contemplating using WinAmp w/ the line-in plug-in for my zone control.

Another cool thing in the new version (4) of VAC is that it is compatible with volume control. This allows me to have a "master volume" when I control the source and to tweak the different volumes of the zones independently.

P.S. I'm going to try to use kXd with XLobby tonight. I tried using the command line interface. It would load up properly, but would crash whenever I tried a face. I am also just using the Stereo Mixer. However, after doing a little digging around, the 10 Band EQ seems alot more complicated then the Stereo Mixer, but the Stereo Volume plugin ("St Vol") seems as easy and would do the job fine for my purposes.
scalt
 
Posts: 75
Joined: Tue Dec 06, 2005 10:53 pm

Postby P3rv3rt B3ar on Thu Oct 26, 2006 10:45 pm

scalt wrote:
Now what I am contemplating on doing is use your kXd plug-in for the volume control of the different zones and maybe use the Audio Repeater. The problem with the audio repeater is that it can't be started remotely or changed once started. I e-mailed the creator yesterday about this and he told me he would add a command line interface so you can specify the parameters at start-up. However, there wouldn't be a way to change the associations (ie VAC1 to Zone D) once started. The only way to get around that would be to close the instance of the audio repeater and open a new one every time the associations would change. This is why I'm still contemplating using WinAmp w/ the line-in plug-in for my zone control.


Very well done... cause controlling Audio Repeater was the part i was worrying when imagining my future virtual zones setup, which actually seems exatly what u r doing.

P.S. I'm going to try to use kXd with XLobby tonight. I tried using the command line interface. It would load up properly, but would crash whenever I tried a face. I am also just using the Stereo Mixer. However, after doing a little digging around, the 10 Band EQ seems alot more complicated then the Stereo Mixer, but the Stereo Volume plugin ("St Vol") seems as easy and would do the job fine for my purposes.


mayby the crash could be because .ini file have to be exactly certain form, alpha version isn't forgiving at all, but it might be a bug as well... mayby u could post your .ini file to me...

Anyway... i spent whole day developing new mixer program, which be called "MiXd" its coming along quite nicely. it will be much like kXd but it will allow controlling any soundcard not just kX compatible ones. It originates from my need to control kX's AC97 part, and also onboard soundcard. So i decided kill two flies at once and engage making general mixer control plugin, kX users will need it to control AC97, but it cannot control kX plugins, so it doesnt replace kXd but completes it. It can also be used to control levels of VAC cables...
P3rv3rt B3ar
 
Posts: 1364
Joined: Fri Apr 07, 2006 9:52 pm
Location: West Coast Funland

Next