HardwareHeaven.com
Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   HardwareHeaven.com > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > General Discussion


Reply
 
Thread Tools
Old Jun 1, 2005, 05:20 PM   #1
DriverHeaven Newbie
 
Join Date: Mar 2005
Posts: 9
Rep Power: 0
GregC is on a distinguished road

Using kxctrl to swap front and rear output

Hi

Can anyone give me the kxctrl commands to switch or set the front and read output (I'm using k1lt for output).. or at least if someone knows of a kxctrl tutorial?

Tnx
GregC is offline   Reply With Quote


Old Jun 2, 2005, 12:28 PM Threadstarter Thread Starter   #2
DriverHeaven Newbie
 
Join Date: Mar 2005
Posts: 9
Rep Power: 0
GregC is on a distinguished road

Nevermind, figured it out. I hoped someone who's familiar with kxmixer would help and save me a few hours, but oh well..
GregC is offline   Reply With Quote
Old Jun 3, 2005, 04:19 AM   #3
S-3D enthusiast
 
Tril's Avatar
 
Join Date: Sep 2004
Location: Canada
Posts: 1,675
Rep Power: 62
Tril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud of
System Specs

Why did you need to use kxctrl?

Couldn't you use the GUI of the mixer and click on "Toggle 'Swap Front and Ream' mode"?
Tril is offline   Reply With Quote
Old Jun 3, 2005, 05:00 AM   #4
Long Time ***** Friend
 
thomasabarnes's Avatar
 
Join Date: Jan 2003
Location: USA
Posts: 1,373
Rep Power: 58
thomasabarnes will become famous soon enough
System Specs

Quote:
Originally Posted by GregC
Nevermind, figured it out. I hoped someone who's familiar with kxmixer would help and save me a few hours, but oh well..
Hey man, this is a useful feature! If, you know how to use kXCtrl to swap front and rear speakers, now, why dont you share this information with the kX community? I want to know how to do this, and I'm sure others will find this info useful.
__________________

May a song always touch you in a positive way.
Sonar 8.5.3 PE, Windows 7 Pro 64Bit, MOTU UltraLite MK3, 150 GB HDD, 250 GB HDD, 1 TB HDD 7200 rpm,
My Music Production: Top 40, Contemporary Christian, Pop/Rock, Decent Rap, Inspirationals, and Children Songs
thomasabarnes is offline   Reply With Quote
Old Jun 3, 2005, 08:40 AM Threadstarter Thread Starter   #5
DriverHeaven Newbie
 
Join Date: Mar 2005
Posts: 9
Rep Power: 0
GregC is on a distinguished road

Quote:
Originally Posted by Tril
Why did you need to use kxctrl?

Couldn't you use the GUI of the mixer and click on "Toggle 'Swap Front and Ream' mode"?
Several reasons. I wanted to bind this toggle to a media key on my keyboard. I use a custom DSP config, so the GUI control doesn't work for me - I have to open the DSP and change the k1lt settings manually. So reason #1 would be, I'm too lazy to do that every time, as compared to just pressing something on the keyboard. But I probably wouldn't do it just for this reason, the second thing is my girlfriend sometimes wants to listen to some MP3's while she's on a cigarette break and if I leve my output set up to my rear speakers (where I have the headphones connected), she can't hear the music. I tried explaining to her how to change the setup, but was a mixture of 'can't' and 'won't' So now all she has to do is press a key and I'm off the hook.. Third reason, sometimes I want to play a game of warcraft and the game finds me a match, then when the game loads and I should be getting busy doing something, I figure out that nothing is coming out of my headphones so I have to alt+tab out of the game when nothing is happening (rarely), change the DSP config and come back, hoping I still have a base. And since it has happened to me that I pressed alt+tab accidentally during the game (with catastrophic results to my match), I got a program to disable it, using that thing there was NO way to switch my speaker config, other than forfeiting the match (sux). So now I wrote a batch file that starts my game and sets up my headphones like they should be, before the game starts.

Quote:
Originally Posted by thomasabarnes
Hey man, this is a useful feature! If, you know how to use kXCtrl to swap front and rear speakers, now, why dont you share this information with the kX community? I want to know how to do this, and I'm sure others will find this info useful.
Well since I use a custom config, I'm not sure my version of the commands would work for most people. Still, I'll explain what I did, shouldn't be too hard to customize it for yourself. Since I'm not familiar with kxctrl, the only way I managed to do it is through the commands that change the DSP connections. The syntax to connect two ports is: kxctrl -mc ID1 REG1 ID2 REG2

It's not really complicated, it means 'connect register REG1 of plugin ID1 to REG2 of plugin ID2'. To switch front&back, you need to change four connections (since it's stereo, 2x2=4 ). The ID part can be seen on the DSP, it's the number in brackets. The reg number can be found out by hovering the mouse over the register you want to change, a tooltip will pop up. Here's a picture of what I mean: http://freeweb.siol.net/gregc666/KXSetup.jpg

