Page 8 of 10

Posted: Tue 28 Feb 2012, 01:02
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.

Posted: Tue 28 Feb 2012, 03:02
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

Posted: Sat 02 Jun 2012, 20:42
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.

Posted: Sat 02 Jun 2012, 23:46
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?

Posted: Wed 06 Jun 2012, 23:40
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.
_______________________________

Volume control curve

Posted: Wed 18 Jul 2012, 12:20
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!

Posted: Thu 14 Feb 2013, 08:54
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...

Re: Volume control curve

Posted: Sat 23 Feb 2013, 03:34
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?

Re: Volume control curve

Posted: Sat 23 Feb 2013, 05:34
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?

Re: Volume control curve

Posted: Sat 23 Feb 2013, 08:27
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.

Posted: Sat 23 Feb 2013, 08:30
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".

Posted: Sat 23 Feb 2013, 08:40
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.

Posted: Sat 23 Feb 2013, 11:30
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?

Posted: Sat 23 Feb 2013, 12:17
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.

Posted: Sat 23 Feb 2013, 15:28
by Henry
error

Posted: Sat 23 Feb 2013, 15:33
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?

Posted: Sat 23 Feb 2013, 15:35
by Henry
error

Re: Volume control curve

Posted: Sat 23 Feb 2013, 15:49
by Henry
Forum seems to be not working right. Anyway, I have no comment for disciple.

Posted: Sun 24 Feb 2013, 15:59
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.

Retrovol 0.12 (Volume mixer)

Posted: Sun 24 Feb 2013, 16:28
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?