2010-06-20 19:18:48

by Jaroslav Fojtik

[permalink] [raw]
Subject: ATH5k - Signal measurement reports wrong values

Dears,

Look at the attached chart.

After upgrading from compat-wireless-2010-06-13 to compat-wireless-2010-06-18
the reported signal drops from -65dB to -77dB.

The ATH5k simply lies, because green line in reverse direction did not
change. The second point has bullet.

Only purple line dropped.

But from my point of view the purple line should be comparable with green
line (measured by bullet). If somebody is interested in experiment, I could
fiddle with Tx power on a bullet and chart a response.

regards
Jara


Attachments:
X_rodga-week_big.png (9.24 kB)

2010-06-21 07:21:01

by Jaroslav Fojtik

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values

Dear Bruno,

> hi jara!
>
> are you sure it has to do with the upgrade from compat-wireless-2010-06-13 to
> compat-wireless-2010-06-18? i don't see any relevant differences in the code
> between these two versions...
Sorry, it might be compat-wireless-2010-05-30.
I have tested only 3 versions.

Anyway, I have observed "false" signal drop even for client stations.

You could see that purple line als dropped from -61 to -71 without any reason:
http://78.108.103.11:11080/cgi-bin/klienti_year.cgi


> it might be interresting to see what results you get from noise calibration.
> you can enable calibration debugging with "echo calib >
> /sys/kernel/debug/ath5k/phy0/debug"
The directory /sys/kernel/debug is empty.
It looks that I have to recompile kernel. Or do you know any option to
pass to kernel to allow this feature?

regards
Jara


2010-06-30 07:13:22

by Jaroslav Fojtik

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - thanks for a fix

Dear Bruno,

> > Anyway, when you look at the magenta line here:
> > http://78.108.103.11:11080/cgi-bin/rodga_1day_big.cgi
> >
> > There are big drops in measured signal. Did you fix all places?
> >
> > Before this patch there were short peeks from -78dB to -71dB.
> > After patch there are short measurement drops from -62dB to -70dB.
> >
> > The week charting simply averages it:
> > http://78.108.103.11:11080/cgi-bin/rodga_1week_big.cgi
>
> i guess this must be the same situation as before, no?
Just repeat:
## Before this patch there were short peeks from -78dB to -71dB.

## After patch there are short measurement drops from -62dB to -70dB.

MadWiFi does not produce such drops.


> how many antennas do you have attached to your device?
One miniPCI device has only one antenna attached. Second U.FL. connector
is empty.


> it might be interesting to check if you get more consistent
> signal measurements by disabling antenna
> diversity, setting it to a fixed antenna. you can do this by using a debugfs
> file "echo fixed-a > /sys/kernel/debug/ath5k/phy0/antenna" (or "fixed-b")...
I have found that "fixed-b" is a right connector. There is a stupid question why?
When I am using "out" and not "aux". I just guess that "out" should be 'a'
and 'aux' should be 'b'.

Please again have a look at:
http://78.108.103.11:11080/cgi-bin/rodga_1day_big.cgi
It looks like signal power jumped to -46dB.
It seems that ATH5k never switched to "fixed-b" and I has been receiving
garbage from empty U.FL. It is a miracle that it has been worked.


MadWiFi is much more intelligent. It tests both inputs and selects better one.


> btw: when the signal measurement was low, did you see any negative impact on
> the thruput as well?
Nope.
http://78.108.103.11:11080/cgi-bin/pktloss_1day_big.cgi
But the line is so overpowered that I would not notify 8dB drop.

regards
Jara


> bruno



2010-06-28 01:23:40

by Bruno Randolf

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - thanks for a fix

On Sun June 27 2010 16:28:17 Jaroslav Fojtik wrote:
> Dear Bruno,
>
> > > I hope that this patch would not influence performance or any other
> > > functionality.
> >
> > no it just fixes a regression i have introduced in an earlier change.
> > thanks for reporting and testing this! i will send the patch for
> > inclusion on monday, then it might take some time (few days to weeks)
> > until it apperars in compat- wireless.
>
> Thank you for explanation.
> The patch surely improves signal strength measurement and I recomend it.
>
> Anyway, when you look at the magenta line here:
> http://78.108.103.11:11080/cgi-bin/rodga_1day_big.cgi
>
> There are big drops in measured signal. Did you fix all places?
>
> Before this patch there were short peeks from -78dB to -71dB.
> After patch there are short measurement drops from -62dB to -70dB.
>
> The week charting simply averages it:
> http://78.108.103.11:11080/cgi-bin/rodga_1week_big.cgi

