2023-06-27 15:36:17

by Giulio Paci

[permalink] [raw]
Subject: Realtek 8822ce connection is very unstable

Hi everybody!

I am trying to install Debian Bookworm on a HP 250 g9, which includes
a RTL8822CE wireless network adapter. Unfortunately I am experiencing
very unstable connection.

I started with a default installation (with Gnome and NetworkManager)
and the connection dropped quite often, just after a few minutes.
Usually when the connection dropped dmesg reported some AER errors. I
reported the issue at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1037145.

Then I attempted in several way to improve the situation (so far
without much luck):
- I added pcie_aspm=off to the Linux command line. The AER errors
disappeared, but the connection is still unstable;
- I tried to force bssid in NetworkManager, but I did not notice any
visible change in stability;
- I upgraded BIOS and all software for this laptop as provided by HP;
- I tried to upgrade Linux and related firmware from Debian unstable.
Initially I updated to Linux package 6.3.7-1 and firmware 20230404-1,
and the stability degraded a lot (i.e., the connection hangs after
just a few seconds). Then I upgraded firmware to 20230505-1 and now
the system is quite stable at the beginning (i.e., the connection is
stable for a few minutes) and then it becomes very unstable after the
first issue (i.e., the connection hangs after just a few seconds). I
noticed some correlation between system suspend and the first issue,
but sometimes the connection just hangs, even if the system does not
attempt to suspend. Executing "rmmod rtw88_8822ce rtw88_8822c
rtw88_pci rtw88_core" and then "modprobe rtw88_8822ce" does not seem
to solve the issue, instead the connection is very unstable after
that;
- I tried to set disable_aspm=1 and disable_msi=1 for rtw88_pci. I
tried both options individually and together. Some additional errors
appear in dmesg, such as `rtw_8822ce 0000:03:00.0: failed to do dpk
calibration` when I use disable_aspm=1 and `rtw_8822ce 0000:03:00.0:
firmware failed to report density after scan` + `rtw_8822ce
0000:03:00.0: failed to get tx report from firmware` when
disable_msi=1. When setting both options together the situation seems
worse. When set individually it seems very similar to not setting any
option;
- I tried using drivers from https://github.com/lwfinger/rtw88/, but
I was not able to load the driver, since it failed to load the
firmware (I have reported the issue at
ihttps://github.com/lwfinger/rtw88/ssues/150).

What can I do to better identify the issue and possibly solve it?

Best regards,
Giulio


2023-06-27 16:19:28

by James

[permalink] [raw]
Subject: Re: Realtek 8822ce connection is very unstable

I would try a different distro.

2023-06-27 16:24:30

by Giulio Paci

[permalink] [raw]
Subject: Re: Realtek 8822ce connection is very unstable

On Tue, Jun 27, 2023 at 6:04 PM James <[email protected]> wrote:
> I would try a different distro.

Any detail about why you would try a different distro and how much
should they differ?

Actually when I tried Debian Bullseye wifi seemed more stable
(although I did not use that system long enough to be sure that it was
working without issues), but touchpad was not supported by that
system.

Do you have any specific suggestion?

2023-06-27 18:25:37

by James

[permalink] [raw]
Subject: Re: Realtek 8822ce connection is very unstable


Jun. 27, 2023 12:13:48 Giulio Paci <[email protected]>:

> On Tue, Jun 27, 2023 at 6:04 PM James <[email protected]> wrote:
>> I would try a different distro.
>
> Any detail about why you would try a different distro and how much
> should they differ?
>
> Actually when I tried Debian Bullseye wifi seemed more stable
> (although I did not use that system long enough to be sure that it was
> working without issues), but touchpad was not supported by that
> system.
>
> Do you have any specific suggestion?
Just something to try.
I have no ideas.

2023-06-28 01:40:57

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Realtek 8822ce connection is very unstable



> -----Original Message-----
> From: James <[email protected]>
> Sent: Wednesday, June 28, 2023 2:23 AM
> To: Giulio Paci <[email protected]>
> Cc: [email protected]
> Subject: Re: Realtek 8822ce connection is very unstable
>
> Jun. 27, 2023 12:13:48 Giulio Paci <[email protected]>:
>
> > On Tue, Jun 27, 2023 at 6:04 PM James <[email protected]> wrote:
> >> I would try a different distro.
> >
> > Any detail about why you would try a different distro and how much
> > should they differ?
> >
> > Actually when I tried Debian Bullseye wifi seemed more stable
> > (although I did not use that system long enough to be sure that it was
> > working without issues), but touchpad was not supported by that
> > system.
> >
> > Do you have any specific suggestion?
> Just something to try.
> I have no ideas.
>

Try below options to see if they can help:

1. try another band (switch from 2GHz to 5GHz or opposite)
2. try another AP
3. disable WiFi power save by
rtw88_core.ko disable_lps_deep=1
or
iw wlan0 set power_save off


By the way, when you try disable_aspm=1 and disable_msi=1, I suggest to
create a file and add them to /etc/modprobe.d/, and then shutdown and turn on
your computer after a while. Because some PCI settings are persistent if only
do rmmod/insmod.



2023-06-28 10:55:21

by Giulio Paci

[permalink] [raw]
Subject: Re: Realtek 8822ce connection is very unstable

Il mer 28 giu 2023, 03:29 Ping-Ke Shih <[email protected]> ha scritto:
> Try below options to see if they can help:
>
> 1. try another band (switch from 2GHz to 5GHz or opposite)

I tried to force 5GHz. And then to force 2GHz. When connected to 5GHz
it seems a little bit more stable, but still hangs within seconds.

> 2. try another AP

I have tried 2 different AP, but the situation is very similar with
both. One of them supports only b/g/n, so I was able to change band
only with the other one (which is a hotspot on Android phone).

> 3. disable WiFi power save by
> rtw88_core.ko disable_lps_deep=1
> or
> iw wlan0 set power_save off

I tried setting disable_lps_deep=1, but still the connection seems unstable.

> By the way, when you try disable_aspm=1 and disable_msi=1, I suggest to
> create a file and add them to /etc/modprobe.d/, and then shutdown and turn on
> your computer after a while. Because some PCI settings are persistent if only
> do rmmod/insmod.

I confirm this is the approach I used in all my attempts, including
disable_lps_deep=1.
I also checked /sys/module/$module/parameters/$option content, to
confirm that the options were correctly set.

I have also carried out some additional attempts:

- boot with iommu.passthrough=1 instead of pcie_aspm=off, but it does
not seem to improve anything (and AER errors came back in the dmesg);
- After my comments on https://github.com/lwfinger/rtw88/issues/150,
https://github.com/lwfinger/rtw88/ was updated and I was able to load
these modules. The connection is still very unstable, but with these
modules, when the connection hangs, dmesg reports:

rtw_8822ce 0000:03:00.0: firmware failed to leave lps state

sometimes followed by:

rtw_8822ce 0000:03:00.0: failed to send h2c command

I have tried to set some of the options above using modules from
https://github.com/lwfinger/rtw88/, but so far, apart from these
additional messages, the results are almost identical to the
precompiled modules that come with Debian.


One of my colleagues has the same hardware (same AP model and same
laptop model) and also tried to install Debian bookworm on it. I asked
to check if he experiences the same issue, but in his case he was able
to stay connected for a few hours without any issue.
I wonder if the issue I am experiencing could be due to defective
hardware (initially I excluded it since the same configuration is very
stable under Windows). Is there any specific test that I can try to
exclude hardware issues?

Bests,
Giulio

2023-06-28 13:35:57

by Bitterblue Smith

[permalink] [raw]
Subject: Re: Realtek 8822ce connection is very unstable

On 28/06/2023 13:35, Giulio Paci wrote:
> Il mer 28 giu 2023, 03:29 Ping-Ke Shih <[email protected]> ha scritto:
>> Try below options to see if they can help:
>>
>> 1. try another band (switch from 2GHz to 5GHz or opposite)
>
> I tried to force 5GHz. And then to force 2GHz. When connected to 5GHz
> it seems a little bit more stable, but still hangs within seconds.
>
>> 2. try another AP
>
> I have tried 2 different AP, but the situation is very similar with
> both. One of them supports only b/g/n, so I was able to change band
> only with the other one (which is a hotspot on Android phone).
>
>> 3. disable WiFi power save by
>> rtw88_core.ko disable_lps_deep=1
>> or
>> iw wlan0 set power_save off
>
> I tried setting disable_lps_deep=1, but still the connection seems unstable.
>
>> By the way, when you try disable_aspm=1 and disable_msi=1, I suggest to
>> create a file and add them to /etc/modprobe.d/, and then shutdown and turn on
>> your computer after a while. Because some PCI settings are persistent if only
>> do rmmod/insmod.
>
> I confirm this is the approach I used in all my attempts, including
> disable_lps_deep=1.
> I also checked /sys/module/$module/parameters/$option content, to
> confirm that the options were correctly set.
>
> I have also carried out some additional attempts:
>
> - boot with iommu.passthrough=1 instead of pcie_aspm=off, but it does
> not seem to improve anything (and AER errors came back in the dmesg);
> - After my comments on https://github.com/lwfinger/rtw88/issues/150,
> https://github.com/lwfinger/rtw88/ was updated and I was able to load
> these modules. The connection is still very unstable, but with these
> modules, when the connection hangs, dmesg reports:
>
> rtw_8822ce 0000:03:00.0: firmware failed to leave lps state
>
> sometimes followed by:
>
> rtw_8822ce 0000:03:00.0: failed to send h2c command
>
> I have tried to set some of the options above using modules from
> https://github.com/lwfinger/rtw88/, but so far, apart from these
> additional messages, the results are almost identical to the
> precompiled modules that come with Debian.
>
>
> One of my colleagues has the same hardware (same AP model and same
> laptop model) and also tried to install Debian bookworm on it. I asked
> to check if he experiences the same issue, but in his case he was able
> to stay connected for a few hours without any issue.
> I wonder if the issue I am experiencing could be due to defective
> hardware (initially I excluded it since the same configuration is very
> stable under Windows). Is there any specific test that I can try to
> exclude hardware issues?
>
> Bests,
> Giulio

You can swap the wifi cards in the two laptops. Make sure to unplug
the charger and the battery before working inside.

2023-06-29 00:35:05

by Ping-Ke Shih

[permalink] [raw]
Subject: RE: Realtek 8822ce connection is very unstable



> -----Original Message-----
> From: Bitterblue Smith <[email protected]>
> Sent: Wednesday, June 28, 2023 9:28 PM
> To: Giulio Paci <[email protected]>; Ping-Ke Shih <[email protected]>
> Cc: James <[email protected]>; [email protected]
> Subject: Re: Realtek 8822ce connection is very unstable
>
> On 28/06/2023 13:35, Giulio Paci wrote:
> >
> > I confirm this is the approach I used in all my attempts, including
> > disable_lps_deep=1.
> > I also checked /sys/module/$module/parameters/$option content, to
> > confirm that the options were correctly set.
> >
> > I have also carried out some additional attempts:
> >
> > - boot with iommu.passthrough=1 instead of pcie_aspm=off, but it does
> > not seem to improve anything (and AER errors came back in the dmesg);
> > - After my comments on https://github.com/lwfinger/rtw88/issues/150,
> > https://github.com/lwfinger/rtw88/ was updated and I was able to load
> > these modules. The connection is still very unstable, but with these
> > modules, when the connection hangs, dmesg reports:
> >
> > rtw_8822ce 0000:03:00.0: firmware failed to leave lps state
> >
> > sometimes followed by:
> >
> > rtw_8822ce 0000:03:00.0: failed to send h2c command

I suggest to try "iw wlan0 set power_save off" for these two cases, or
you can configure network_manager along with [1].
And, as your experiment, set pcie_aspm=off to the Linux command line to
avoid AER error.


[1] https://gist.github.com/jcberthon/ea8cfe278998968ba7c5a95344bc8b55

> > One of my colleagues has the same hardware (same AP model and same
> > laptop model) and also tried to install Debian bookworm on it. I asked
> > to check if he experiences the same issue, but in his case he was able
> > to stay connected for a few hours without any issue.
> > I wonder if the issue I am experiencing could be due to defective
> > hardware (initially I excluded it since the same configuration is very
> > stable under Windows). Is there any specific test that I can try to
> > exclude hardware issues?
> >
> > Bests,
> > Giulio
>
> You can swap the wifi cards in the two laptops. Make sure to unplug
> the charger and the battery before working inside.
>

I have the same thinking.