Puppy Volume Mixer. Updated Mar 3, 2007

Stuff that has yet to be sorted into a category.
Message
Author
User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

Puppy Volume Mixer. Updated Mar 3, 2007

#1 Post by rarsa »

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)
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 1535 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

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#2 Post by zigbert »

you are good !!!

User avatar
WhoDo
Posts: 4428
Joined: Wed 12 Jul 2006, 01:58
Location: Lake Macquarie NSW Australia

Re: Puppy Volume Mixer

#3 Post by WhoDo »

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.
Naturally, this has found its way straight into Puppy 2.15CE! :P

Thanks, rarsa. The size issue, in particular, is a big help.

Cheers

User avatar
klhrevolutionist
Posts: 1121
Joined: Wed 08 Jun 2005, 10:09

#4 Post by klhrevolutionist »

Great work rarsa ! Will be replacing zmixer with this mixer.

Hopefully it is included in the next standard release.
Heaven is on the way, until then let's get the truth out!

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#5 Post by Pizzasgood »

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]

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Puppy volume mixer

#6 Post by vovchik »

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

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#7 Post by rarsa »

What version of Puppy are you using? that's odd.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
vovchik
Posts: 1507
Joined: Tue 24 Oct 2006, 00:02
Location: Ukraine

Puppy Volume Mixer

#8 Post by vovchik »

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.

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

Balance Control

#9 Post by Kal »

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

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

Re: Puppy Volume Mixer

#10 Post by rarsa »

vovchik wrote:It may be that my souped-up Puppy 2.10 is to blame, or rather, my mods to the standard Puppy 2.10.
I think you may have the clue of your problem. I only tested with the tcl8.5 that comes with Puppy 2.14
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#11 Post by Flash »

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]

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#12 Post by rarsa »

Flash wrote:when I said ok to the last window asking to refresh the window manager.
It is asking YOU to refresh the window manager. One you refresh the window manager it will be there.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

Kal
Posts: 626
Joined: Thu 05 May 2005, 16:59
Location: California, High Desert

#13 Post by Kal »

Flash.
For 2.14's menu, I did a "fixmenus" in terminal and then restarted JWM. Puppy sound mixer was then in the Multimedia menu.
Kal

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#14 Post by rarsa »

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.
The installer runs "fixmenus" so the only thing left is restart the WM.
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#15 Post by Nathan F »

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
Bring on the locusts ...

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#16 Post by rarsa »

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?
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#17 Post by Nathan F »

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?
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.

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 ...

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#18 Post by rarsa »

Nathan F wrote:How about this, just make the balance into a vertical slider
Thought about this but I got to the strong conclusion that left and right should be represented as left and right, not up and down :)
Nathan F wrote:Alternatively, ... a checkbox to lock the sliders together so they move in sync would be nice.
That was definetively part of that implementation. I meant cumbersome because to adjust balance you have to
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 wondering now, if Barry would agree to adding Gnocl to Puppy
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.
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.
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.

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

User avatar
rarsa
Posts: 3053
Joined: Sun 29 May 2005, 20:30
Location: Kitchener, Ontario, Canada
Contact:

#19 Post by rarsa »

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 !!
[url]http://rarsa.blogspot.com[/url] Covering my eclectic thoughts
[url]http://www.kwlug.org/blog/48[/url] Covering my Linux How-to

User avatar
Nathan F
Posts: 1764
Joined: Wed 08 Jun 2005, 14:45
Location: Wadsworth, OH (occasionally home)
Contact:

#20 Post by Nathan F »

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
Attachments
volume.jpg
(5.27 KiB) Downloaded 999 times
Bring on the locusts ...

Post Reply