WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: nifty volume control for jwm  (Read 33110 times)

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: nifty volume control for jwm
« Reply #15 on: February 21, 2009, 10:57:11 AM »
...there's always sGmixer or some equivalent, if someone needs it.   Volume controls exist on most apps (including flash player). Adding a mike on/off button in .jwmrc-tray is useful when using skype.
« Last Edit: February 21, 2009, 11:57:38 AM by jpeters »

Offline tobiaus

  • Suspended
  • Hero Member
  • *****
  • Posts: 599
Re: nifty volume control for jwm
« Reply #16 on: February 21, 2009, 12:06:52 PM »
curaga: no worries, any old version of ossmix (or new version) should be fine. if the ones in tc do relative positions, less code is needed, if not, the script is more useful :)

mikshaw: no worries, you're probably right, but i thought i'd mention it. jpeters: flash apps yes, and xmms as well, but i've often found the want to change the volume before they start to make noise, particularly with online applets and youtube. also i often find i've turned ossmix down to 0 and the applet volume controls will only work from 0 times 0 to 100 times 0 then. my favorite volume control is the applet in xfce, it's always easy to reach quickly- the closest thing to it in any smaller distro is probably the murgalua dock app in flux-oriented versions of dsl. (but i prefer jwm.)

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: nifty volume control for jwm
« Reply #17 on: February 21, 2009, 01:02:42 PM »
0 times 0 to 100 times 0 then.....

sounds a  bit like my retirement holdings...I wonder if there's a control for that....

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: nifty volume control for jwm
« Reply #18 on: February 21, 2009, 01:56:35 PM »
I've recently tried to create a native fltk/jwm dockapp for controlling a single channel.
It defaults to vmix0-vol, but can be used with any channel (I needed misc.front1).

Only works with OSS4, the binary is 28kb, and no external dependencies.
Once it gets good enough, it'll be added to the OSS extension.

TC binary preview:
http://www.ziddu.com/download/3594698/tc-mixer.gz.html

Comments please :)

edit: screenshot in action


Right-click or middle-click to mute
« Last Edit: February 21, 2009, 02:02:49 PM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: nifty volume control for jwm
« Reply #19 on: February 21, 2009, 02:28:11 PM »
Works nicely.  I'm curious how you get it on the tray...I don't see anything in .jwmrc-tray. Is there any way to get right-click options, say for mic vol?

edit: I see you DO have right-click features. Could I see the source code for how you do this? Thanks.
edit2  oh....loads to the dock automatically from the  program......I'll try something with tcl-tk......

edit: maybe there's no need for separate menu entries for OSS/sound on-off ?
« Last Edit: February 21, 2009, 03:39:36 PM by jpeters »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: nifty volume control for jwm
« Reply #20 on: February 21, 2009, 05:54:03 PM »
Source will be posted when I consider this ready :)

Yes, it uses the freedesktop-compliant dock of Jwm. The spec is here:
http://standards.freedesktop.org/systemtray-spec/systemtray-spec-latest.html

Menu entries - what do you mean? Soundon could also be started as an extension install script, but the menu entry would still be nice if one disables sound and wants to re-enable.

Edit: you can start two instances if you need one to control the mic vol. Not as clean as a right-click to change channels, but it works.
« Last Edit: February 21, 2009, 05:57:50 PM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: nifty volume control for jwm
« Reply #21 on: February 21, 2009, 07:59:07 PM »
Volume controls within applications are often inconvenient.  I like to have a fairly even volume level from one application to the next, and using an application's volume control can end up making more work.  For example, xmms volume control changes the system volume rather than the volume for the application.  If i then load an app that has a lower volume I have to manually turn it up.  It ends up being similar to the crappy levels you experience with television...when the commercials come on you often have to turn down the volume because they're recorded at higher levels than the shows.

