Tracking known issues and solutions with the BPi A311D upgrade

I’ll keep this short, kind of TL;DR list of things I’ve learned in the last few days. Feel free to comment additional solutions, I’ll try to keep this message updated.

First, an important note:
/dev/mmcblk1 and /dev/mmcblk0 are the other way around on A311D from how they are on imx8, meaning that on A311D:
/dev/mmcblk0 = SD card
/dev/mmcblk1 = EMMC

For the time being, do not attempt to flash EMMC (/dev/mmcblk1). The only verified way to boot is from the SD card. For now, flashing EMMC on the BPi is untested and may render your BPi SoM unbootable (soft brick).


  • Issue: LUKS disk decryption password prompt never appears on boot
  • Solution: Replace misconfigured /boot/boot.scr with one from here
    (Though this issue is likely already resolved by the time you read this)

  • Issue: Battery meter values are incorrect
  • Diagnosis: watch -n 1 /sys/class/power_supply/8xlifepo4/device/status, values can be seen jumping around randomly

→ Solution: Flash LPC to version R20230703 or newer.


  • Issue: WiFi and Bluetooth are not working
  • Diagnosis: sudo dmesg | grep bluetooth shows:
[   37.997989] bluetooth hci0: firmware: failed to load rtl_bt/rtl8822cs_fw.bin (-2)                  |
[   38.005390] bluetooth hci0: firmware: failed to load rtl_bt/rtl8822cs_fw.bin (-2)                  |
[   38.012817] bluetooth hci0: Direct firmware load for rtl_bt/rtl8822cs_fw.bin failed with error -2

→ Solution: Enable non-free-firmware in /etc/apt/sources.list and install the firwmware package firmware-realtek, then reboot.


  • Issue: Left internal speaker much quieter than right one
  • Diagnosis: Observe left speaker being much quieter when playing audio

→ Solution: Hardware issue on my unit - Soldered speaker wire back on, resolved.


  • Issue: mpv segfaults when trying to play video
  • Diagnosis: Try to play video, observe segfault:
