Puppy Volume Mixer. Updated Mar 3, 2007
Puppy Volume Mixer. Updated Mar 3, 2007
After reading that people are really using the traybar volume mini-app, and hearing sugestions to have a full featured volume mixer that looks good, I decide to take up the challenge and in the process learn more about tcl and gnocl.
This application is eerily similar to the zmixer sound mixer included in puppy as of 2.14.
Both applications control volume, both are native GTK and both applications have sliders.
Here show with a GTK XAqua theme (click to see full size image)
The similarities end there, here are some of the pvolume-mixer highlights:
Some functional:
- It includes controls for all the different devices available to /dev/mixer, that means that the more capabilities your sound card has, the more controls will show. (up to the 13 devices supported by /dev/mixer)
- It includes balance controls for each device that has a left and a right level
- It reflects changes to the volume levels from external applications (e.g. if you move the volume slider in gxine it will also move on pvolume-mixer)
- It can be launched from the tray mini-volume.
- Option to selectivelly hide level controls.
- Fine control spinner to set the volume preciselly
Some technical
- It's 1/4 the size of zmixer (6.5Kb vs. 23.9Kb) and I'd expect that it'll compress even better to the sfs file.
- It is only 225 lines of code including generous spacing and a few comments. This means, only 154 lines of usable code.
It depends on:
- setvol: Already included on the Puppy LiveCD
- gnocl: Download it from here. It's just 125 Kb and I will be using it for many other projects.
To-do:
- Internationalize it and make it fully localizable.
- If requested, ability so save volume settings for later use.
This application is eerily similar to the zmixer sound mixer included in puppy as of 2.14.
Both applications control volume, both are native GTK and both applications have sliders.
Here show with a GTK XAqua theme (click to see full size image)
The similarities end there, here are some of the pvolume-mixer highlights:
Some functional:
- It includes controls for all the different devices available to /dev/mixer, that means that the more capabilities your sound card has, the more controls will show. (up to the 13 devices supported by /dev/mixer)
- It includes balance controls for each device that has a left and a right level
- It reflects changes to the volume levels from external applications (e.g. if you move the volume slider in gxine it will also move on pvolume-mixer)
- It can be launched from the tray mini-volume.
- Option to selectivelly hide level controls.
- Fine control spinner to set the volume preciselly
Some technical
- It's 1/4 the size of zmixer (6.5Kb vs. 23.9Kb) and I'd expect that it'll compress even better to the sfs file.
- It is only 225 lines of code including generous spacing and a few comments. This means, only 154 lines of usable code.
It depends on:
- setvol: Already included on the Puppy LiveCD
- gnocl: Download it from here. It's just 125 Kb and I will be using it for many other projects.
To-do:
- Internationalize it and make it fully localizable.
- If requested, ability so save volume settings for later use.
- Attachments
-
- pvolume-mixer-0.3.pet
- (3.48 KiB) Downloaded 1536 times
Last edited by rarsa on Sun 04 Mar 2007, 00:38, edited 3 times in total.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
Re: Puppy Volume Mixer
Naturally, this has found its way straight into Puppy 2.15CE!rarsa wrote:Here are some of the pvolume-mixer highlights:
Some functional:
- It includes controls for all the different devices available to /dev/mixer, that means that the more capabilities your sound card has, the more controls will show. (up to the 13 devices supported by /dev/mixer)
- It includes balance controls for each device that has a left and a right level
- It reflects changes to the volume levels from external applications (e.g. if you move the volume slider in gxine it will also move on pvolume-mixer)
Some technical
- It's 1/4 the size of zmixer (6.5Kb vs. 23.9Kb) and I'd expect that it'll compress even better to the sfs file.
- It is only 225 lines of code including generous spacing and a few comments. This means, only 154 lines of usable code.
Thanks, rarsa. The size issue, in particular, is a big help.
Cheers
- klhrevolutionist
- Posts: 1121
- Joined: Wed 08 Jun 2005, 10:09
- Pizzasgood
- Posts: 6183
- Joined: Wed 04 May 2005, 20:28
- Location: Knoxville, TN, USA
Goodie. When I free up some time I'll add this to my local Pizzapup, at least until I make my retro-themed version.
[size=75]Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
[img]http://www.browserloadofcoolness.com/sig.png[/img]
Puppy volume mixer
Dear rarsa,
I just downloaded the pvolume dotpup and installed it. When I try to run, Tcl starts sputtering as follows:
invalid command name "dict"
while executing
"dict set devDict $deviceId name $deviceName"
(procedure "addDevice" line 3)
invoked from within
"addDevice 0 "master" "master""
(procedure "loadDevicesDictionary" line 3)
invoked from within
"loadDevicesDictionary"
(file "/usr/sbin/pvolume-mixer.tcl" line 223)
I installd gnocl (overwriting an older version) and tried to run pvolume in Tcl 8.5 and 8.4xxxTLS with no luck. Am I missing the "dict" program? My system is Puppy 2.10
With kind regards,
vovchik
I just downloaded the pvolume dotpup and installed it. When I try to run, Tcl starts sputtering as follows:
invalid command name "dict"
while executing
"dict set devDict $deviceId name $deviceName"
(procedure "addDevice" line 3)
invoked from within
"addDevice 0 "master" "master""
(procedure "loadDevicesDictionary" line 3)
invoked from within
"loadDevicesDictionary"
(file "/usr/sbin/pvolume-mixer.tcl" line 223)
I installd gnocl (overwriting an older version) and tried to run pvolume in Tcl 8.5 and 8.4xxxTLS with no luck. Am I missing the "dict" program? My system is Puppy 2.10
With kind regards,
vovchik
Puppy Volume Mixer
Dear rarsa,
It may be that my souped-up Puppy 2.10 is to blame, or rather, my mods to the standard Puppy 2.10. I have several versions of Tcl and chose the latest two for testing pvolume. I don't know the Tcl language (and would, if at all possible, want to steer clear of it, since I have my hands full with C, bash and Gambas). I am beginning to think that the problem is with my version of GTK (perhaps a library incompatibility with 2.8...), but, then, everything else seems to work.
With kind regards,
vovchik
PS. I think that using tcl with GTK widgets and theming is a splendid idea for Puppy, since Tcl progs are relatively small and don't require compilation. Without the GTK libs they can be somewhat off-putting in terms of desktop integration, and we all want pretty puppies, I gather. Zenity, gxmessage, perl and bash could also be exploited nicely, in addition to MU's wxbasic scripting, in order to keep Puppy's weight down and still provide a uniform and pleasant user experience.
It may be that my souped-up Puppy 2.10 is to blame, or rather, my mods to the standard Puppy 2.10. I have several versions of Tcl and chose the latest two for testing pvolume. I don't know the Tcl language (and would, if at all possible, want to steer clear of it, since I have my hands full with C, bash and Gambas). I am beginning to think that the problem is with my version of GTK (perhaps a library incompatibility with 2.8...), but, then, everything else seems to work.
With kind regards,
vovchik
PS. I think that using tcl with GTK widgets and theming is a splendid idea for Puppy, since Tcl progs are relatively small and don't require compilation. Without the GTK libs they can be somewhat off-putting in terms of desktop integration, and we all want pretty puppies, I gather. Zenity, gxmessage, perl and bash could also be exploited nicely, in addition to MU's wxbasic scripting, in order to keep Puppy's weight down and still provide a uniform and pleasant user experience.
Balance Control
Hi rarsa,
Looks really nice, NO problems installing on Puppy 2.14. The balance control seems to be jerky and will only return to the center with the volume muted. This will be a good addition to Puppy over Zmix. I have faith in you, that the balance can be fixed.
Good Luck, Kal
Looks really nice, NO problems installing on Puppy 2.14. The balance control seems to be jerky and will only return to the center with the volume muted. This will be a good addition to Puppy over Zmix. I have faith in you, that the balance can be fixed.
Good Luck, Kal
Re: Puppy Volume Mixer
I think you may have the clue of your problem. I only tested with the tcl8.5 that comes with Puppy 2.14vovchik wrote:It may be that my souped-up Puppy 2.10 is to blame, or rather, my mods to the standard Puppy 2.10.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
Rarsa, I downloaded both dotpups. Gnocl seemed to install ok. Pvolume-mixer seemed to install, but when I said ok to the last window asking to refresh the window manager, nothing happened. Nothing has been added to the Menu and the volume control looks the same.
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=69321][color=blue]Puppy Help 101 - an interactive tutorial for Lupu 5.25[/color][/url]
It is asking YOU to refresh the window manager. One you refresh the window manager it will be there.Flash wrote:when I said ok to the last window asking to refresh the window manager.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
The installer runs "fixmenus" so the only thing left is restart the WM.Kal wrote:For 2.14's menu, I did a "fixmenus" in terminal and then restarted JWM. Puppy sound mixer was then in the Multimedia menu.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
- Nathan F
- Posts: 1764
- Joined: Wed 08 Jun 2005, 14:45
- Location: Wadsworth, OH (occasionally home)
- Contact:
Quite handy, grabbed all the available devices on my soundcard just as advertised. It is slightly jerky in some situations, but I chalk that up to the slowness of this particular box and the fact that both Audacious and Opera were running also at the same time. You've got me sold on Gnocl. Also, this mixer will be in the next Grafpup snapshot.
Thanks,
Nathan
Thanks,
Nathan
Bring on the locusts ...
What do you mean by "jerky"?
I actually put a delay for reacting to external volume changes (200 milliseconds) so it is not using too many resources while idling.
This is version 0.1 so keep the critique and advice comming I am sure there is a lot of room for improvement.
Here are some of the issues I know of:
- If you change the volume with the tray-volume, the balance will return to 50%. I will fix that when I finish integrating both.
- To unmutte you must set the volume to other than 0 as it does not remember what the volume was before mutting. I will fix this when I finish integrating with the tray volume as the mixer will be always in memory so it will be able to remember.
- The balance contols are very small and that may account for the "jerkyness". Any ideas of how to visualy organize it so the balance scales have a larger range?
My first try had independent scales for left and right levels, no balance scale. That made setting the volume for each channel very precise but I found it cumbersome. Should I bring that idea back?
- I also don't like that bringing balance to the center is difficult. Ideas here will also be appreciated. Maybe adding a clickable tickmark?
I actually put a delay for reacting to external volume changes (200 milliseconds) so it is not using too many resources while idling.
This is version 0.1 so keep the critique and advice comming I am sure there is a lot of room for improvement.
Here are some of the issues I know of:
- If you change the volume with the tray-volume, the balance will return to 50%. I will fix that when I finish integrating both.
- To unmutte you must set the volume to other than 0 as it does not remember what the volume was before mutting. I will fix this when I finish integrating with the tray volume as the mixer will be always in memory so it will be able to remember.
- The balance contols are very small and that may account for the "jerkyness". Any ideas of how to visualy organize it so the balance scales have a larger range?
My first try had independent scales for left and right levels, no balance scale. That made setting the volume for each channel very precise but I found it cumbersome. Should I bring that idea back?
- I also don't like that bringing balance to the center is difficult. Ideas here will also be appreciated. Maybe adding a clickable tickmark?
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
- Nathan F
- Posts: 1764
- Joined: Wed 08 Jun 2005, 14:45
- Location: Wadsworth, OH (occasionally home)
- Contact:
How about this, just make the balance into a vertical slider right next to the device it is controlling? Although that would make the whole app quite a bit wider just like if you were using a volume per channel. But that is a more user-centric way of doing things than having to adjust the volume left and right every time in order to change the volume.My first try had independent scales for left and right levels, no balance scale. That made setting the volume for each channel very precise but I found it cumbersome. Should I bring that idea back?
Alternatively, if you were to use a separate slider for left and right, a checkbox to lock the sliders together so they move in sync would be nice. Otherwise itwould be very annoying to just change the volume for a device, since you have to move two sliders.
If you go with the present arrangement, which I don't have a problem with BTW, then yes, a checkbox to return the balance to center would be nice.
As I said before, the jerkiness was probably due to issues with system resources rather than any deficiency in your application. I just tested it again, this time with only madplay running in a console and the browser shut down. The response is near instantaneous in this case.
I'm wondering now, if Barry would agree to adding Gnocl to Puppy would it be a good idea to port the mini-volume applet over? Right now I dislike the tiny little slider in the present app, and I think rendering that with a gtk widget would be an improvement.
Nathan
Bring on the locusts ...
Thought about this but I got to the strong conclusion that left and right should be represented as left and right, not up and downNathan F wrote:How about this, just make the balance into a vertical slider
That was definetively part of that implementation. I meant cumbersome because to adjust balance you have toNathan F wrote:Alternatively, ... a checkbox to lock the sliders together so they move in sync would be nice.
1. Click the "unlink" control
2. Adjust the left level
3. Adjust the right level
4. Click the "link" control
Once linked changing the volume is not a problem.
I'm making my case through actual applications that look better and are smaller than the applications they replace, so the 125KB for gnocl will be "paid for" with the reduction in size those other applications.I'm wondering now, if Barry would agree to adding Gnocl to Puppy
The size of the slider is a parameter for the widget. The slider for the volume control I have in my computer is larger but didn't release it as nobody commented on it. I thought that it was just me that didn't like it.Right now I dislike the tiny little slider in the present app, and I think rendering that with a gtk widget would be an improvement.
That's why I really appreciate the critique and comments to my contributions.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
Version 0.2 uploaded
http://www.murga-linux.com/puppy/viewto ... 8536#98536
Changes:
- Now I understand what balance jerkiness you were talking about. It's now hopefully fixed !
- It now uses less CPU resources. Now it only checks regularly the devices that exist (before it was checking again every possible device)
Debuging the jerkiness was tough. The culprit was Tcl math: It was doing integer math when I was expecting to do floating point so it was rounding... A factor so it was either 0 or 1 !!
http://www.murga-linux.com/puppy/viewto ... 8536#98536
Changes:
- Now I understand what balance jerkiness you were talking about. It's now hopefully fixed !
- It now uses less CPU resources. Now it only checks regularly the devices that exist (before it was checking again every possible device)
Debuging the jerkiness was tough. The culprit was Tcl math: It was doing integer math when I was expecting to do floating point so it was rounding... A factor so it was either 0 or 1 !!
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to
- Nathan F
- Posts: 1764
- Joined: Wed 08 Jun 2005, 14:45
- Location: Wadsworth, OH (occasionally home)
- Contact:
Does indeed seem better and use less resources. I did have another thought, and I wonder how hard it would be to implement. Would it be feasible to add a numerical scale and spinbox like in this volume control? The numerical figure is useful for setting balances between different inputs.
Nathan
Nathan
- Attachments
-
- volume.jpg
- (5.27 KiB) Downloaded 999 times
Bring on the locusts ...