<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<font face="Helvetica, Arial, sans-serif">Hi Guys,<br>
<br>
In chan_dahdi.conf one is able to set txgain and rxgain. These
gains set the sw gain from what I understand of the code.<br>
<br>
In the CLI one is able to set either hwgain or swgain using "dahdi
set hwgain" or "dahdi set swgain". Until around 12 hours back I
thought the rx|txgain settings in chan_dahdi.conf set the hwgain
values, and I would typically just make a call from my clients'
analog line, then make that end up in a milliwat application and
use set hwgain rx until things was at the right level, tx I would
typically leave alone (I know it's possible to do the loopback
call thing and I've done this in the past but it's non-trivial to
get exactly right).<br>
<br>
The import thing to note is that I used "dahdi set hwgain", not
swgain. So yesterday I noticed that when setting the gains the
output of 'dahdi show channel' didn't change (I've reported a bug
on this at <a class="moz-txt-link-freetext" href="https://issues.asterisk.org/jira/browse/ASTERISK-22429">https://issues.asterisk.org/jira/browse/ASTERISK-22429</a>,
and supplied a preliminary patch). The patch just updates the
rx|txgain values in the dahdi_pvt struct, as well as add
hw[tx|rx]gain values which is used to track changes, but
initialization remains a problem. It also updates the dahdi show
channel output to show both HW and SW Gains, as well as to make it
clearer which set of values is which.<br>
<br>
The problem I'm experiencing is that because rxgain and txgain
sets the swgains, and the hwgains remains whatever is currently
set in the kernel, if you set the hwgains and then reload/restart
dahdi, expecting your old (or new) config values from the
configuration to take effect it is skewed by whatever is set at hw
level. In my case I had the gains set to 0.0 in the config
initially, then opened them up slowly using "dahdi set hwgain"
until the levels were acceptable. I then set rx|txgain in
chan_dahdi.conf, and then restarted asterisk as a whole to check
that everything was good. Unfortunately things sounded horrible.
Things went sane again after reloading the dahdi modules at kernel
level. And this is what launched the investigation.<br>
<br>
My suggestion is to explicitly reset the hwgain values on
restart/reload, as well as add two config options "hwtxgain" and
"hwrxgain" (possibly rename the existing options to swtxgain and
swrxgain, keeping the originals as alias), but I'm not 100% sure
where this should happen.<br>
</font>
<div class="moz-signature">-- <br>
Kind Regards,<br>
Jaco Kroon<br>
<img src="cid:part1.06020307.00000108@uls.co.za" usemap="#Map"
style="color:white" height="100" width="530" border="0">
<map name="Map" id="Map">
<area shape="rect" coords="441,19,460,36"
href="https://www.facebook.com/ultimatelinuxsolutions">
<area shape="rect" coords="441,39,458,57"
href="http://news.uls.co.za/">
<area shape="rect" coords="354,62,461,73"
href="http://www.uls.co.za/">
</map>
</div>
</body>
</html>