i guess this must be the same situation as before, no?

how many antennas do you have attached to your device? it might be interesting
to check if you get more consistent signal measurements by disabling antenna
diversity, setting it to a fixed antenna. you can do this by using a debugfs
file "echo fixed-a > /sys/kernel/debug/ath5k/phy0/antenna" (or "fixed-b")...

btw: when the signal measurement was low, did you see any negative impact on
the thruput as well?

bruno

2010-06-26 16:16:01

by Bruno Randolf

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - "calib" did not help

On Saturday 26 June 2010 21:43:47 Jaroslav Fojtik wrote:
> I do not know which patch do you mean. If it is integrated into a current
> tarball, I could simply download it and try it.
> http://www.orbit-lab.org/kernel/compat-wireless-2.6/compat-wireless-2010-06
> -25.tar.bz2
>
> If it is not, please Email me such patch.

i dont have it here right now, but i sent it in a previous reply to you:

http://marc.info/?l=linux-wireless&m=127717933410893&w=2

it's just one line, so you can also change the same line in your compat-
wireless source code.

> I am currently using compat-wireless-2010-06-22 and it is still affected by
> wrong signal measurement.

yes, my patch is not part of compat-wireless yet. if you confirm that it fixes
your problem i will send it for inclusion.

bruno

2010-06-27 02:20:21

by Bruno Randolf

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - thanks for a fix

On Sunday 27 June 2010 02:54:17 you wrote:
> It looks, that your patch really returns back proper signal values.
>
> I will not poison Email with png files, feel free to look at here:
> http://78.108.103.11:11080/cgi-bin/rodga_1day_big.cgi
> Magenta line returned back to green line from other direction.
>
>
> Even in an AP mode the magenta line also jumped to expected value:
> http://78.108.103.11:11080/tmp/klienti-day-big.png
>
> I hope that this patch would not influence performance or any other
> functionality.

no it just fixes a regression i have introduced in an earlier change. thanks
for reporting and testing this! i will send the patch for inclusion on monday,
then it might take some time (few days to weeks) until it apperars in compat-
wireless.

bruno

2010-06-26 17:51:57

by Jaroslav Fojtik

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - thanks for a fix

Dear Bruno,

> > If it is not, please Email me such patch.
>
> i dont have it here right now, but i sent it in a previous reply to you:
>
> http://marc.info/?l=linux-wireless&m=127717933410893&w=2
>
> it's just one line, so you can also change the same line in your compat-
> wireless source code.
Yes, I have patched it now.


> > I am currently using compat-wireless-2010-06-22 and it is still affected by
> > wrong signal measurement.
>
> yes, my patch is not part of compat-wireless yet. if you confirm that it fixes
> your problem i will send it for inclusion.
It looks, that your patch really returns back proper signal values.

I will not poison Email with png files, feel free to look at here:
http://78.108.103.11:11080/cgi-bin/rodga_1day_big.cgi
Magenta line returned back to green line from other direction.


Even in an AP mode the magenta line also jumped to expected value:
http://78.108.103.11:11080/tmp/klienti-day-big.png

I hope that this patch would not influence performance or any other
functionality.

regards
Jara


>
> bruno



2010-06-23 09:01:10

by Jaroslav Fojtik

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - "calib" did not help

Dear Bruno & ATH5k developpers,

> > > it might be interresting to see what results you get from noise
> > > calibration. you can enable calibration debugging with "echo calib >
> > > /sys/kernel/debug/ath5k/phy0/debug"
Nothing changed after setting "calib" on.

ATH5k still reports bad values.

You could see a magenta line here:
http://78.108.103.11:11080/cgi-bin/rodga.cgi

regards
Jara

2010-06-22 04:02:12

by Bruno Randolf

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values

On Tue June 22 2010 04:28:02 Jaroslav Fojtik wrote:
> root@dvouramenna:~# dmesg |grep "ath5.*chip"
> [ 6.632843] ath5k phy0: Atheros AR2413 chip found (MAC: 0x78, PHY: 0x45)
> [ 7.101528] ath5k phy1: Atheros AR5213A chip found (MAC: 0x59, PHY:
> 0x43)
>
> Both chipsets suffer with a same problem.

hi jara!

thanks, i was able to reproduce the problem here. can you try this patch, it
should fix it. it's just one line, so you could also change that 1 to a 4 in
the code directly. please let me know if it helps...

bruno

commit 36c597b80813988f6a9c47ca4a5cb5306bbc67fa
Author: Bruno Randolf <[email protected]>
Date: Tue Jun 22 12:37:34 2010 +0900

