You are not logged in.

#1 2011-06-02 13:37:50

mezkov
Member
Registered: 2010-01-09
Posts: 13

sound info in conky problem

I've just switched HDD in my laptop, install fresh OS, copied some configs from old HDD (including conkyrc). Everything seems to work fine except sound in conky:
it doesn't show info about sound - it writes error

Conky: can't open /dev/mixer: No such file or directory

File /dev/mixer is not really aviable, but it wasn't aviable in old system either...

somewhere I found that modprobing snd_pcm_oss should help, but it only changes error message into:

Conky: mixer ioctl: Input/output error

I have fresh system, so there can be something I forgot to do...

PS: I am using conky_lua from AUR...

Last edited by mezkov (2011-06-02 13:38:16)

Offline

#2 2011-06-05 13:28:48

mezkov
Member
Registered: 2010-01-09
Posts: 13

Re: sound info in conky problem

OK I solved the problem: Device names for ${mixer} are not "Master", "Mic", ... There were some recent changes, that changed these names, but noone updated conky_objects documentation. Default device is "vol" and there are some others (for me worked "mic", "igain" and "speaker").

Offline

#3 2011-06-05 18:28:30

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: sound info in conky problem

how did you look up the new device names?

I used amixer, and they still show up as Master, PCM etc... but if I use that, all I get is 0% in conky, but my sound works as expected. Changing the level of Master or PCM in alsamixer correctly increases or decrease volume as well. Only conky keeps showing it as 0%.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#4 2011-06-06 05:15:13

rockin turtle
Member
From: Montana, USA
Registered: 2009-10-22
Posts: 227

Re: sound info in conky problem

I have the same problem as Inxsible; amixer shows the mixer control as 'Master' and ${mixer 'vol'} didn't work as mezkov suggested.  What I did was use the following bash script:

#!/bin/bash

vol=$(amixer get 'Master',0 | egrep -o '[0-9]{1,3}%')
echo "${vol%[%]}"

I named the script ~/.amixer, and then added the following line to my .conkyrc

Volume:   ${execbar ~/.amixer}

If you want the volume as a number instead of a bar, do:

${exec ~/.amixer}

and it will show up as a number in the range 0-100.

If you are interested in the PCM settings, which have both a left and a right value, you could use the following script.

#!/bin/bash

pcm=$(amixer get 'PCM',0 | grep "$1:" | egrep -o '[0-9]{1,3}%')
echo ${pcm%[%]}

Then in your .conkyrc:

${exec ~/.amixer-pcm 'Left'}
${exec ~/.amixer-pcm 'Right'}

Edit: Actually, after I thought about this you could use one script for all this.

#!/bin/bash

param=$(amixer get "$1",0 | grep "$2:" | egrep -o '[0-9]{1,3}%')
echo ${param%[%]}

Then in your .conkyrc:

${exec ~/.amixer 'Master' 'Mono'}
${exec ~/.amixer 'PCM' 'Left'}
${exec ~/.amixer 'PCM' 'Right'}

Last edited by rockin turtle (2011-06-06 05:23:17)

Offline

#5 2011-06-06 14:27:25

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: sound info in conky problem

Thanks rockin turtle. I'll try this out tonight.


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#6 2011-06-08 16:35:56

RobbeR49
Member
From: Columbus, OH
Registered: 2006-01-17
Posts: 178

Re: sound info in conky problem

conky started reporting 0% for me recently also, but rockin turtle's fix does work.

I've had problems with that stupid $mixer variable in the past too, dunno why something that simple should screw up so much.

Offline

#7 2011-06-14 14:39:40

Pank
Member
From: IT
Registered: 2009-06-13
Posts: 371

Re: sound info in conky problem

I am having the same problem... Any explanations yet? It's annoying to rely on external scripts!

Going a bit off-topic: does conky feature a built-in calculator? I.e. print sum of var1 and var2.


Arch x64 on Thinkpad X200s/W530

Offline

#8 2011-06-14 14:41:00

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: sound info in conky problem

You can use bc to do your math. I tried it out and this works:

${exec echo "5+5" | bc}

Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

#9 2011-06-14 15:24:33

JokerBoy
Member
From: România
Registered: 2009-09-24
Posts: 641

Re: sound info in conky problem

mezkov wrote:

OK I solved the problem: Device names for ${mixer} are not "Master", "Mic", ... There were some recent changes, that changed these names, but noone updated conky_objects documentation. Default device is "vol" and there are some others (for me worked "mic", "igain" and "speaker").

this, and modprobe snd-pcm-oss should work.

Offline

#10 2011-07-13 14:53:11

patroclo7
Member
From: Bassano del Grappa, ITALY
Registered: 2006-01-11
Posts: 915

Re: sound info in conky problem

mezkow+jokerboy solution works for me.


Mortuus in anima, curam gero cutis

Offline

#11 2011-07-20 23:41:20

Inxsible
Forum Fellow
From: Chicago
Registered: 2008-06-09
Posts: 9,183

Re: sound info in conky problem

thanks jokerboy, worked for me as well. just need to add the module in my array now. smile


Forum Rules

There's no such thing as a stupid question, but there sure are a lot of inquisitive idiots !

Offline

Board footer

Powered by FluxBB