WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Flit: an FLTK-native "tray" with clock, sound control, and battery monitor  (Read 35937 times)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
I updated the .cpp file up in the start of the thread.
--
ML

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
make aborts with an error about not finding soundcard.h - even though it is present in /usr/include?

Offline alu

  • Sr. Member
  • ****
  • Posts: 429
Mike, here is the output of ossmix (i am using OSS.tcz, so the 4.1 oss); i also tried to change the volume for pcm2, and even if it apparently does it, it doesn't seem to:

tc@box:~$ ossmix   
Selected mixer 0/High Definition Audio 0x11061708
Known controls are:
jack.black.pcm2 [<leftvol>:<rightvol>] (currently 38.4:38.4 dB)
jack.pink.mode <pcm3|input> (currently pcm3)
jack.pink.pcm3 [<leftvol>:<rightvol>] (currently 38.4:38.4 dB)
jack.blue.mode <pcm2|input> (currently input)
jack.green.mix [<leftvol>:<rightvol>] (currently 38.4:38.4 dB)
jack.green.pcm1 [<leftvol>:<rightvol>] (currently 45.4:45.4 dB)
jack.green.pcm3 [<leftvol>:<rightvol>] (currently 45.4:45.4 dB)
jack.green.pcm2 [<leftvol>:<rightvol>] (currently 54.1:54.1 dB)
jack.green.pcm4 [<leftvol>:<rightvol>] (currently 45.4:45.4 dB)
jack.gray.pcm4 [<leftvol>:<rightvol>] (currently 38.4:38.4 dB)
record.select1.select1 <mix|pcm3|pcm2> (currently mix)
record.select1 [<leftvol>:<rightvol>] (currently 29.6:29.6 dB)
vmix0-enable ON|OFF (currently ON)
vmix0-rate <decimal value> (currently 48000) (Read-only)
vmix0-channels <Stereo|Multich> (currently Stereo)
vmix0-src <Fast|Low|Medium|High|High+|Production|OFF> (currently Fast)
vmix0-outvol <monovol> (currently 25.0 dB)
vmix0-invol <monovol> (currently 25.0 dB)
vmix0.pcm7 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm8 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm9 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
vmix0.pcm10 [<leftvol>:<rightvol>] (currently 25.0:25.0 dB)
tc@box:~$ ossmix -d0 jack.green.pcm2 +50
Value of mixer control jack.green.pcm2 set to 104.1:104.1
tc@box:~$ ossmix -d0                   
Selected mixer 0/High Definition Audio 0x11061708
Known controls are:
jack.black.pcm2 [<leftvol>:<rightvol>] (currently 38.4:38.4 dB)
jack.pink.mode <pcm3|input> (currently pcm3)
jack.pink.pcm3 [<leftvol>:<rightvol>] (currently 38.4:38.4 dB)
jack.blue.mode <pcm2|input> (currently input)
jack.green.mix [<leftvol>:<rightvol>] (currently 38.4:38.4 dB)
jack.green.pcm1 [<leftvol>:<rightvol>] (currently 45.4:45.4 dB)
jack.green.pcm3 [<leftvol>:<rightvol>] (currently 45.4:45.4 dB)
jack.green.pcm2 [<leftvol>:<rightvol>] (currently 54.1:54.1 dB)
jack.green.pcm4 [<leftvol>:<rightvol>] (currently 45.4:45.4 dB)
jack.gray.pcm4 [<leftvol>:<rightvol>] (currently 38.4:38.4 dB)

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Juanito:  Sorry, I should have thought of that.  I posted the soundcard.h back at the top of the thread, but I'll attach it here too.  I downloaded this version straight from the OSS home repository.

alu: It looks like your sound device is similar to Juanito's, so if it works for Juanito, it would be likely to work for you too. I'll put together a package request with the latest code and ask one of the site admins to post it here.  I'm not supposed to post .tce's and .tcz's directly.
--
ML

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
OK, flit compiles now - but soundcard.h in base-devs is already OSS ready?