ath5k: fix antenna div gc for <= AR5K_SREV_PHY_2413

Commit 39d5b2c83ca8904b6826a0713263a4e5a9c0730a "ath5k: update
AR5K_PHY_RESTART_DIV_GC values to match masks" introduced a regression on
PHY
chips older than AR5K_SREV_PHY_5413, which caused signal values to be
about
10dB less that before. This patch reverts the AR5K_PHY_RESTART_DIV_GC
values to
the same values which were effectively used before (without the bitmask
mistake). This brings signal levels back to normal on these PHY chips.

Signed-off-by: Bruno Randolf <[email protected]>

diff --git a/drivers/net/wireless/ath/ath5k/phy.c
b/drivers/net/wireless/ath/ath5k/phy.c
index 82720fc..2254cd1 100644
--- a/drivers/net/wireless/ath/ath5k/phy.c
+++ b/drivers/net/wireless/ath/ath5k/phy.c
@@ -1768,7 +1768,7 @@ ath5k_hw_set_fast_div(struct ath5k_hw *ah, u8 ee_mode,
bool enable)

if (enable) {
AR5K_REG_WRITE_BITS(ah, AR5K_PHY_RESTART,
- AR5K_PHY_RESTART_DIV_GC, 1);
+ AR5K_PHY_RESTART_DIV_GC, 4);

AR5K_REG_ENABLE_BITS(ah, AR5K_PHY_FAST_ANT_DIV,
AR5K_PHY_FAST_ANT_DIV_EN);

2010-06-21 07:51:50

by Bruno Randolf

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values

On Mon June 21 2010 16:23:06 Jaroslav Fojtik wrote:
> Dear Bruno,
>
> > hi jara!
> >
> > are you sure it has to do with the upgrade from
> > compat-wireless-2010-06-13 to compat-wireless-2010-06-18? i don't see
> > any relevant differences in the code between these two versions...
>
> Sorry, it might be compat-wireless-2010-05-30.

that would make more sense. there are changes in noise floor calibration and
in antenna diversity setup between these two (2010-05-30 and 2010-06-18).
either one may be the reason...

> I have tested only 3 versions.
>
> Anyway, I have observed "false" signal drop even for client stations.
>
> You could see that purple line als dropped from -61 to -71 without any
> reason: http://78.108.103.11:11080/cgi-bin/klienti_year.cgi
>
> > it might be interresting to see what results you get from noise
> > calibration. you can enable calibration debugging with "echo calib >
> > /sys/kernel/debug/ath5k/phy0/debug"
>
> The directory /sys/kernel/debug is empty.
> It looks that I have to recompile kernel. Or do you know any option to
> pass to kernel to allow this feature?

maybe you need to:
mount -t debugfs debugfs /sys/kernel/debug
?

also you need to compile ath5k with debugging enabled.

can you tell us which chipset you are using (output of dmesg |grep
"ath5.*chip")?

also it would be interesting to know how you generate your graphs?

bruno



2010-06-21 19:25:58

by Jaroslav Fojtik

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values

Dear Bruno,

> that would make more sense. there are changes in noise floor calibration and
> in antenna diversity setup between these two (2010-05-30 and 2010-06-18).
> either one may be the reason...
good


> > The directory /sys/kernel/debug is empty.
> > It looks that I have to recompile kernel. Or do you know any option to
> > pass to kernel to allow this feature?
>
> maybe you need to:
> mount -t debugfs debugfs /sys/kernel/debug
> ?
>
> also you need to compile ath5k with debugging enabled.
I will do this.


> can you tell us which chipset you are using (output of dmesg |grep
> "ath5.*chip")?

root@dvouramenna:~# dmesg |grep "ath5.*chip"
[ 6.632843] ath5k phy0: Atheros AR2413 chip found (MAC: 0x78, PHY: 0x45)
[ 7.101528] ath5k phy1: Atheros AR5213A chip found (MAC: 0x59, PHY: 0x43)

Both chipsets suffer with a same problem.


> also it would be interesting to know how you generate your graphs?

RODGASIGNAL=`iwconfig wlan0 | grep "Signal level" | sed -e 's/.*Signal level=\([0123456789-]*\)[ \/].*/\1/'`
if [[ $RODGASIGNAL == "" ]]; then
RODGASIGNAL="U"
else
if [[ $RODGASIGNAL > "0" ]]; then
RODGASIGNAL=-95
fi
fi

/usr/sbin/rrdupdate /var/rrd/rodgarssi.rrd N:$RODGASIGNAL