The four lines are those that I use to set the speakers to the config that is shown. The first line is explained, the rest should be easy to figure out. To reverse the config, swap the last two parameters between the pair of lines (so the lines from the first output go to the second output and vice-versa). Just think of it as connecting the lines manually, only you don't even have to use your mouse..

Once you know which lines you have to use, make a batch file to do it automatically. I wrote myself a simple .exe program that switches my config when I press the 'media' button on my keyboard, since I don't use it for anything else.
GregC is offline   Reply With Quote
Old Oct 23, 2005, 05:14 AM   #6
DriverHeaven Newbie
 
Join Date: Oct 2005
Location: Virginia, USA
Posts: 8
Rep Power: 0
mazdek is on a distinguished road

How does your batch know which way to change? Test the existence or content of a file?
__________________

mazdek is offline   Reply With Quote
Old Oct 23, 2005, 03:43 PM   #7
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Quote:
Originally Posted by mazdek
How does your batch know which way to change? Test the existence or content of a file?
The simple way to make a toggle is to use 3 batch files. You have 2 batch files, one containing the commands for your ON toggle, and the other containing the commands for your OFF toggle. Then you have the third batch file which you would bind to a key. In this batch file, you call one of the other batch files, and then rename them (so the names are swapped), and thus the next time file is run, the other batch file is used instead, etc. Alternatively, if you wanted to use 2 different keys, then you could simply use 2 different batch files, etc.