I'm not sure of the expected behaviour, but flit now has a "loudspeaker with sound coming out of it" icon and if I hold the cursor over it, it says "250", which seems like it corresponds to 25.0dB

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Same here.
Here is the output starting with the found device:
Code: [Select]
===>    61      Volume control item: 'vmix0-outvol'
===>    Min is 0, max is 250, type is 19
Root RGB colors are 12:17:1b
Value is 0xFA00FA (=250)
Sound ctrl. new value is 250
Value is 0xFA00FA (=250)
Sound ctrl. new value is 250
Value is 0xFA00FA (=250)
Sound ctrl. new value is 250
Value is 0xFA00FA (=250)
Sound ctrl. new value is 250
Value is 0xFA00FA (=250)
Sound ctrl. new value is 250
[/quote]
Seems to be polling all the time, even when the mouse is not hoving.
Mouse wheel does not ajust same Value is displayed.
Clicking on speaker does toggle mute
10+ Years Contributing to Linux Open Source Projects.

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Robert:  That helps.  It the mixer control type of 19 indicates it is a MIXT_STEREODB type (marked obsolete in the header!).  I added support for this type, I hope, in version 0.9.0.   I'm only doing a proportional conversion between the dB and % values, so perhaps a large part of the range won't be useful.  Maybe later I can do a more-mathematically appropriate value conversion.  

Here is the updated version of the source.  I'll also post an update to the top of the thread.

EDIT: Issue with DIAG compile problem fixed.
--
Mike L
« Last Edit: August 29, 2009, 10:48:00 AM by MikeLockmoore »

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14535
I didn't see a change - note that "about" still reports 0.8.9 and "help" gives "unable to follow the link ./flit_help.htm, no such file or directory", maybe not implemented yet?

Looking good nonetheless  :)

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Same results on v.0.9.0. Unable to change volume.
DIAG enabled now does not compile.
« Last Edit: August 29, 2009, 09:03:28 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
EDITED:

Here is a fixed 0.9.0 with DIAG already enabled and  much more diag output, including details during the OSS parameter selection proccess.

RobertS: if you can run this, please post the full list of OSS mixer control parameters that Flit considers.

--
ML
« Last Edit: August 29, 2009, 10:47:45 AM by MikeLockmoore »

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Juanito:

Here is the help file.  I'll post it up at reply 1.
--
ML
« Last Edit: August 29, 2009, 09:37:22 AM by MikeLockmoore »

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Juanito:  When you can spare the time, could you get the very latest flit.cpp, compile, run it, and capture the output during the OSS parameter selection?  It's posted two comments back.

Here is the initial output when I run it, although it should now run through ALL of the parameters:

Code: [Select]
Mixer device is 'ICH AC97 Mixer (STAC9750)', priority 10
There are 60 controls in the mixer
--->    0       Considering volume control item: '', type 0, flags 0x4
                        (not selected)
--->    1       Considering volume control item: 'vol', type 1, flags 0x84
                        (not selected)
--->    2       Considering volume control item: 'vol', type 5, flags 0x403
===>    2       Selected volume control item: 'vol'
...