When rrd is feed, the chart could be rendered:

LABEL=`/usr/bin/date "+Rodga signal strength %d.%m.%Y"`
/usr/sbin/rrdtool graph /tmp/www/rodga-day.png --start -86400 \
-t "$LABEL" --vertical-label "Signal Strength [dBi]" -w 650 -h 95 \
DEF:rodga=/var/rrd/rodgarssi.rrd:rssi:AVERAGE \
DEF:bullet=/var/rrd/bulletrssi.rrd:rssi:AVERAGE \
LINE1:rodga#FF00FF:"rodga->dvrmn" \
LINE1:bullet#00FF00:"dvrmn->rodga" >/dev/null

regards
Jara


PS: I have replaced MAC address by 0:

/usr/sbin/iw wlan1 station dump | sed -n -e '/Station/p' -e '/signal/p' >/tmp/sta.txt

MARTIN=`grep "00:00:00:00:00:00" -A 1 -i /tmp/sta.txt | grep "signal" | sed -e 's/.*\(-[0123456789]*\) .*/\1/'`
if [[ $MARTIN == "" ]]
then
MARTIN="U"
fi
RACEK=`grep "00:00:00:00:00:00" -A 1 -i /tmp/sta.txt | grep "signal" | sed -e 's/.*\(-[0123456789]*\) .*/\1/'`
if [[ $RACEK == "" ]]
then
RACEK="U"
fi
/usr/sbin/rrdupdate /var/rrd/klienti.rrd N:$MARTIN:$RACEK




2010-06-25 00:49:11

by Bruno Randolf

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - "calib" did not help

On Wed June 23 2010 18:03:19 Jaroslav Fojtik wrote:
> Dear Bruno & ATH5k developpers,
>
> > > > it might be interresting to see what results you get from noise
> > > > calibration. you can enable calibration debugging with "echo calib >
> > > > /sys/kernel/debug/ath5k/phy0/debug"
>
> Nothing changed after setting "calib" on.
>
> ATH5k still reports bad values.
>
> You could see a magenta line here:
> http://78.108.103.11:11080/cgi-bin/rodga.cgi
>
> regards
> Jara

hey jara!

setting "calib" is not supposed to change the results, it would just show us
debug messages in the kernel log (dmesg). have you tried the patch i sent
later? that should fix it...

bruno

2010-06-21 01:27:51

by Bruno Randolf

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values

On Mon June 21 2010 04:20:51 Jaroslav Fojtik wrote:
> Dears,
>
> Look at the attached chart.
>
> After upgrading from compat-wireless-2010-06-13 to
> compat-wireless-2010-06-18 the reported signal drops from -65dB to -77dB.
>
> The ATH5k simply lies, because green line in reverse direction did not
> change. The second point has bullet.
>
> Only purple line dropped.
>
> But from my point of view the purple line should be comparable with green
> line (measured by bullet). If somebody is interested in experiment, I could
> fiddle with Tx power on a bullet and chart a response.

hi jara!

are you sure it has to do with the upgrade from compat-wireless-2010-06-13 to
compat-wireless-2010-06-18? i don't see any relevant differences in the code
between these two versions...

it might be interresting to see what results you get from noise calibration.
you can enable calibration debugging with "echo calib >
/sys/kernel/debug/ath5k/phy0/debug"

bruno

2010-06-26 12:41:29

by Jaroslav Fojtik

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - "calib" did not help

Dear Bruno Randolf,

> > Nothing changed after setting "calib" on.

> hey jara!
>
> setting "calib" is not supposed to change the results, it would just show us
> debug messages in the kernel log (dmesg). have you tried the patch i sent
> later? that should fix it...
Thanks for your info. According to logs it looked like noise floor is -94dB
and it is negligible.

I do not know which patch do you mean. If it is integrated into a current
tarball, I could simply download it and try it.
http://www.orbit-lab.org/kernel/compat-wireless-2.6/compat-wireless-2010-06-25.tar.bz2

If it is not, please Email me such patch.

I am currently using compat-wireless-2010-06-22 and it is still affected by
wrong signal measurement.

regards
Jara




>
> bruno
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



2010-06-30 07:27:21

by Bruno Randolf

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - thanks for a fix

On Wed June 30 2010 16:15:49 Jaroslav Fojtik wrote:
> > > Before this patch there were short peeks from -78dB to -71dB.
> > > After patch there are short measurement drops from -62dB to -70dB.
> > >
> > > The week charting simply averages it:
> > > http://78.108.103.11:11080/cgi-bin/rodga_1week_big.cgi
> >
> > i guess this must be the same situation as before, no?
>
> Just repeat:
> ## Before this patch there were short peeks from -78dB to -71dB.
>
> ## After patch there are short measurement drops from -62dB to -70dB.

