Page 7 of 10

Posted: Thu 23 Feb 2012, 10:06
by technosaurus

Code: Select all

CXXFLAGS=" -DGTK_NO_CHECK_CASTS -DG_DISABLE_CAST_CHECKS  -mno-accumulate-outgoing-args -pipe -combine -Os -fno-rtti -fno-exceptions -momit-leaf-frame-pointer -fomit-frame-pointer -fmerge-all-constants -ffunction-sections -fdata-sections -march=i486 -mtune=i686 "  CFLAGS=" -mno-accumulate-outgoing-args -DGTK_NO_CHECK_CASTS -DG_DISABLE_CAST_CHECKS -pipe -combine -Os -momit-leaf-frame-pointer -fomit-frame-pointer -ffunction-sections -fdata-sections -fmerge-all-constants -march=i486 -mtune=i686 " LDFLAGS="  -Wl,-O4,-Os,-relax,--sort-common,--gc-sections,--as-needed,-s " ./configure --disable-rpath --prefix=/usr --sysconfdir=/etc --localstatedir=/var
if you let autotools link in all the pkg-config dependencies you lose all portability so I manually did this:

Code: Select all

g++ -DGTK_NO_CHECK_CASTS -DG_DISABLE_CAST_CHECKS   -pipe -combine -Os -fno-rtti -fno-exceptions -momit-leaf-frame-pointer -fomit-frame-pointer -fmerge-all-constants -ffunction-sections -fdata-sections -march=i486 -mtune=i686   -Wl,-O4,-Os,-relax,--sort-common,--gc-sections,--as-needed,-s  -o retrovol alsa_classes.o config_settings.o config_window.o eggtrayicon.o main.o retro_slider.o -lasound -lgtk-x11-2.0
or assuming you use shared libraries you can modify src/Makefile.am
--- retrovol_LDADD = -lasound -lX11 -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0
+++ retrovol_LDADD = -lasound -lgtk-x11-2.0
a more "proper" fix would be:
retrovol_LDADD = -lasound `pkg-config --libs gtk+-2.0`
(and leave it up to distros to rectify the pkg-config files appropriately so that future updates don't break due to unnecessary direct dependencies)

and now the size is under 50kb and more portable

here are the direct dependencies now:
  • # objdump -x retrovol-0.12T-i486/usr/bin/retrovol |grep NEEDED
    NEEDED libasound.so.2
    NEEDED libgtk-x11-2.0.so.0
    NEEDED libstdc++.so.6
    NEEDED libm.so.6
    NEEDED libc.so.6
    NEEDED libgdk-x11-2.0.so.0
    NEEDED libcairo.so.2
    NEEDED libX11.so.6
    NEEDED libgobject-2.0.so.0
    NEEDED libglib-2.0.so.0
This is what they were:
  • # objdump -x retrovol-0.12/usr/bin/retrovol |grep NEEDED
    NEEDED libasound.so.2
    NEEDED libX11.so.6
    NEEDED libgtk-x11-2.0.so.0
    NEEDED libgdk-x11-2.0.so.0
    NEEDED libatk-1.0.so.0
    NEEDED libgdk_pixbuf-2.0.so.0
    NEEDED libpangocairo-1.0.so.0
    NEEDED libpango-1.0.so.0
    NEEDED libcairo.so.2
    NEEDED libgobject-2.0.so.0
    NEEDED libgmodule-2.0.so.0
    NEEDED libdl.so.2
    NEEDED libglib-2.0.so.0
    NEEDED libstdc++.so.6
    NEEDED libm.so.6
    NEEDED libgcc_s.so.1
    NEEDED libc.so.6

Retrovol master volume control

Posted: Mon 27 Feb 2012, 17:22
by Henry
I've used several versions of retrovol, and the volume characteristic doesn't seem right. Almost no change in the lower two thirds with very rapid changes in the upper range. Also I can't actually mute it at the bottom, even though it shows the red X.

Shouldn't it give an approximately equal change in perceived volume for each equal slider increment?

Using QuirkyNop-1.2 and GNOME-MPlayer

Thanks

Posted: Mon 27 Feb 2012, 20:09
by Pizzasgood
I suspect that different sound cards might use different curves, because it seems fine on my end. Right now I'm just linearly using the value range that Alsa reports. I'll add an entry to my todo list to add some other optional scales in case user hardware or preference differs from my own.

Re: Retrovol master volume control

Posted: Mon 27 Feb 2012, 21:33
by technosaurus
Henry wrote:Shouldn't it give an approximately equal change in perceived volume for each equal slider increment?
I have often had the same perception and wonder if it could be logarithmic v. linear scale issue (since sound is measured in decibels) but I took it as part of the "retro". Now if only it went to 11.

Posted: Mon 27 Feb 2012, 23:39
by Henry
Thanks, guys,

I had mentioned using Gnome-Mplayer but that's probably irrelevant - actually the small volume control in the mplayer GUI works fine by itself.

The computer is a Dell Optiplex 745, with
ADI 1983 High Definition Audio
Stereo conversion 20-bit A-D; 20-bit D-A

I can't really remember, but it could be my previous computer didn't have this problem since I didn't notice it then.

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