LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums HCL Reviews Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-30-2009, 05:05 PM   #1
seohonolulu
LQ Newbie
 
Registered: Nov 2009
Location: Honolulu
Distribution: Arch 64
Posts: 3

Rep: Reputation: 0
Question Conky Config - anyone try pulling info from JACK and/or ALSA?


Hey everyone,

So I'm wondering (after extensive google searches turning up nothing) if anyone has ever taken a vanilla conky install and tweaked it to pull from jackd and/or alsa? I'd like to get conky to show me whether or not jack is running, xruns, any kind of latency info as well as volume levels (input and output) for alsa. This would be with a rt kernel going as well.

Not sure where to begin on extracting the data...
 
Old 11-30-2009, 06:36 PM   #2
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-14.2.1 on Lenovo Thinkpad W520
Posts: 7,925

Rep: Reputation: 2814Reputation: 2814Reputation: 2814Reputation: 2814Reputation: 2814Reputation: 2814Reputation: 2814Reputation: 2814Reputation: 2814Reputation: 2814Reputation: 2814
Problem is : where will you find information to be processed and displayed ?

To know if jack is running you could parse output of "ps aux|grep jack" for instance and use it in a lua script.

But for alsa volume levels for instance (as shown in alsamixer) you should write lua functions using the alsa API. Seems to exist some docs about that in the kernel source, e.g. Documentation/sound/alsa/DocBook/alsa-driver-api.tmpl. To know how to get these docs in the format you want, type "make help" at root of kernel tree.

To give you a clue of how to use lua with conky, here is simple lua script I wrote to get information about brightness of the screen and keyboard illumination of my Thinkpad T61 laptop :
Code:
--Didier Spaier le vendredi 30 octobre 2009
conky_brightness=function()
	i=0
	for ligne in io.lines("/proc/acpi/video/VID1/LCD0/brightness") do
		if (i==1) then j=(string.sub(ligne,10)) end
		i=i+1
	end
	return(j)
end
conky_light=function()
	for laligne in io.lines("/proc/acpi/ibm/light") do
		l=(string.sub(laligne,10))
		if (l=="off") then return(0) else return(1) end
	end
end
Then in the first part of ~/.conkyrc I wrote this to call the script:
Code:
lua_load /home/logiciels/lua.conky
And to display output of the functions (in the TEXT section) :
Code:
${color grey}Brillance : ${color}${lua brightness}/100 ${if_match ${lua light}==0}${color grey}clavier non éclairé${color}${else}clavier éclairé$endif
In case you'd find this example useful, whole ~/.conkyrc follows
Code:
cpu_avg_samples 2
top_cpu_separate false
default_color white
default_outline_color white
default_shade_color white
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
#font 12x20
if_up_strictness address
net_avg_samples 2
double_buffer yes
out_to_console no
override_utf8_locale
own_window no
#own_window_class Conky
#own_window_transparent yes
#own_window_type desktop
pop3 mail.lixium.fr epsm-didier.spaier apzoqmslwnxb -i 1
update_interval 1
uppercase no
use_spacer left
show_graph_scale yes
show_graph_range yes
short_units yes
use_xft
xftfont DejaVu Sans Mono:size=7
default_bar_size 110 6
lua_load /home/logiciels/lua.conky
TEXT
${color grey}${font DejaVu Sans Mono:size=11}Bureau n° ${color}${desktop}${color grey} de ${color}${desktop_number}${font}

${font DejaVu Sans Mono:size=11}${time %A %e %B %Y %Hh%M }${font}
${if_gw}
${font DejaVu Sans Mono:size=11}${color lightgrey}Non lus ${color}${pop3_unseen mail.lixium.fr epsm-didier.spaier apzoqmslwnxb -i 10}${font}
${endif}
${color grey}En fonction depuis ${color}$uptime

${color grey}Brillance : ${color}${lua brightness}/100 ${if_match ${lua light}==0}${color grey}clavier non éclairé${color}${else}clavier éclairé$endif

$acpiacadapter${color grey}  Batterie ${color}${smapi_bat_power 0}W${color grey} charge${color} ${smapi_bat_perc 0}%

${color grey}Températures
  processeur ${color}${ibm_temps 0}°C${color grey}
  graphique  ${color}${nvidia temp}°C/${nvidia threshold}°C${color grey}
  batterie   ${color}${smapi_bat_temp 0}°C
${if_match $ibm_fan==0}${color grey}Ventilateur ${color}arrêté$else${color grey}Vitesse ventilateur ${color}$ibm_fan tours/minute$endif

${color grey}Nvidia
  Fréquence NV/mémoire ${color}${nvidia gpufreq}MHz/${nvidia memfreq}MHz${color grey}
  Qualité ${color}${nvidia imagequality}/3