i meant: did you see the same kind of drops with the older compat-wireless
versions, before you reported the problem?

> > how many antennas do you have attached to your device?
>
> One miniPCI device has only one antenna attached. Second U.FL. connector
> is empty.
>
> > it might be interesting to check if you get more consistent
> > signal measurements by disabling antenna
> > diversity, setting it to a fixed antenna. you can do this by using a
> > debugfs file "echo fixed-a > /sys/kernel/debug/ath5k/phy0/antenna" (or
> > "fixed-b")...
>
> I have found that "fixed-b" is a right connector. There is a stupid
> question why? When I am using "out" and not "aux". I just guess that "out"
> should be 'a' and 'aux' should be 'b'.

yes, i have noticed the same thing on some cards. maybe a wrong setting in
eeprom, or some bug in ath5k.

> Please again have a look at:
> http://78.108.103.11:11080/cgi-bin/rodga_1day_big.cgi
>
> It looks like signal power jumped to -46dB.
> It seems that ATH5k never switched to "fixed-b" and I has been receiving
> garbage from empty U.FL. It is a miracle that it has been worked.

i have also had problems with diversity in ath5k when there is only one
antenna attached and in this case i always need to set a fixed antenna for
optimal performance.

> MadWiFi is much more intelligent. It tests both inputs and selects better
> one.

glad to hear it works for you; i had many inconsistencies with antenna
diversity on madwifi as well..

bruno

PS: CC'ing nick, maybe he has some idea?

2010-06-27 07:26:00

by Jaroslav Fojtik

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement reports wrong values - thanks for a fix

Dear Bruno,

> > I hope that this patch would not influence performance or any other
> > functionality.
> no it just fixes a regression i have introduced in an earlier change. thanks
> for reporting and testing this! i will send the patch for inclusion on monday,
> then it might take some time (few days to weeks) until it apperars in compat-
> wireless.

Thank you for explanation.
The patch surely improves signal strength measurement and I recomend it.

Anyway, when you look at the magenta line here:
http://78.108.103.11:11080/cgi-bin/rodga_1day_big.cgi

There are big drops in measured signal. Did you fix all places?

Before this patch there were short peeks from -78dB to -71dB.
After patch there are short measurement drops from -62dB to -70dB.

The week charting simply averages it:
http://78.108.103.11:11080/cgi-bin/rodga_1week_big.cgi

regards
Jara



>
> bruno
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html



2010-07-01 20:08:55

by Jaroslav Fojtik

[permalink] [raw]
Subject: Re: ATH5k - Signal measurement drops

Dear Randolf,

> > I have found that "fixed-b" is a right connector. There is a stupid
> > question why? When I am using "out" and not "aux". I just guess that "out"
> > should be 'a' and 'aux' should be 'b'.

> yes, i have noticed the same thing on some cards. maybe a wrong setting in
> eeprom, or some bug in ath5k.

I hope this to be a defect of ATH5k. ATH5k cannot find proper connector automatically.
But without using debugfs, connectors cannot be switched. So I hope that it cripples
signal for many users that do not know about this peculiarity.


> > Please again have a look at:
> > http://78.108.103.11:11080/cgi-bin/rodga_1day_big.cgi

> i have also had problems with diversity in ath5k when there is only one
> antenna attached and in this case i always need to set a fixed antenna for
> optimal performance.
I have no longer observe any drops in signal. Signal is pretty flat now.



> > > i guess this must be the same situation as before, no?
> i meant: did you see the same kind of drops with the older compat-wireless
> versions, before you reported the problem?
I has been used MadWiFi before. I have moved to ATH5k because madwifi caused kernel
to crash for more than two atheros devices and it has other strange functionality
and it is no longer supported. Last MadWiFi versions are no longer functional at all.
For example a new MadWiFi-ng cannot recognise 2nd device.


> > MadWiFi is much more intelligent. It tests both inputs and selects better
> > one.
> glad to hear it works for you; i had many inconsistencies with antenna
> diversity on madwifi as well..
For me, madwifi did 15 switches, selected better connector, ant then it
no longer changed connector.
But after one month of uninterrupted run, MadWiFi suddenly switched back
and signal has been dropped for unknown reason :(.


> PS: CC'ing nick, maybe he has some idea?
OK.

regards
Jara