Retrovol 0.13.1 (Volume mixer)

Audio editors, music players, video players, burning software, etc.
Message
Author
User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#141 Post by Pizzasgood »

If anybody is interested in having it changed right now, there are only two lines of source code that would need adjusting. Otherwise, you'll have to wait until I get around to adding it proper, which is more work since I want it to be optional - I'm kind of busy lately so I might not work on it for a week or two. Also, this hasn't been tested thoroughly - it is possible that in some situations near the maximum and minimum volume levels you might have trouble getting it to completely max (or min) out. I will test that more rigorously when I implement it for real.

Anyway, the changes are to the alsa_classes.cpp file. The lines to change are 161 and 167, in the scale_out and scale_in functions.

Here is the original code:

Code: Select all

//this is used internally to scale a number to be from 0-100
int Element::scale_out(int num){
        if(max-min==0){ return(num); }
        return(ceil(100.0*(num-min)/(max-min)));
}
//this is the inverse of scale_out; it's used to take a 0-100 number and put it
//into the proper scale for the element to understand
int Element::scale_in(int num){
        if(max-min==0){ return(num); }
        return(floor((num*(max-min)/(100))+min));
}
And here is the modified code:

Code: Select all

//this is used internally to scale a number to be from 0-100
int Element::scale_out(int num){
        if(max-min==0){ return(num); }
        return(ceil(pow(100.0, (num-min)/(double)(max-min))));
}
//this is the inverse of scale_out; it's used to take a 0-100 number and put it
//into the proper scale for the element to understand
int Element::scale_in(int num){
        if(max-min==0){ return(num); }
        return(round((log(num)/log(100)*(max-min))+min));
}
And here is the diff, if you prefer that format:

Code: Select all