The 0x0400 flag bit indicates field MAIN_VOLUME, and type 5 is STEREOSLIDER.  I hope we can see a combo of type and flags that will indicate a useful parameter.  Do you have a command-line option that works with ossmix to set the sound volume?
--
ML
« Last Edit: August 29, 2009, 10:50:18 AM by MikeLockmoore »

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Here is my latest results:
Code: [Select]
No config file found: using defaults.
Mixer device is 'High Definition Audio ALC662', priority 10
There are 74 controls in the mixer
---> 0 Considering volume control item: '', type 0, flags 0x4
(not selected)
---> 1 Considering volume control item: '2', type 12, flags 0x4
(not selected)
---> 2 Considering volume control item: 'jack', type 1, flags 0x4
(not selected)
---> 3 Considering volume control item: 'jack.green', type 1, flags 0x4
(not selected)
---> 4 Considering volume control item: 'jack.green.mode', type 3, flags 0x3
(not selected)
---> 5 Considering volume control item: 'jack.green.mute', type 21, flags 0x3
(not selected)
---> 6 Considering volume control item: 'jack.green.front', type 20, flags 0x103
(not selected)
---> 7 Considering volume control item: 'jack.green.front-mute', type 21, flags 0x3
(not selected)
---> 8 Considering volume control item: 'jack.green.mix-mute', type 21, flags 0x3
(not selected)
---> 9 Considering volume control item: 'jack.pink', type 1, flags 0x4
(not selected)
---> 10 Considering volume control item: 'jack.pink.mode', type 3, flags 0x3
(not selected)
---> 11 Considering volume control item: 'jack.pink', type 20, flags 0x103
(not selected)
---> 12 Considering volume control item: 'jack.pink.mute', type 21, flags 0x3
(not selected)
---> 13 Considering volume control item: 'jack.pink.center/lfe', type 20, flags 0x103
(not selected)
---> 14 Considering volume control item: 'jack.pink.center/lfe-mute', type 21, flags 0x3
(not selected)
---> 15 Considering volume control item: 'jack.pink.mix-mute', type 21, flags 0x3
(not selected)
---> 16 Considering volume control item: 'jack.fp-pink', type 1, flags 0x4
(not selected)
---> 17 Considering volume control item: 'jack.fp-pink.mode', type 3, flags 0x3
(not selected)
---> 18 Considering volume control item: 'jack.fp-pink', type 20, flags 0x103
(not selected)
---> 19 Considering volume control item: 'jack.fp-pink.mute', type 21, flags 0x3
(not selected)
---> 20 Considering volume control item: 'jack', type 1, flags 0x4
(not selected)
---> 21 Considering volume control item: 'jack.blue', type 1, flags 0x4
(not selected)
---> 22 Considering volume control item: 'jack.blue.mode', type 3, flags 0x3
(not selected)
---> 23 Considering volume control item: 'jack.blue.mute', type 21, flags 0x3
(not selected)
---> 24 Considering volume control item: 'jack.blue.rear', type 20, flags 0x103
(not selected)
---> 25 Considering volume control item: 'jack.blue.rear-mute', type 21, flags 0x3
(not selected)
---> 26 Considering volume control item: 'jack.blue.mix-mute', type 21, flags 0x3
(not selected)
---> 27 Considering volume control item: 'jack.fp-green', type 1, flags 0x4
(not selected)
---> 28 Considering volume control item: 'jack.fp-green.mode', type 3, flags 0x3
(not selected)
---> 29 Considering volume control item: 'jack.fp-green', type 20, flags 0x103
(not selected)
---> 30 Considering volume control item: 'jack.fp-green.mute', type 21, flags 0x3
(not selected)
---> 31 Considering volume control item: 'record', type 1, flags 0x4
(not selected)
---> 32 Considering volume control item: 'record.mix', type 1, flags 0x4
(not selected)
---> 33 Considering volume control item: 'record.mix.mute', type 1, flags 0x44
(not selected)
---> 34 Considering volume control item: 'record.mix.mute.c/lfe1', type 21, flags 0x3
(not selected)
---> 35 Considering volume control item: 'record.mix.mute.fp-mic1', type 21, flags 0x3
(not selected)
---> 36 Considering volume control item: 'record.mix.mute.rear1', type 21, flags 0x3
(not selected)
---> 37 Considering volume control item: 'record.mix.mute.fp-headphone1', type 21, flags 0x3
(not selected)
---> 38 Considering volume control item: 'record.mix.mute.front1', type 21, flags 0x3
(not selected)
---> 39 Considering volume control item: 'record.mix.mute.mix1', type 21, flags 0x3
(not selected)
---> 40 Considering volume control item: 'record.mix1', type 20, flags 0x103
(not selected)
---> 41 Considering volume control item: 'record.mix', type 1, flags 0x4
(not selected)
---> 42 Considering volume control item: 'record.mix.mute', type 1, flags 0x44
(not selected)
---> 43 Considering volume control item: 'record.mix.mute.c/lfe2', type 21, flags 0x3
(not selected)
---> 44 Considering volume control item: 'record.mix.mute.fp-mic2', type 21, flags 0x3
(not selected)
---> 45 Considering volume control item: 'record.mix.mute.rear2', type 21, flags 0x3
(not selected)
---> 46 Considering volume control item: 'record.mix.mute.fp-headphone2', type 21, flags 0x3
(not selected)
---> 47 Considering volume control item: 'record.mix.mute.front2', type 21, flags 0x3
(not selected)
---> 48 Considering volume control item: 'record.mix.mute.mix2', type 21, flags 0x3
(not selected)
---> 49 Considering volume control item: 'record.mix2', type 20, flags 0x103
(not selected)
---> 50 Considering volume control item: 'misc', type 1, flags 0x4
(not selected)
---> 51 Considering volume control item: 'misc.c/lfe', type 20, flags 0x103
(not selected)
---> 52 Considering volume control item: 'misc.fp-mic', type 20, flags 0x103
(not selected)
---> 53 Considering volume control item: 'misc.rear', type 20, flags 0x103
(not selected)
---> 54 Considering volume control item: 'misc.fp-headphone', type 20, flags 0x103
(not selected)
---> 55 Considering volume control item: 'misc.front', type 20, flags 0x103
(not selected)
---> 56 Considering volume control item: 'misc.mix', type 3, flags 0x3
(not selected)
---> 57 Considering volume control item: 'vmix0-enable', type 2, flags 0x3
(not selected)
---> 58 Considering volume control item: 'vmix0-rate', type 13, flags 0x800D
(not selected)
---> 59 Considering volume control item: 'vmix0-channels', type 3, flags 0x3
(not selected)
---> 60 Considering volume control item: 'vmix0-src', type 3, flags 0x8003
(not selected)
---> 61 Considering volume control item: 'vmix0-outvol', type 19, flags 0x903
===> 61 Selected volume control item: 'vmix0-outvol'
---> 62 Considering volume control item: 'vmix0-outvu', type 10, flags 0x205
(not selected)
---> 63 Considering volume control item: 'vmix0', type 1, flags 0x4
(not selected)
---> 64 Considering volume control item: 'vmix0-invol', type 19, flags 0x903
(not selected)
---> 65 Considering volume control item: 'vmix0-invu', type 10, flags 0x205
(not selected)
---> 66 Considering volume control item: 'vmix0.pcm6', type 20, flags 0x903
(not selected)
---> 67 Considering volume control item: 'vmix01', type 10, flags 0x205
(not selected)
---> 68 Considering volume control item: 'vmix0.pcm7', type 20, flags 0x903
(not selected)
---> 69 Considering volume control item: 'vmix02', type 10, flags 0x205
(not selected)
---> 70 Considering volume control item: 'vmix0.pcm8', type 20, flags 0x903
(not selected)
---> 71 Considering volume control item: 'vmix03', type 10, flags 0x205
(not selected)
---> 72 Considering volume control item: 'vmix0.pcm9', type 20, flags 0x903
(not selected)
---> 73 Considering volume control item: 'vmix04', type 10, flags 0x205
(not selected)
Root RGB colors are 12:17:1b
Raw value is 0xFA00FA (=250), or 250%
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Raw value is 0xFA00FA (=250), or 250%
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Value is now 0xFA00FA (=250 or 250%)
Sound ctrl. new value is 250
Raw value is 0xFA00FA (=250), or 250%
Sound ctrl. new value is 250
10+ Years Contributing to Linux Open Source Projects.