Another option is to use a scripting language like VB Script or Windows Scripting Host. Using a scripting language you could run kxctrl, retrieving the current settings that you want (redirect kxctrl's output to a file), read the file to determine the current settings, and use conditional statements to execute the correct kxctrl commands based on the current settings, etc.
Russ is offline   Reply With Quote
Old Oct 23, 2005, 05:48 PM Threadstarter Thread Starter   #8
DriverHeaven Newbie
 
Join Date: Mar 2005
Posts: 9
Rep Power: 0
GregC is on a distinguished road

I wrote a small executable which makes a config file, where the current configuration is written, this way it swaps the config if I just run the file, or sets it to a specific config if I include command line parameters (this is where batch files are not enough, they're fine if you just need the switch functionality). It was faster for me than trying to figure out how to check it directly with the driver.
GregC is offline   Reply With Quote
Old Oct 23, 2005, 05:58 PM   #9
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Also, aside from the above, if you have VC++, you can use the kX SDK to create an executable that works with kX directly (without going through kxctrl) to do what you want.
Russ is offline   Reply With Quote
Old Oct 23, 2005, 10:59 PM   #10
S-3D enthusiast
 
Tril's Avatar
 
Join Date: Sep 2004
Location: Canada
Posts: 1,675
Rep Power: 62
Tril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud of
System Specs

My suggestion is to save the two DSP to .kx files. You just have to execute the .kx file to load the corresponding DSP.

You could use c++ code :
Code:
static char path[ MAX_PATH ]; 
ShellExecute( GetForegroundWindow(), "Restore", path, NULL, NULL, SW_SHOWNORMAL );
Where path is the path to the .kx file you want to execute. The rest is straightforward.
Tril is offline   Reply With Quote
Old Oct 24, 2005, 12:45 PM   #11
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Although the above would work as well, you can do the same thing without the need for C++, using Windows shell commands, or using kxmixer's command line switches.

i.e.
Bind the following to a key (replacing 'saved_dsp.kx' with your saved config):
kxmixer --shell --load-settings saved_dsp.kx
Russ is offline   Reply With Quote
Old Oct 24, 2005, 02:09 PM   #12
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,606
Rep Power: 66
Max M. is a name known to allMax M. is a name known to allMax M. is a name known to allMax M. is a name known to allMax M. is a name known to allMax M. is a name known to all

to answer the initial question:
swap on: kxctrl -shw 4 1
swap off: kxctrl -shw 4 0
(but i guess this works only with default epilog)
Max M. is offline   Reply With Quote
Old Oct 24, 2005, 09:35 PM   #13
S-3D enthusiast
 
Tril's Avatar
 
Join Date: Sep 2004
Location: Canada
Posts: 1,675
Rep Power: 62
Tril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud ofTril has much to be proud of
System Specs

You are right Russ, the c++ code is not needed. Another suggestion :

Make two shortcuts to the two .kx files. Right-click the shortcuts one at a time and enter a shortcut key in the shortcut key case (e.g. ctrl + alt + 1, ctrl + alt + 2). Place them on the desktop or in the start menu of windows.

You can replace the .kx files by batch files that run the kxctrl commands.
Tril is offline   Reply With Quote
Old Oct 24, 2005, 09:39 PM   #14
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Good stuff, lots of options.

@Max M.
Are the hardware parameters that can be set using 'shw' listed somewhere?
Russ is offline   Reply With Quote
Old Oct 24, 2005, 09:50 PM   #15
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,606
Rep Power: 66
Max M. is a name known to allMax M. is a name known to allMax M. is a name known to allMax M. is a name known to allMax M. is a name known to allMax M. is a name known to all

it looks like they are at ikx.h:118
Max M. is offline   Reply With Quote
Old Oct 24, 2005, 10:00 PM   #16
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Thanks Max.
Russ is offline   Reply With Quote
Old Dec 11, 2005, 09:20 AM   #17
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

Quote:
Originally Posted by Russ
Although the above would work as well, you can do the same thing without the need for C++, using Windows shell commands, or using kxmixer's command line switches.

i.e.
Bind the following to a key (replacing 'saved_dsp.kx' with your saved config):
kxmixer --shell --load-settings saved_dsp.kx
Where is information like this found?

Same with the console commands?

:S
Maddogg6 is offline   Reply With Quote
Old Dec 11, 2005, 06:02 PM   #18
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

The command line switches are listed in kX help under "Appendix C: Command Line Reference".
As for the console commands, if you type "?" in the console, you get a list and brief description of the console commands. Some of them are self explanatory, while some others are not. Many of the parameters are listed in the kX SDK, while some others might require you to do some research to know how to use them properly (i.e. AC97 registers would depend on the AC97 implemention used with your specific card, thus you would want to look up that specification, etc).

BTW: Some of the command line switches that are not listed in the appendix (i.e. some of the additional parameters used with --shell) can be determined by looking at the Windows file associations set by kX.

Last edited by Russ; Dec 11, 2005 at 06:10 PM.
Russ is offline   Reply With Quote
Old Dec 12, 2005, 12:24 AM   #19
Tail Razer
 
Maddogg6's Avatar
 
Join Date: Jun 2005
Location: Bernyurass, AZ - USA
Posts: 4,027
Rep Power: 50
Maddogg6 will become famous soon enoughMaddogg6 will become famous soon enough

Ahh. Thats hady to know abount command line switches.

Wow - quite a lot can be done with simple batch files too.

I DID look in the Docs about the cmd line - And Shell *should* be in there (in more detail). Its says 'Internal Use Only' - which seems like all the other params are more 'advanced' than the shell.. ??

Thanks again Russ - Oh.. Im in the market for a new brain, let me know - Ill give ya a fair price for yours.
Maddogg6 is offline   Reply With Quote
Old Dec 12, 2005, 08:09 PM   #20
DriverHeaven Newbie
 
Join Date: Nov 2005
Posts: 3
Rep Power: 0
hhravn is on a distinguished road

I use the commandline switches combined with autohotkey to make my scrollLock key into a switch-toggle like this

Quote:
scrolllock::
if !GetKeyState("Scrolllock", "T")
{
run kxctrl -shw 4 0,,Hide
SetScrollLockState, On
}
else
{
run kxctrl -shw 4 1,,Hide
SetScrollLockState, Off
}
return
really handy stuff, as i can easily bind keys to every commandline option in kx.
hhravn is offline   Reply With Quote
Old Dec 13, 2005, 01:06 AM   #21
HardwareHeaven Extreme Member
 
Join Date: Jan 2005
Posts: 5,507
Rep Power: 61
Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!Russ is just super!

Good stuff, just be careful not to hold down any of the hotkeys. I have never used the autohotkey program, so I am not sure how it handles key repeats, but if it works like it does with most applications, you would end up with many instances of kxctrl running.
Russ is offline   Reply With Quote
Reply

Bookmarks

Thread Tools