View Full Version : Master Volume tracking to send USB-UIRT actions
cjean
July 5th, 2007, 11:59 AM
Hi guys,
I'm using Girder 3.3 so far and I start to see it's limitation. I just started to test Girder 4 and I realize how much it has improved in fonctionality and power.
I will explain you my problem so maybe you'll have a better idea to direct me.
I've been using my HTPC for over a year connected to an analog amplifier. Recently I just bought an Harman Kardon AVR-145 and I connect it to my HTPC via SPDIF. To control the new amplifier I bought an USB-UIRT to turn ON/OFF and control the volume. Since I'm not the only one (wife & kids) to use this SETUP my kids occasionaly overload the speakers since now I can't limit the volume change like I was able to do connected with analog output.
I would like to know if it possible to Girder to track any volume change from the MASTER Volume and send IR action to my amplifier accordingly. I do not want to put events to all my input device since the only device that I can't learn the event is my Fusion case Volume knob were there is no plugin for it. Also my remote control is an HID one and volume control already works to change the Master volume.
I saw in Girder instructions to do it with audio mixer or event mapping but I don't understand how to do it with since I'm not familiar yet with Girder 4.
Here to summurize what I want to do:
On Master volume change, not from input device, transmit IR signal.
Master Volume + event ---> USB-UIRT IR transmit vol + to receiver Action
Master Volume - event ---> USB-UIRT IR transmit vol - to receiver Action
Is there a way to do this or I'm dreaming???
Any help would be greatly appreciated.
Regards to all of you,
Charles
Canada
cjean
July 5th, 2007, 05:47 PM
OK guys,
Thanks for all your viewing! Hope to get an answer soon!
I made a little progress but now I'm reaaly stuck in the mud...
Is was able to create an USB-UIRT action... so far so good. Attached to that I created an event with the Audio mixer device. I pressed learn and then vol + the value returned was 0:0:-1:0. I did the same thing with Vol - and I also obtained 0:0:-1:0. I did the same with the event dialog box but same result. I find stange that Girder or the returned value from Windows is the same whenever I press VOL + or VOL -.
If i can make it work, it will do exactly what I want.
Is somebody would be kind enought to get me back on track.
Thanks
Charles
quixote
July 5th, 2007, 11:35 PM
I can only speak for myself, but I'm guessing we're all a little confused as to what exactly you're trying to do.
Have you looked at the volume actions yet? If you're trying to do what I think you are, maybe you could use the event that occurs in the logger to trigger a macro that gets the volume, then sets the volume to a predetermined maximum level if the volume is above a certain level. You'll need to download the variable conditional if you want to keep it simple.
cjean
July 6th, 2007, 06:27 AM
Yes I know,
Maybe I took the long road to explain something very simple.
To make it simple, I would like to trigger an action based on master volume change.
If the Master volume goes up, I trigger Action "A"
If the Master volume goes down, I trigger Action "B"
I think you're going to tell me that I just need to map all my input device into the event mapper? Right?
This were my problem is. There is only one inut device that I can't learn the input and this device is my Volume knob on my Antec Fusion case. This knob change the master volume level directly and since there is no plugin available for it, there is no way I can capture the codes from it.
To make it short, I just need to track the master volume change and trigger Action. The action must be triggered based on a Master volume up or down and not from input device
Unfortunatly, the Audiomixer inside Girder does not make any difference bethween Master Volume Vol + or Vol - the captured code is always 0:0:-1:0
What I need is a Master volume tracker inside Girder to make it work. You can't imagine how many post I found around this problem on this forum and on the Green Button for peoples that are connected to their receivers with digital cables.
I hope my explaination clearer otherwise it's even more confusing....
Regards,
Charles
quixote
July 6th, 2007, 01:41 PM
OK, here's what I would do:
First, download and install Honnt's variable conditional from here: http://promixis.com/download.php?ID=917
Switch to expert view. Create a macro. Drag the 0:0:-1:0 event from your logger and attach it to the macro so that it triggers everytime the volume is changed. In that macro, put the get volume action as the first item and set the variable to ComputerVolume or something similar. For the next action, attach a "set volume" action and navigate to your SPDIF or master volume and set it to your maximum desired volume. To that action, attach a variable conditional from the section on the left of the interface under the action folders. Set that conditional to integer, the variable name you gave your computer volume and "is greater than" then the maximum desired volume.
Besure that the conditional is only attached to the set volume action within te macro.
Let me know how that goes or if I wasn't clear enough. This will limit your volume to a level that you set.
cjean
July 6th, 2007, 04:15 PM
Thanks Quixote,
I think I understand what you want me to do. I have a major problem though, I whenever I press Vol up or down I get the same code 0:0:-1:0. I can buitl a superb macro but if I can't differentiate Vol + or Vol - then I'm not going anywere. That famous 0:0:-1:0 is the code generated by the master volume it self. I just don't understand why it's the same for volume + or -. Unless there is something I don't know....
Thanks a lot for your reply.
looking forward for your answer.
Regards,
Charles
quixote
July 6th, 2007, 06:57 PM
Welll, I understand your dilemma, but what I'm suggesting will give you more control anyway. Have you set up the macro and attached the event that you mentioned? If so, you now have more control than you would if you had volume up and volume down events. You now have a variable that you can compare to others or itself, and fire events based on the results. For instance, you can have a speech action that occurs when you hit a certain level of volume that tells you that you are at 50% for instance.
If you want different events for volume up and volume down, then write a script that is in the macro you just made and place it before the "get volume" action like this:
ComputerVolume = ComputerVolume or 0
OldComputerVolume = OldComputerVolume or 0
OldComputerVolume = ComputerVolume
and then one that is after your "get volume" action like this:
if ComputerVolume < OldComputerVolume then gir.TriggerEvent('VolumeDown',18)
elseif ComputerVolume > OldComputerVolume then gir.TriggerEvent('VolumeUp',18)
end
I haven't tested this, but I think I have all of my syntax correct. Now try adjusting the volume and you should get Girder events that correspond to the volume changes. Let me know how it goes.
cjean
July 7th, 2007, 06:20 AM
Well first of all I would like to thank you of taking care of my case. I'm pretty sure that if that works, many people with their receivers connected to their HTPC via SPDIF or Toshlink will be happy of this solution!
To answer your questions, to be honest, I didn't built a macro since as mentioned above, I'm not very familiar with Girder 4.0. I'm still using Girder 3.3 and I'm still in my leaning curve.
I have a couple of questions for you.
- Do you think that I still need to install the Variable conditional to have work your Lua script?
- Do you think that Variable conditional plugin will work in Girder 3.3? This will save me a lot of work.
- Is there a Lua editor in Girder 4.0 like in Girder 3.3? I look for it but didn't find any. I found LuaEdit on the net, do you think it will be OK?
- On the last scprit that you wrote for me, do you think that I can trigger an USBUIRT action instead of a volume action. Now that I explained myself better to you to understand, I just need to monitor the Master Volume level to trigger USBUIRT actions. The thing nice about monitoring the Master volume is when the vol has reach the max or the min, no actions will be generated and this will prevent speakers blow out!!!!
- One last question, is this macro will run continuously to monitor the Master Volume change in real time?
With all that answered I should be fine.
Please pardon me for my ignorance since it's my first time with Girder 4 and I never wrote any Lua script so Lua language is totally new for me.
Thanks a lot for your help!
Once I'll make it work, send me your personnal address so I can send you a check. I prefer to give you money than blow out my speakers!!
Best regards,
quixote
July 7th, 2007, 12:41 PM
You should take that cheque and send to to the folks at Promixis and buy Girder 4, it's worth it.
Unfortunately, I haven't used Girder 3.3 for years (?), so I can't remember how I would go about setting this up. The variable conditional was created for use with Girder 4. I guess you would have to try it out with 3.3, but I sort of doubt it would work.
For scripting in G4 the editor is built in. You just need to create a script action from the top of the action folders on the left (in expert view).
Assuming you added the event that you mentioned happens when you use the volume, then the macro would monitor your volume level with each change. You could have the VolumeUp and VolumeDown events that you created trigger USB-UIRT actions.
Let me know if you plan on buying girder 4 and I'll see about creating a base GML that I can attach and then we can tweak it for your system.
cjean
July 7th, 2007, 01:13 PM
Thanks for your help!
Well I bought Girder 4 licence last year and using it for Girder 3.3. Initially I started with Girder 4 and it was not as stable as 3.3. Probably things have been improved since then. I found also that Girder 4 was not as quick as Girder 3.3. I've built all my control around 3.3 but I don't mind in changing a couple of them in 4 version. In any case if you want to help me to create a GML I would be tremendously happy.
Just tell me what I need to start with and I will manage to get what I need.
Regards,
Charles
quixote
July 7th, 2007, 08:55 PM
OK, I'll come up with something for tomorrow, in the meantime I guess install G4 and install the variable conditional that I mentioned earlier.
cjean
July 8th, 2007, 05:49 AM
GGGGGGGGGreat,
On my side I'll play around with G4 so you won't have to teach me basic stuff!
Thanks a lot!
Charles
cjean
July 8th, 2007, 01:46 PM
OK, I'll come up with something for tomorrow, in the meantime I guess install G4 and install the variable conditional that I mentioned earlier.
Ok I'm almost there. I followed your instruction in the previous post and It's working at 99%.
The only thing I need is to trigger an Action in the Girder Action tree from the script to run my USBUIRT actions. Is this something feasable? Or if I trigger an action from the script, how can I pick up this event and activate my action?
Thanks for your support,
Charles
quixote
July 8th, 2007, 02:06 PM
Hi Charles,
Take a look at this GML that I threw together and then I'll explain anything you'd like me to. You'll need to learn the USB-UIRT actions that you wish to produce for the VolumeUp and VolumeDown events. Also, I left the volume limiter at 100, since I don't know what level you would want the events to stop.
I'm not really sure why you would want to use your computer's volume to adjust your amplifier's volume, but I may be mistaken in what exactly you're trying to do.
Anyway, give it a try and let me know how it goes.
Also - I almost forgot, don't forget to set the device for the "get volume" action to work for your system.
cjean
July 8th, 2007, 07:41 PM
Hi Charles,
Take a look at this GML that I threw together and then I'll explain anything you'd like me to. You'll need to learn the USB-UIRT actions that you wish to produce for the VolumeUp and VolumeDown events. Also, I left the volume limiter at 100, since I don't know what level you would want the events to stop.
I'm not really sure why you would want to use your computer's volume to adjust your amplifier's volume, but I may be mistaken in what exactly you're trying to do.
Anyway, give it a try and let me know how it goes.
Also - I almost forgot, don't forget to set the device for the "get volume" action to work for your system.
Thanks Quixote,
Well just before you posted, I was able to sorted out to make it work. Without your script, never I could figure out to make it work the way I wanted, I was a bit desesperated.
I'm going to explain you why I need that tool.
Like me, many HTPC fans will find this very helpful. When you're sending all your sound thru SPDIF or Toshlink to your receiver, you're loosing your capability in having control of your sound volume since all sounds are bypassing the master volume. The Master volume control only all analog sounds. When you are connected with discrete analog output then you have control but as soon you move to digital.... bye bye sound control. There is a tool called Volume Tracker for Windows. This tool is able to link the wave sounds to the master. The only problem with this tool is as soon you play PCM sounds like DVD's forget about having control of your sound because... again it's bypassing the audio mixer completly. You still have the volume slider working in MCE but with no effect on the results, volume remain the same.
My HTPC (Home Theater PC) is the heart of my Home cinema. It controls my flat screen, my receivers, heat exchanger.... With only one remote I can control everything in that cabinet. This makes things a lot easy for my wife & kid since they only have to take care of one remote. And my remote is very nice since it has many shortcut keys that I can't find on other remotes
The reason why I wanted this tool are:
- My volume increase/ decrease is coming from the learned volume keys on my remote and sent thru USBUIRT to my receiver. Even if MCE volume slider is showing MAX. Kids are able to shoot repeated volume increase to the amplifier. You can imagine that they could overload volume and damage the speakers. The opposite is also thru, even if I had my volume slider at 0, sound was still very loud. Basically I lost sychronisation from my volume slider to the output level. Before when connected with analog, my receiver was set to a certain level and volume change was from MCE.
- Second reason is that on my nice Antec Fusion case, I have a volume knob. This knob change the Master analog volume up and down. So if I'm near my HTPC I can use this knob intead of looking for the remote. The big problem with the knob is I don't have a plugin for Girder to capture the code he's generating when going up or down. And going to digital sound, this knob is completly useless.
My idea was to create a tool to track the Master volume change and trigger actions from it. So whatever input device used to change the volume, actions would be coming from master volume not from input device. The big problem I was having, and you'll remember, I was unable to differentiate volume + or - from master because the code was always 0:0:-1:0. This is were I didn't have any clues decided to post my problem.
I don't know if you realise the power of the script you built for me. You can have thousands of input device that change the master volume. You don't need a plugin for each of them and you also don't need to lean the codes for each of them. This makes a very... very universal solution that anything that play with master volume you have the full control of it. Even more, I realise that when you have reached the max or the min, Windows stop's generating code for the Master volume. When I mention to you that when I asked for a volume change, master volume was generating a code like 0:0:-1:0. This code is no longer generated when min or max is reached. So guess what, I don't need to set a maximum volume in the script, it's done automaticaly, no code generated, no actions.
I think this little script should have the merit to be posted on the download page. Do yourself a favor, do search on "volume spdif receiver" or "USBUIRT receiver volume" or anything that sound like it on this site and The Green Button, then you'll understand the value of it.....
I'm holding my promess, I would like to send you something if you want.
Thanks a lot for your help!
Best regards,
Charles
Canada
quixote
July 8th, 2007, 07:55 PM
Hi Charles,
You're too kind; the script was not difficult to put together and is really elementary compared to some of the stuff that others here have made. Don't worry, in time you will see how easy it was, too.
I'm glad that I could help out, and maybe in the future you can help out someone that's new to Girder in return.
See you around.
Just wondering - Where in Canada are you living? I'm in Montreal, Quebec.
cjean
July 8th, 2007, 08:17 PM
Uuuuuuuuunbeleivable (like in the tetes a claques)
Well beleive it or not I'm living in Vaudreuil, QC west shore on Montreal!
I'm out of words!
Thanks for your help neighbour
See you around
Charles
Powered by vBulletin® Version 4.1.8 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.