${color grey}Cœur 1 ${color}${freq 1}MHz ${cpu cpu1}%
${color grey}Cœur 2 ${color}${freq 2}MHz ${cpu cpu2}%
${top cpu 1}% ${color lightgrey}pour ${color}${top name 1}
${top cpu 2}% ${color lightgrey}pour ${color}${top name 2}
${color grey}Occupation RAM/Swap ${color}$memperc%/$swapperc%
${top_mem mem 1}%${color lightgrey} pour ${color}${top_mem name 1}
${top_mem mem 2}% ${color lightgrey}pour ${color}${top_mem name 2}
${color grey}Processus${color}$processes  ${color grey}Actif(s)${color}$running_processes
${color grey}Partitions
  Linux   ${color}${fs_used_perc /}% ${fs_bar /}${color grey}
  Windows ${color}${fs_used_perc /windows}% ${fs_bar /windows}
${color grey}E/S sur disque${color}
${diskio_read sda}/s${color grey} en lecture${color}
${diskio_write sda}/s${color grey} en écriture${color}${if_up wlan0}${color grey}

IP wifi    ${color}${addr wlan0}${color grey}
  amont ${color}${upspeed wlan0}${color grey}
  aval  ${color}${downspeed wlan0}$endif
${if_up eth0}${color grey}IP ethernet ${color}${addr eth0}${color grey}
  amont ${color}${upspeed eth0}${color grey}
  aval  ${color}${downspeed eth0}
$endif
${color grey}Volume général ${color}${mixerbar}
${if_running audacious}${color grey}Vol. Audacious ${color}${audacious_main_volume}% ${audacious_status} plage $audacious_playlist_position $audacious_position${color grey}/${color}$audacious_length ${audacious_bar}
${audacious_title}
$endif
#${if_xmms2_connected}
#${xmms2_status} ${color grey}Plage n° ${color}$xmms2_tracknr $xmms2_elapsed${color grey}/${color}$xmms2_duration ${xmms2_bar 6,220}
#${xmms2_artist}
#${xmms2_album}
#${xmms2_title}
#$endif
${color grey}Paris-Le Bourget le ${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ LFPB last_update} TU
${color grey}Température${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ LFPB temperature}°C
${color grey}Couverture nuageuse ${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ LFPB cloud_cover}
${color grey}Pression ${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ LFPB pressure} hPa
${color grey}Vitesse du vent ${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ LFPB wind_speed} km/h
${color grey}Direction du vent ${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ LFPB wind_dir}
${color grey}Humidité ${color}${weather http://weather.noaa.gov/pub/data/observations/metar/stations/ LFPB humidity}%

Last edited by Didier Spaier; 11-30-2009 at 06:52 PM.
 
1 members found this post helpful.
Old 11-30-2009, 06:57 PM   #3
Davno
Member
 
Registered: Mar 2004
Location: Montreal, Canada
Distribution: Mandriva 2010.2
Posts: 148

Rep: Reputation: 24
I am not sure if this is part of what your looking for:

On my Debian Lenny: I use this line to know the latency.
Code:
cat /proc/sys/dev/hpet/max-user-freq
If not 1024 then:
Code:
echo 1024 > /proc/sys/dev/hpet/max-user-freq
And to set that figure permanently add this line to your /etc/rc.d/rc.local
Code:
echo 1024 > /proc/sys/dev/hpet/max-user-freq
On my Mandriva computer: I use this line to know the latency.
Code:
cat /proc/sys/dev/hpet/max-user-freq
or depending on version of Mandriva
Code:
cat /proc/sys/dev/rtc/max-user-freq

Last edited by Davno; 11-30-2009 at 07:00 PM.
 
1 members found this post helpful.
Old 11-30-2009, 07:44 PM   #4
seohonolulu
LQ Newbie
 
Registered: Nov 2009
Location: Honolulu
Distribution: Arch 64
Posts: 3

Original Poster
Rep: Reputation: 0
WOW! You guys are awesome, thank you so much for the pointers. Didier Spaier, your post was extremely useful in getting me to understand a scripting approach to conky. Davno, also, thank you for helping me get the latency data. This will be my first dive into conky, but between what both of you have provided will definitely give me a good start. Thank you both
 
  


Reply

Tags
alsa, conky, jack



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Conky-like Desktop Info Application With Html Support (gtk-desktop-info) [Ubunt LXer Syndicated Linux News 0 05-02-2009 12:50 AM
can't make a config file for conky thefallofray Linux - Software 8 12-02-2008 03:59 PM
Conky config for Slackers SqdnGuns Slackware 18 11-27-2008 12:27 AM
pulling info from files beeblequix Linux - Enterprise 2 10-05-2006 01:43 PM
alsa/jack/ardour foo_bar_foo Linux - Software 1 10-20-2004 05:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 03:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration