|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
DriverHeaven Newbie
Join Date: Nov 2009
Posts: 2
Rep Power: 0 ![]() |
Problems with making plugins
Hi
I was little pissed off about the windows 7 issues with kx drivers and stereo/multichannel audio playback, so i started to create a plugin that should help me (and others) a little. Main thing that it does is summing up 20 samples of 4 channels that is surround back (left and right), center and sub. If that summed up value is 0 then it means that all surround channels part front left and right are mute so there is only stereo sound. I used limitn function: Code:
limitn channelout,sumn,channelin,0 Code:
tstneg sumn,sum,-sum,0 My few days fight ended up with many hours of headaches. For example the acc3 function when used like that: Code:
acc3 x,-1,1,0 Code:
macs Left,0,1,x Code:
limitn z,sumn,1,0 Maybe its just me - i mean - maybe i just dont get the idea of how stuff works here. For example i added 3 controls, and used the andxor function. On the net i found a manual how it should work. And short saying it didnt work anyhow close to that manual. When manual said resoult should be a nand x it was like a and x etc. Generaly speaking nothing here works close to normal programming im used to xd. Below is my code. I know it propably could be better/optimized/it could collect more samples etc. But like i said the pass/mute multichannel outputs works pritty damn fine. I just can't add the thing doing oposite thing with passing/mutting Left and Right output (which pass thru FL and FR signals) Maybe some1 better than me will figure it out and make working plugin that will help people with windows 7 to have kx drivers which work (i mean which upmix stereo sources like mp3s,flacs and pass thru multichannel sources like movies 6ch mp3s etc. Code:
input FL,FR,SL,SR,SC,LFC output Left,Right,oFL,oFR,oSL,oSR,oSC,oLFC temp sum,summ,sumb,sumn static tmp1 = 0,tmp2 = 0,tmp3 = 0,tmp4 = 0,tmp5 = 0,tmp6 = 0 static tmp7 = 0,tmp8 = 0,tmp9 = 0,tmp10 = 0,tmp11 = 0,tmp12 = 0 static tmp13 = 0,tmp14 = 0,tmp15 = 0,tmp16 = 0,tmp17 = 0,tmp18 = 0 static tmp19 = 0,tmp20 = 0 acc3 sum,SL,SR,SC acc3 sum,sum,LFC,0 ; sum of all surround signals macs tmp1,sum,0,tmp1 macs tmp2,tmp1,0,tmp2 macs tmp3,tmp2,0,tmp3 macs tmp4,tmp3,0,tmp4 macs tmp5,tmp4,0,tmp5 macs tmp6,tmp5,0,tmp6 macs tmp7,tmp6,0,tmp7 macs tmp8,tmp7,0,tmp8 macs tmp9,tmp8,0,tmp9 macs tmp10,tmp9,0,tmp10 macs tmp11,tmp10,0,tmp11 macs tmp12,tmp11,0,tmp12 macs tmp13,tmp12,0,tmp13 macs tmp14,tmp13,0,tmp14 macs tmp15,tmp14,0,tmp15 macs tmp16,tmp15,0,tmp16 macs tmp17,tmp16,0,tmp17 macs tmp18,tmp17,0,tmp18 macs tmp19,tmp18,0,tmp19 macs tmp20,tmp19,0,tmp20 ;moving the static registers +1 up ;overwriting the oldest one plus overwriting ;first with actuall sum of surround signals acc3 sum,tmp1,tmp2,tmp3 acc3 sum,sum,tmp4,tmp5 acc3 sum,sum,tmp6,tmp7 acc3 sum,sum,tmp8,tmp9 acc3 sum,sum,tmp10,tmp11 acc3 sum,sum,tmp12,tmp13 acc3 sum,sum,tmp14,tmp15 acc3 sum,sum,tmp16,tmp17 acc3 sum,sum,tmp18,tmp19 acc3 sum,sum,tmp20,0 ;summing of all stored sum's of surround signals (20 last samples) tstneg sumn,sum,-sum,0 ;making -(abs(sum)) limitn oFL,sumn,FL,0 limitn oFR,sumn,FR,0 limitn oSL,sumn,SL,0 limitn oSR,sumn,SR,0 limitn oSC,sumn,SC,0 limitn oLFC,sumn,LFC,0 ;if sumn is lower than 0 ;so there is signal on surround channels ;so there is multichannel signal ;then pass through all 6 channels (else pass 0 (mute)) ;here should be similar thing passing or not FL and FR ;to Left and Right when there is only stereo signal and ;mute it when there is multichannel signal end |
|
|
|
|
|
#2 | |||
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,503
Rep Power: 60 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Problems with making plugins
It seems you are misunderstanding some things:
Quote:
Quote:
For "-(abs)" use the log instruction. i.e. log r, x, 0x1, 0x2 The macs instruction does the following (extraneous parenthesis added to emphasize the order of operations): RESULT = A + (X * Y) Quote:
i.e. "macs tmp1, sum, 0, 0" will gave the same result. In any case, such a plugin is going to have problems because (among other things) multichannel audio might use some of the channels, or all of the channels, at any time during playback, and you have no way of detecting this. e.g. If only the front channels are being used at some point (during playback of multichannel content), then your plugin is going to think it is stereo only, and it will be upmixed by Surrounder, which is not what you want . Last edited by Russ; Nov 29, 2009 at 12:50 PM. |
|||
|
|
|
|
|
|
|
|
DriverHeaven Newbie
Join Date: Nov 2009
Posts: 2
Rep Power: 0 ![]() |
Re: Problems with making plugins
About macs:
Quote:
Info about that 1 is 1LSB less than 1 isn't to much of a help. As it doesn't explain lot of stuff i still don't get how the fuck those things work. I fear using your log statement, as the invalid -sum seems to do the trick. I mean the muting of surround outputs works as intended. And if i delete the '-' from there it stops working, so that '-' actualy does something. What it those is actually a big question:P. About the multichannel stuff. I tested few mp3s i have being 6channel, playied most movies i have looking for 'silent' moments and my resoult is such that i didnt find a simple moment in which the audio on back,center and sub channels went silent at once to make the 'code' work not as intended. Most movies have propably some ambient audio there, or at least some noise don't know exacly. The only issue here is actually games. Didn't test how stuff works with games or rather if in games back,cen,sub channels are 'silent' enough long to make my plugin go beserk xd. Other issue i just spoted here is actualy games too. Its the thing i quite a lot play games with multichannel sound, with music in those games muted, and playing mp3, thus making my plugin taking multichannel signal with front channels of game mixed with music and put it thru to surrounder not upmixing the stereo mp3 xd. So in other words i spend few days trying to get a grip on language of programming which is to abstract for me to fully understand, making pluging that at basic concept have had an big error (the game+mp3 thing). In other words it seems i need to use creative drivers:/. As i like more win7 over win xp than i like kx drivers over creative ones. I wonder if creative drivers with their cmss upmixing will upmix only mp3 while 6channel audio from game will be untouched. Anyway thanks for answer, and i still hope some1 will 'repair' kx driver issues in win7 so i can use them again, as the game+mp3 issue seems to be a backstaber for multiprofile dsp swiching for stereo/multichannel connections in dsp. |
|
|
|
|
|
|
#4 | ||
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,503
Rep Power: 60 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Problems with making plugins
Quote:
It is the same with your example macs instruction (i.e. 1 * x is really 0.9999999995343387126922607421875 * x). BTW: I was not really sure what you were trying to point out with those example instructions in the first place (but since there is no practical reason to have 1 and -1 in the acc3 instruction I assumed it had something to do with that). Quote:
Last edited by Russ; Nov 30, 2009 at 01:34 AM. Reason: correction |
||
|
|
|
|
|
#5 |
|
HardwareHeaven Extreme Member
Join Date: Jan 2005
Posts: 5,503
Rep Power: 60 ![]() ![]() ![]() ![]() ![]() ![]() |
Re: Problems with making plugins
BTW: Some people claim that upmixing works correctly when using the SPDIF device (I have Windows XP so I cannot verify anything related to Vista/7). If that is the case, then that could be a workaround for you.
i.e. Set Windows (and thus your game) to use Master Mixer as the default device (so that multichannel audio works correctly), and set your MP3 player to use the SPDIF device. |
|
|
|
|
|
#6 |
|
h/h member-shmember
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,606
Rep Power: 66 ![]() ![]() ![]() ![]() ![]() ![]() |
Ответ: Problems with making plugins
by the way:
Code:
macs tmp1,sum,0,tmp1 macs tmp2,tmp1,0,tmp2 ... macs tmp19,tmp18,0,tmp19 macs tmp20,tmp19,0,tmp20 ;moving the static registers +1 up To "move +1 up" it should be done in reverse order, i.e.: Code:
macs tmp20, tmp19, 0, 0 macs tmp19, tmp18, 0, 0 ... macs tmp2, tmp1, 0, 0 macs tmp1, sum, 0, 0
__________________
Last edited by Max M.; Nov 30, 2009 at 01:32 AM. Reason: corrected comma to make oecumenical mind happy |
|
|
|
|
|
#7 | ||
|
h/h member-shmember
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,606
Rep Power: 66 ![]() ![]() ![]() ![]() ![]() ![]() |
Ответ: Problems with making plugins
And, well:
Quote:
(though the idea itself in general probably needs more thinking to become a solution... yep) Quote:
Hint #1: you can monitor exact value of each register via kxctrl utility (this could be a bit more handy than watching "results" via peak-meters).
__________________
Last edited by Max M.; Nov 30, 2009 at 03:44 AM. |
||
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
|
|