Offline MikeLockmoore

  • Hero Member
  • *****
  • Posts: 525
  • Good software needn't be big!
Well, I'm stumped.   ???  I tried to get the vmix mixing controls working in my TC installation, but can't.  I have a /dev/oss/oss_ich0/pcm0 device node, but not a .../pcmin0 node, which I think I need to have vmix be able to sample and retransmit system audio.  If I start up ossxmix (GUI mixer), all of the vmix VU meters are dead, and changing the volume sliders has zero affect.  I tried the vmixctl utility, but it does not seem to help. To go any further on this path, we might need some help from someone with more OSS experience and knowledge.

I also don't know how the "jack.(color).*" controls that some of you have (High Definition Audio systems?) work, so I can't have Flit automatically pick one if the OSS flags don't look right. But maybe one of those is useful for controlling the sound?  But I think the bottom line for now is: If you can get the sound to adjust in ossxmix or ossmix, it should be possible in Flit too.

In my own system, I can get Flit to control the sound with either the control parameter "vol" or "pcm", both of which show up in ossmix and ossxmix and do the expected thing (both adjust the output sound level).  

To give users some flexibility, Flit version 0.9.1 has a new config parameter: oss_control_name.  If it is not specified, or if it is specified as "autosel", Flit will check the flags for each OSS mixer control and try to pick an approrpriate one (like before).  But note that if Flit only finds a vmix* control, and your vmix is not properly attached (like mine), it still won't work.  However, you can specify the exact name of a control if you know that it will work in your setup.  I think a "mute" control could be specified too, so even if you don't have a volume "slider", Flit might still be able to togge the mute setting.  (Could someone test this?  My hardware does not expose a "mute" mixer control type.)

Full Diag version of the latest code is posted here.  The help .htm is also updated.
--
ML
 
« Last Edit: August 30, 2009, 08:35:53 PM by MikeLockmoore »

Offline roberts

  • Administrator
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Mike,

Great News!
This version 0.9.1 is working on both my desktop and netbook.
Great Job.

Now if there could just be an ALT combo to adjust sound up/down as netbooks typically don't have a wheel.
« Last Edit: August 31, 2009, 08:52:35 AM by roberts »
10+ Years Contributing to Linux Open Source Projects.