--- src/alsa_classes.cpp	(revision 181)
+++ src/alsa_classes.cpp	(working copy)
@@ -158,13 +158,13 @@
 //this is used internally to scale a number to be from 0-100
 int Element::scale_out(int num){
 	if(max-min==0){ return(num); }
-	return(ceil(100.0*(num-min)/(max-min)));
+	return(ceil(pow(100.0, (num-min)/(double)(max-min))));
 }
 //this is the inverse of scale_out; it's used to take a 0-100 number and put it
 //into the proper scale for the element to understand
 int Element::scale_in(int num){
 	if(max-min==0){ return(num); }
-	return(floor((num*(max-min)/(100))+min));
+	return(round((log(num)/log(100)*(max-min))+min));
 }
 //this will grab the highest value in the element
 int Element::get(){
If you wanted some other scaling formula, these two functions are where you'd define it.
[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]
Henry
Posts: 863
Joined: Sun 30 Jul 2006, 02:28
Location: Oregon USA
Contact:

#142 Post by Henry »

OK! I can see a little that your doing with the pow and log, but I'm not used to getting into and out of source code, so will be happy to wait for you to do that.

Otherwise, it's a nice program (I think Barry said "superb".) But in my experience the curve is sufficiently off to be annoying.

Thanks
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#143 Post by don570 »

I tried retrovol on the latest porteus.org linux distribution
(32-bit
and found that it works well except that when it is
launched it hides behind the upper most window :cry:

Download here

So if it's launched from a gtkdialog script
it will be located behind the script window.
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#144 Post by disciple »

Perhaps it is somehow being caught by a window manager trying to prevent programs from "stealing the focus". What window manager is in Porteus?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
User avatar
don570
Posts: 5528
Joined: Wed 10 Mar 2010, 19:58
Location: Ontario

#145 Post by don570 »

xcfe.org seems to have it's own window manager???.

Porteus has a popup list of open windows like Openbox.

I'll try to change focus setting in config and see
if there's a difference.

Thanks for advice.
_______________________________
Henry
Posts: 863
Joined: Sun 30 Jul 2006, 02:28
Location: Oregon USA
Contact:

Volume control curve

#146 Post by Henry »

Posted: Mon Feb 27, 2012 5:02 pm Post subject:

Pizzasgood wrote:
If anybody is interested in having it changed right now, there are only two lines of source code that would need adjusting. Otherwise, you'll have to wait until I get around to adding it proper, which is more work since I want it to be optional - I'm kind of busy lately so I might not work on it for a week or two. Also, this hasn't been tested thoroughly - it is possible that in some situations near the maximum and minimum volume levels you might have trouble getting it to completely max (or min) out. I will test that more rigorously when I implement it for real.

Anyway, the changes are to the alsa_classes.cpp file. The lines to change are 161 and 167, in the scale_out and scale_in functions.
As I commented above, great - I'll wait. My skills are not up to that, having never compiled anything. I do know this is an annoying deficiency in retrovol. I just returned to using it after leaving a minimal absvolume. That the curve is so crowded at the top is perhaps not so bad as the lack of a true mute.

This is your baby and I hope you will treat it right in this respect too. Apologies if the deficiency is somehow aggravated in my setup, but doing it right can only help. Thanks in advance!
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#147 Post by disciple »

Another minor "issue" is that it segfaults if there is no mixer available (i.e. if sound is not working). I can think of a couple of alternative behaviours for this situation...
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

Re: Volume control curve

#148 Post by disciple »

Henry wrote:...
That the curve is so crowded at the top is perhaps not so bad as the lack of a true mute.
...
It has a "true mute" as far as I can tell. Am I missing something, or are you?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
Henry
Posts: 863
Joined: Sun 30 Jul 2006, 02:28
Location: Oregon USA
Contact:

Re: Volume control curve

#149 Post by Henry »

disciple wrote:
Henry wrote:...
That the curve is so crowded at the top is perhaps not so bad as the lack of a true mute.
...
It has a "true mute" as far as I can tell. Am I missing something, or are you?
Yes, it's entirely possible, and likely, that I'm missing something. My main objection was the "curve" that makes adjustment rather "touchy."

The whole mixer thing is apparently very capable and thus complicated. The only thing I use is the screen bar (front?), and I would prefer to have this simulate a conventional audio potentiometer that was at zero level, i.e. mute, at the extreme left/bottom/counterclockwise.

A problem for me is that there are a number of volume controls. Different apps have their own, mplayer, youtube, etc, and these can blast past the front control. Is there a simple tutorial for all this, like what is IEC958, and should it be checked, etc?
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

Re: Volume control curve

#150 Post by disciple »

My main objection was the "curve" that makes adjustment rather "touchy."
Like Pizzasgood, I've always found the "curve" fine on my hardware. But you might find it helps to use the slider (rather than the mouse scroll wheel) and go into the options and make it really long.
Henry wrote:...
The only thing I use is the screen bar
If I understand correctly, you're saying you only use the main slider that comes up when you click on the icon, i.e. you don't use the "full window" available from a right-click on the icon, which provides a number of controls.
(front?),
You might have it controlling something called "front" on your machine. I think it would most often default to controlling something called "Master playback" or similar. It is configurable - look on the "tray" tab in the preferences.
and I would prefer to have this simulate a conventional audio potentiometer that was at zero level, i.e. mute, at the extreme left/bottom/counterclockwise.
You're saying you want a knob rather than a slider? There are other tray applets which provide that if you want to check them out... although knob vs slider wouldn't itself make any difference to the "curve".

A problem for me is that there are a number of volume controls. Different apps have their own, mplayer, youtube, etc, and these can blast past the front control.[/quote]
Personally I like to configure all my applications to use a software volume control, which I use initially to adjust them all to output at similar levels, and then I just use retrovol when I need to adjust the volume on any particular occasion.
Is there a simple tutorial for all this, like what is IEC958, and should it be checked, etc?
I'm not sure there could be a simple tutorial, because different sound cards seem to have all sorts of weird and wonderful controls, or names for them.
Last edited by disciple on Sat 23 Feb 2013, 11:21, edited 1 time in total.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#151 Post by disciple »

Oh, I think I see what you mean about the mute. If you slide the volume down to zero it just turns the volume down, even though the tooltip says it is muted. To get a true mute you need to middle click on the tray icon, or uncheck the check box in the "full window".
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#152 Post by disciple »

Hey, has anyone else noticed this?:
If the volume is at 0% or 100%, scrolling the mouse wheel over the tray icon often does not have any effect. After left clicking on the icon and then clicking again to close the slider, scrolling over the icon always works. Also, if the volume is not at 0% or 100%, I think it always works.
It looks like a way to reliably trigger the problem is to disable the context menu and right-click twice on the icon to bring up the "full window" and close it again...
I'm wondering if it is anything to do with my tray or my GTK version or something - I'll see if I can investigate further.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#153 Post by disciple »

disciple wrote:Hey, has anyone else noticed this?:
If the volume is at 0% or 100%, scrolling the mouse wheel over the tray icon often does not have any effect. After left clicking on the icon and then clicking again to close the slider, scrolling over the icon always works. Also, if the volume is not at 0% or 100%, I think it always works.
It looks like a way to reliably trigger the problem is to disable the context menu and right-click twice on the icon to bring up the "full window" and close it again...
I'm wondering if it is anything to do with my tray or my GTK version or something - I'll see if I can investigate further.
I booted a version of slacko that I have around, and the problem didn't seem to occur with its retrovol. So I tried running my Arch retrovol in slacko and it did have the problem. So I think the problem is not the GTK version it is running against.
I thought maybe the retrovol in slacko was build long ago and therefore used eggtrayicon rather than gtkstatusicon. So I hacked the gtkstatusicon code out to force it to use eggtrayicon, and built it in Arch, and the problem still occurred.
I'm puzzled now. Could the problem somehow be the gtk version it was compiled against?
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER
User avatar
vicmz
Posts: 1262
Joined: Sun 15 Jan 2012, 22:47

#154 Post by vicmz »

Retrovol has never worked on my computer, does it work for others? :lol: From Lucid Puppy to the very latest development versions of Precise, Retrovol doesn't do anything to the volume level -- or at least not in the Intel- or AMD-powered desktop computers I've used. I always rely on the volume control of Gnome MPlayer and DeaDBeeF, who wants to make a scientific investigation to rise/low volume when all they wish at the moment is to enjoy a video or their favourite music? :lol: Now seriously, this is the kind of bugs that make some windoze users say "aahhh, LINUX is crappy!" It'd be great to find a solution.
[url=http://murga-linux.com/puppy/viewtopic.php?t=76948]Puppy Linux en español[/url]
Henry
Posts: 863
Joined: Sun 30 Jul 2006, 02:28
Location: Oregon USA
Contact:

#155 Post by Henry »

error
Last edited by Henry on Sat 23 Feb 2013, 15:57, edited 1 time in total.
User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#156 Post by 666philb »

vicmz wrote:Retrovol has never worked on my computer, does it work for others? :lol: From Lucid Puppy to the very latest development versions of Precise, Retrovol doesn't do anything to the volume level -- or at least not in the Intel- or AMD-powered desktop computers I've used. I always rely on the volume control of Gnome MPlayer and DeaDBeeF, who wants to make a scientific investigation to rise/low volume when all they wish at the moment is to enjoy a video or their favourite music? :lol: Now seriously, this is the kind of bugs that make some windoze users say "aahhh, LINUX is crappy!" It'd be great to find a solution.
hi vicmz

right click on the retrovol tray icon and choose 'config window' then click on the 'hardware' tab and try changeing hw:0 to hw:1 or visa versa.....

any luck?
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331
Henry
Posts: 863
Joined: Sun 30 Jul 2006, 02:28
Location: Oregon USA
Contact:

#157 Post by Henry »

error
Last edited by Henry on Sat 23 Feb 2013, 15:59, edited 1 time in total.
Henry
Posts: 863
Joined: Sun 30 Jul 2006, 02:28
Location: Oregon USA
Contact:

Re: Volume control curve

#158 Post by Henry »

Forum seems to be not working right. Anyway, I have no comment for disciple.
User avatar
vicmz
Posts: 1262
Joined: Sun 15 Jan 2012, 22:47

#159 Post by vicmz »

666philb wrote: hi vicmz

right click on the retrovol tray icon and choose 'config window' then click on the 'hardware' tab and try changeing hw:0 to hw:1 or visa versa.....

any luck?
Nope. Everytime I do it Retrovol crashes and exits.
[url=http://murga-linux.com/puppy/viewtopic.php?t=76948]Puppy Linux en español[/url]
User avatar
L18L
Posts: 3479
Joined: Sat 19 Jun 2010, 18:56
Location: www.eussenheim.de/

Retrovol 0.12 (Volume mixer)

#160 Post by L18L »

vicmz wrote:Retrovol has never worked on my computer, does it work for others? :lol:...
Sometimes but not always.

aplay /usr/share/audio/2barks.au
Clicking up and down there is no difference in Volume
aplay /usr/share/audio/2barks.au

Right klick > Config window > tab between main and hardware (don't see it in English at the moment) > 3rd row

change from wrong
32: Master Playback Volume
to
9:PCM Playback Volume
Apply

and sound volume becomes different

Glad for being able to control sound volume now :lol:

hi vicmz
using that
any luck?
Post Reply