vkoskiv@reform:~$ mpv https://www.youtube.com/watch?v=_MljEAIpQ8g
 (+) Video --vid=1 (*) (vp9 1920x1080 59.940fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
File tags:
 Uploader: Adrian's Digital Basement ][
 Channel_URL: https://www.youtube.com/channel/UCbtwi4wK1YXd9AyV_4UcE6g
Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Cannot load libcuda.so.1
[ffmpeg] AVHWDeviceContext: Could not dynamically load CUDA
Segmentation fault

→ Solution: #Comment out hwdec=auto from ~/.config/mpv/mpv.conf


  • Issue: WiFi is slow (~30Mbit/s) despite good signal strength
  • Diagnosis: Run a speed test

→ Solution: TBD - Apparently it’s a known driver issue


  • Issue: The following occasionally appears in dmesg:
[ 6350.739799] rtw_8822cs mmc2:0001:1: failed to send h2c command
[ 6352.847914] rtw_8822cs mmc2:0001:1: firmware failed to leave lps state

→ Solution: TBD - Unknown if this is causing any problems


Edit: Added on 22.10.2023:

  • Issue: 100% packet loss on WiFi after a while, but linux still thinks the connection is fine
  • Diagnosis: pinging router yields Destination Host Unreachable.

→ Solution: TBD - May be relayed to dmesg errors above, no solution yet, reconnecting fixes the issue temporarily.


  • Issue: Can’t enable HDMI and eDP at the same time
  • Diagnosis: The following commands work to switch displays, but omitting first command to disable eDP-1 makes the following HDMI enable commands not work.

To switch to external HDMI in sway, run:

swaymsg output eDP-1 disable
swaymsg output HDMI-A-1 enable
swaymsg output HDMI-A-1 modeline 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync

Note: EDID support (which is how monitors tell Linux the different modes they support) apparently doesn’t work at the moment, which is why we specify the modeline manually. In the example above, 1920x1080@50Hz
To switch back to internal screen, run the following two commands twice

swaymsg output eDP-1 enable
swaymsg output HDMI-A-1 disable

I was also unable to set a different modeline, I tried this following one to set HDMI to 2560x1440@~59Hz:

swaymsg output HDMI-A-1 modeline 241.5 2560 2608 2640 2720 1440 1443 1448 1481 +hsync +vsync

I didn’t get any errors or anything the setting just didn’t take. My HDMI cable is cheap, could be that.

→ Solution: TBD - There are other hardware projects, such as the Khadas VIM3 that use the same A311D chipset that advertise multiple display support, so it seems likely that this is a software limitation that can be fixed.

6 Likes

I have been using these bindings for a while now to switch between monitors and they work very reliable. The key for me is to disable the active monitor first before enable the “new” one.

# Switch monitors
bindsym $mod+m output eDP-1 disable ; output HDMI-A-1 enable
bindsym $mod+Shift+m output HDMI-A-1 disable ; output eDP-1 enable
3 Likes

As I was typing out that edit, it did kind of hit me why that needed to be run twice. On the first run, it fails to enable eDP and disables HDMI, and on the second run it enables eDP and does nothing to HDMI.

2 Likes

I ran into a small issue with the internal display in sway, using a fresh v4 image.

On a fresh boot, this happened intermittently but not rare: after swayidle sets dpms off and on, everything looks fine, but new workspaces and windows don’t appear in the internal display. It appears the external HDMI output was activated with a silly mode (0 pixels!)

The issue is fixed and all is back to normal if I deactivate HDMI-A-1 with ‘swaymsg output HDMI-A-1 disable’.

pff@abacaxi:~$ swaymsg -t get_outputs
Output eDP-1 ‘Unknown Unknown Unknown’ (focused)
Current mode: 1920x1080 @ 67.446 Hz
Position: 0,0
Scale factor: 1.000000
Scale filter: nearest
Subpixel hinting: unknown
Transform: normal
Workspace: 1
Max render time: off
Adaptive sync: disabled
Available modes:
1920x1080 @ 67.446 Hz

Output HDMI-A-1 ‘Unknown Unknown Unknown’
Current mode: 0x0 @ 0.000 Hz
Position: 1920,0
Scale factor: 1.000000
Scale filter: nearest
Subpixel hinting: unknown
Transform: normal
Workspace: 3
Max render time: off
Adaptive sync: disabled
Available modes:
1024x768 @ 60.004 Hz
800x600 @ 60.317 Hz
800x600 @ 56.250 Hz
848x480 @ 60.000 Hz

In my sway config:
exec swayidle -w
timeout 600 ‘swaymsg “output * dpms off”’
resume ‘swaymsg “output * dpms on”’

I see now the new sway config (in v4) doesn’t use dpms off/on, this is a bug I introduced by using my old config file for sway… so beware of dpms on/off?

2 Likes

I was having many problems with the wireless connection. Including the same messages shown above and 100% packet loss after a while.

The issues were solved after

  1. creating a config file /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf
    with:
[connection]
wifi.powersave = 2
  1. rebooting
4 Likes

Seems to be working for me so far, I’ll add a note to my post. Thanks for sharing!

Edit: It won’t let me edit the OP anymore :stuck_out_tongue:

Thanks this saved me. I lost wifi entirely during an apt-upgrade. BT was still available though. This config file brought back wifi. It seems more stable as well.

A couple of issues I’ve run into on Gnome, not sure if other DE/WM are affected.

  • Sleeping locks up reform. This was an issue with the i.mx8 module that was eventually resolved.
  • Gnome installed fine and for the most part works great. Much snappier than it was on the i.mx8 but Gnome Software center shows flatpaks after I added them but never showed native debs even though everything seems correct.

Neither are deal breakers just adding them to the list.

1 Like

I would say remove this, as it has nothing to do with the BPi A331D upgrade. I have had this issue on my Reform a few times. I’ve had to resolder the wire three times now. I did a much better job this third time, and it seems to be holding.

Thank you for putting this list together!

disabling wifi powersaving has also solved this issue for me too, thanks :slight_smile:

Definitely beware of dpms on/off, yes. It can happen (and nobody knows yet why) that after setting “dpms off” and some time has passed, the system completely locks up. This is independent on the SoM and happens on imx8mq as well as on a311d.

Could someone who tried booting from EMMC please elaborate what is meant by “soft brick”?

Does this denote a situation that can be resolved via serial console (UART), or does fixing such a situation require dedicated hardware, like a CM4 I/O Board?

I asked Lukas about this last year:

vkoskiv: Aah, so SD card boot it is then?

minute: vkoskiv: yes, i recommend that until i had a chance to test emmc. as i wrote earlier, i have the io board for the cm4 and can unbrick it via usb, but you probably don’t have one

Here’s the log for more context, the above is from 23:30.

1 Like

The problem is, that to flash a new u-boot, you either need the cm4 i/o board or you need the system to be booted successfully. If, for some reason, you flash a wrong or defective u-boot, then your system will not boot anymore and then the only way to fix it is with the cm4 i/o board.

Since I don’t have the i/o board, I still have u-boot on an sd-card. But I have my /boot on emmc. That way, after the system has started, I can just remove the sd-card and get the slot back to be used for other stuff.

1 Like

That’s a brilliant idea. I have to check the Banana Pi boot process again, but I think it shouldn’t be too hard to just leave the part of the EMMC empty, that the boot ROM checks for u-boot. That way installing u-boot to the EMMC at a later point should be possible without touching any file systems.

It you have iwd as Wireless daemon, the solution is to edit /etc/iwd/main.conf and add:

[DriverQuirks]
# My first version contains phy0 but glob on rtw drivers seems better
PowerSaveDisable=rtw*

And restart iwd. For now I don’t have message anymore (but I need to test it more)

1 Like

I have not had any issues with dpms off ever since I changed the line to only explicitly switch off the eDP output.

exec swayidle -w \
    timeout 300 'swaymsg "output eDP-1 dpms off"' resume 'swaymsg "output eDP-1 dpms on"'

However, I have not tried this for very long yet, so I might just have been lucky to just not encounter the bug by chance.

Also, the system doesn’t completely freeze for me, only the graphical session. I can usually CTRL+ALT+F? to another terminal and kill Wayland.

1 Like