Retrovol 0.13.1 (Volume mixer)

Audio editors, music players, video players, burning software, etc.
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#136 Post 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
Attachments
retrovol_NLS-0.12T-i486.pet
(5.19 KiB) Downloaded 777 times
retrovol-0.12T-i486.pet
I shrunk the icon size a bit too, feel free to revert if I "uglified" them
(24.19 KiB) Downloaded 747 times
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

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

Retrovol master volume control

#137 Post 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

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

#138 Post 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.
[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
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

Re: Retrovol master volume control

#139 Post 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.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

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

#140 Post 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.

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.

Post Reply