A few applications don't allow me to use my centralized volume via hotkey, though.  For example, UT (and I suspect a great many other games, though I don't have the experience to say for sure) prevents me from using my window manager's hotkeys, so if it's too loud or quiet I'm forced to do a number of clicks to access the in-game volume control.  That's annoying, so instead I start the game with a wrapper that sets the system volume to a compatible level before starting the game, and it works out fine.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: nifty volume control for jwm
« Reply #22 on: February 21, 2009, 08:04:17 PM »
Source will be posted when I consider this ready :)

Yes, it uses the freedesktop-compliant dock of Jwm. The spec is here:
http://standards.freedesktop.org/systemtray-spec/systemtray-spec-latest.html

The specs look  like visual  c++ stuff. I'll await your code to see how it works with  jwm.  

Quote
Menu entries - what do you mean? Soundon could also be started as an extension install script, but the menu entry would still be nice if one disables sound and wants to re-enable.

I was thinking having to turn the  sound on unusual, and with the icon it's simple to mute. Maybe there's some other reason needing to turn it on and off from the menu?  I load OSS (soundon) with my skype script on boot and leave it on.  

edit.  a drop down mixer might be a consideration also, instead of just volume.
« Last Edit: February 21, 2009, 09:23:26 PM by jpeters »

Offline mikshaw

  • Sr. Member
  • ****
  • Posts: 368
Re: nifty volume control for jwm
« Reply #23 on: February 21, 2009, 08:18:17 PM »
Not that it matters, but I like to hear myself type.....
I'm not sure why turning OSS on and off is a desired feature, apart from the possibility that it crashes, which I've never seen in any distro I've ever used.
Personally I put this in bootlocal.sh, and it suits me just fine:
Code: [Select]
if [ -x /usr/sbin/soundon ]; then
/usr/sbin/soundon
fi

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: nifty volume control for jwm
« Reply #24 on: February 22, 2009, 11:13:11 AM »
So guys, with improvements the 0.5 version is ready.
There is one bug I know of - the first click might open the volume slider under a window. I'm starting to think this is a Jwm bug, since I'm sure I ask to be above correctly, and all tries after the first come up above windows right like they should. This means it's ready on my part; source shall be posted :p (source? you can't handle the source!)

Improvements from previous version:
- True options parsing
- Transparent background for the volume slider window
- Tooltip shows current level
- Right-click menu
- Multiple sound cards support

TC binary:
http://www.ziddu.com/download/3603351/tc-mixer.gz.html

Sources:
http://www.ziddu.com/download/3603304/tc-mixer-0.5.tgz.html
« Last Edit: February 22, 2009, 11:15:26 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline jpeters

  • Restricted
  • Hero Member
  • *****
  • Posts: 1017
Re: nifty volume control for jwm
« Reply #25 on: February 22, 2009, 07:59:14 PM »
So guys, with improvements the 0.5 version is ready.
There is one bug I know of - the first click might open the volume slider under a window

I was worried some pixels went out on my screen when I got a black box....later I found a copy of the mixer icon next to it. This happens if you reload windows manager.

Don't loose sleep over this....but I've got the slider at 88% right now and XMMS playing, with tc-mixer offering the option to "UNMUTE"....the toggle is pretty easy to outsmart.  (edit: IMHO the first version without the balloon message....just fade when muted....is far superior....)

I really liked the simple right-click mute function on the former version. I can't think of why I need to exit the mixer enough to have to read and click every time I want a simple mute. (how about an options menu to choose colors for the icon?......NOT!..)

edit: maybe unconventional...but you could keep the neat right click mute on/off feature by putting the exit option under the slider.....no time lost, since you have to click on it anyway...  I like that feature enough to keep the older version...

Thanks for the source....basic C++ stuff. 

Edit:  oops...the icon moved off the dock, I guess when I changed windows.  It's sitting about 2 inches off the left corner of the screen.  I have the "MOI" version running...

Edit2:  I have a strong hunch there's some conflicts....I've had several freeze-ups related to sound since loading tc-mixer; last was when I clicked on the play button for xmms.  I rarely see a freeze on this system. 

