[asterisk-bugs] [JIRA] (ASTERISK-22429) [patch] - chan_dahdi allows for updating both hw and sw gains, but dahdi show channel doesn't reflect changes

Jaco Kroon (JIRA) noreply at issues.asterisk.org
Thu Oct 10 02:39:03 CDT 2013


    [ https://issues.asterisk.org/jira/browse/ASTERISK-22429?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=210860#comment-210860 ] 

Jaco Kroon commented on ASTERISK-22429:
---------------------------------------

Personally I don't agree with the patch but I can see the merit.

You mention that currently there is no way to query the hwgain (or the ability to even set it)?

If this is in fact the case - isn't it better to rip out the hwgain stuff completely rather than to just try and document the problem away?  Or alternatively, to finish it (which shouldn't be hard - other than querying the initial hwgain values in the case where no hwgain is set) properly?

Is there *any* advantage (even theoretically) to use hwgain over swgain (eg, clarity of signal, improved sampling etc ...), because if so, then I really think we should try and fix the feature rather than document it away.  If there truly is no advantage then let's rather remove the code completely.  I'd be willing to attempt patches on the 11.X branch if you're interesting in fixing - but I'll need some help on querying the values from the driver if that's even possible.  There are a few possible workarounds (read: sub-optimal solutions) here:

1.  If no value is set in the config - read the values from /sys/ somewhere (probably not portable) of what the module was loaded with and force-set it to those values so that we know for sure.
2.  If we can't determine module load values - force set it to 0.0dB
3.  Keep an internal "unknown" flag and just in the CLI output say that we don't know what the hwgain is set to.

We need some way of determining whether hwgain is even supported by the card, and I suspect trying to set it is the only way to do that, so ideally option 1 or 2 would be better.  If we can query it, surely if we can't set it then trying to query should also return some appropriate errno that we can use to determine "hwgain not supported" on the channel (and set an appropriate flag on the channel structure).
                
> [patch] - chan_dahdi allows for updating both hw and sw gains, but dahdi show channel doesn't reflect changes
> -------------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-22429
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22429
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_dahdi
>    Affects Versions: 11.5.0
>            Reporter: Jaco Kroon
>            Assignee: Richard Mudgett
>            Severity: Minor
>         Attachments: asterisk-11.5.0-dahdi_gain_display.diff, jira_asterisk_22429_v11.patch, jira_asterisk_22429_v1.8.patch
>
>
> I think some output explains it best:
> # asterisk -Rx "dahdi show channel 3" | grep Gains
> Gains (RX/TX): 8.00/6.00
> # asterisk -rx "dahdi set swgain rx 3 4.0"
> software rx gain set to 4.0 on channel 3
> # asterisk -Rx "dahdi show channel 3" | grep Gains
> Gains (RX/TX): 8.00/6.00
> So in spite of the gain having being modified the change is not reflected.  There is also no indication whether the displayed gains is the hw or sw gains.
> I've written a small patch to rectify the situation and improve it somewhat:
> # asterisk -Rx "dahdi show channel 3" | grep Gains
> SW Gains (RX/TX): 8.00/6.00
> HW Gains (RX/TX): 0.00/0.00
> # asterisk -rx "dahdi set swgain rx 3 4.0"
> software rx gain set to 4.0 on channel 3
> # asterisk -Rx "dahdi show channel 3" | grep Gains
> SW Gains (RX/TX): 4.00/6.00
> HW Gains (RX/TX): 0.00/0.00
> There is a secondary (and actually more significant) problem here:
> The hw gains are not initialized during startup/reload at all (at least, not as far as I can tell).  And if they're already set during reload/restart the only way that I can see to get them back to some pre-configured value is to explicitly reset them using "dahdi set hwgain".  This patch assumes that they are zeroed during startup/reload (which can be false).

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list