« Last Edit: February 23, 2009, 02:52:02 AM by jpeters »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: nifty volume control for jwm
« Reply #26 on: February 23, 2009, 03:58:52 AM »
Heh, I know I should've disabled the slider when muted ;)
The middle-click mute still works like it did in 0.4, now just right-click has been reassigned.

Sound freezes.. hmm, I didn't see any when testing, but I'll see what I can do.
The only barriers that can stop you are the ones you create yourself.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: nifty volume control for jwm
« Reply #27 on: February 23, 2009, 04:54:27 AM »
if I execute this command:
tc-mixer -channel vol

I got

Using channel vol
Not a valid channel name: vol

this is my ossmix output

tc@box:~$ ossmix
Selected mixer 0/AC97 Mixer (STAC9721)
Known controls are:
vol <both/leftvol>[:<rightvol>] (currently 75:75)
vol.rec ON|OFF (currently OFF)
pcm <both/leftvol>[:<rightvol>] (currently 75:75)
speaker <monovol> (currently 0)
line <both/leftvol>[:<rightvol>] (currently 32:32)
line.rec ON|OFF (currently OFF)
mic <monovol> (currently 0)
mic.rec ON|OFF (currently ON)
cd <both/leftvol>[:<rightvol>] (currently 75:75)
cd.rec ON|OFF (currently OFF)
igain <both/leftvol>[:<rightvol>] (currently 75:75)
aux1 <both/leftvol>[:<rightvol>] (currently 32:32)
aux1.rec ON|OFF (currently OFF)
phone <both/leftvol>[:<rightvol>] (currently 0:0)
phone.rec ON|OFF (currently OFF)
mono <monovol> (currently 75)
mono.rec ON|OFF (currently OFF)
video <both/leftvol>[:<rightvol>] (currently 0:0)
video.rec ON|OFF (currently OFF)
depth <monovol> (currently 0)
mixext.spkmode <FRONT|SPREAD> (currently SPREAD)
mixext.dualdac ON|OFF (currently ON)
vmix0-src <Fast|Low|Medium|High|High+|Production|OFF> (currently Fast)
vmix0-vol <monovol> (currently 25.0 dB)
vmix0-out1 <leftVU>:<rightVU>] (currently 126:126)
vmix0-in <leftVU>:<rightVU>] (currently 0:0)
vmix0-out.pcm1 <both/leftvol>[:<rightvol>] (currently 22.0:22.0 dB)
vmix0-out2 <leftVU>:<rightVU>] (currently 126:126)
vmix0-out.pcm2 <both/leftvol>[:<rightvol>] (currently 25.0:25.0 dB)
vmix0-out3 <leftVU>:<rightVU>] (currently 0:0)
vmix0-out.pcm3 <both/leftvol>[:<rightvol>] (currently 25.0:25.0 dB)
vmix0-out4 <leftVU>:<rightVU>] (currently 0:0)
vmix0-out.pcm4 <both/leftvol>[:<rightvol>] (currently 25.0:25.0 dB)
vmix0-out5 <leftVU>:<rightVU>] (currently 0:0)

If I do
tc-mixer -channel vmix0-out.pcm1
it works :'(
dCore user

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: nifty volume control for jwm
« Reply #28 on: February 23, 2009, 05:13:54 AM »
@jls: please post the output of
Quote
ossmix -D | grep vol

Meanwhile, there's a new version :)

Changes:
*       Hopefully fixed sound freezes
*       Mute more intelligent
*       Re-dock switch for Jwm restarts

http://www.ziddu.com/download/3611784/tc-mixer.gz.html
http://rapidshare.de/files/45565682/tc-mixer-0.6.tgz.html
« Last Edit: February 23, 2009, 05:16:20 AM by curaga »
The only barriers that can stop you are the ones you create yourself.

Offline jls

  • Hero Member
  • *****
  • Posts: 2135
Re: nifty volume control for jwm
« Reply #29 on: February 23, 2009, 06:02:48 AM »
now it works just launching tc-mixer ;)
dCore user