0%

恩山上看到有人在R3300-L上刷入Android 6.0后,成功将openwrt刷入emmc并启动成功。或许R3300-M也可以?

R3300-M使用meson-gxbb-p201.dtb,搜索外网固件基本上锁定MXQ P201关键词,于是搜到了这个帖子:

Ugoos Android 6.0.1 port MXQ S905 P201

有网友在MXQ P201上测试,WIFI正常,有线网卡不工作。不过我们现在只关心BootLoader,Amlogic设备的分区表都在BootLoader里,如果这个BootLoader比较新,可以小小期待下从emmc启动。

从上面帖子追踪到原贴,某位俄国人基于UGOS做的改版固件: https://4pda.to/forum/index.php?showtopic=760441&st=1320

固件下载地址: https://drive.google.com/drive/folders/1ECX6Peu5tELNMbLKo5_dBJN76DlvuX6L

其中:(谷歌渣翻译加猜测,原文俄文看不懂)

  1. ugos7 wifi.img : 只有 WIFI 工作
  2. ugos9 wifi s pdu.img : Wifi 工作和远程控制
  3. ugos10 wifi s pdu ckear.img :Wifi 工作正常,删除了一些 ugos预装应用和启动器(作者说这个最精简,最快)

ugos10应该最适合,如果这个固件内核版本高于3.14,那么从emmc启动openwrt(5.4内核)就很有希望。Manjaro主线内核已经滚到了5.14.2,不抱希望。(如果没记错,恩山Flippy在某帖子中提到5.10内核后Amlogic都无法从emmc启动linux)有空时候测试下。

#!/bin/bash
# autohexo.sh
# 半自动推送更新
# -i:接受行内文本作为commit -m 参数
# -f:接受一个文本文件作为commit -m 参数
# -g:构建页面并推送,无参数
commitComment=""
echo
function commit2git {
    git add .
    git commit -m "$1"
    git push origin blogSource
}
while getopts :i:f:g opt
do
        case "$opt" in
                f)commitComment=$(cat "$OPTARG")
                  commit2git "$commitComment";;
                i)commitComment=$(echo "$OPTARG")
                  commit2git "$commitComment";;
                g)hexo g -d;;
                *);;
        esac
done

很简单的脚本,通过终端输入或者提供一个文本文件传递commit -m的参数,能够略微简化提交博客源码的流程。

用例:

./autohexo.sh -gi "更新日志"

Use ImageMagick® to create, edit, compose, or convert digital images. It can read and write images in a variety of formats (over 200) including PNG, JPEG, GIF, WebP, HEIC, SVG, PDF, DPX, EXR and TIFF. ImageMagick can resize, flip, mirror, rotate, distort, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.

利用imagemagick可以对图片进行从简单到复杂的各种处理。

格式转换

场景:微信公众号封面不接受webp格式图片,需要进行转换:

convert 封面4.webp 封面4.jpg

再也不需要下载安装臃肿迟缓捆绑广告试用版还添加水印的软件了。

图片合并

一张图片一页:

convert 1.jpg 2.jpg 3.jpg total.tif

得到一个3页的图片文件,类似PDF。当然,也可以一步到位,直接转换为PDF:

convert 1.jpg 2.jpg 3.jpg total.pdf

有可能会提示类似错误:

convert-im6.q16: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408.

ImageMagick的默认安全策略禁止这种转换,可以通过修改ImageMagick安全策略文件取消限制:

sudo vim /etc/ImageMagick-*/policy.xml

<!-- <policy domain="module" rights="none" pattern="{PS,PDF,XPS}" /> -->这一行取消注释并保存,即修改为

<policy domain="module" rights="none" pattern="{PS,PDF,XPS}" />

这样输出图片为PDF就没问题了。

备注:我在Deepin上测试,得到的“PDF”文件打不开,用file查看是图片格式:

output.pdf: JPEG image data, JFIF standard 1.01, resolution (DPI), density 72x72, segment length 16, Exif Standard: [TIFF image data, big-endian, direntries=14, height=3264, bps=0, description=smart, manufacturer=HUAWEI, model=CND-AN00, orientation=upper-left, xresolution=200, yresolution=208, resolutionunit=2, software=CND-AN00 10.1.1.166(C00E140R3P1), datetime=2021:08:14 08:02:45, width=2448], baseline, precision 8, 2448x3264, components 3

Deepin上convert版本:Version: ImageMagick 6.9.10-23 Q16 x86_64 20190101 https://imagemagick.org Copyright: © 1999-2019 ImageMagick Studio LLC

在Manjaro ARM 21.08上测试没问题,得到了正常的PDF文件。Manjaro ARM 21.08上convert版本为Version: ImageMagick 7.1.0-6 Q16-HDRI aarch64 2021-09-04 https://imagemagick.org Copyright: (C) 1999-2021 ImageMagick Studio LLC。另外Manjaro上不需要修改policy文件,默认就正常运行。

按a4纸张规格输出

convert screenshot-2021-09-14-222216.png -page a4 1.pdf

其他功能还有很多,类似resize等等,具体可查阅man手册。

最近瞎鼓捣东西形成了一些笔记想好好地汇编成册,当年写论文时用过的LaTeX还不错,基本语法也没忘,于是就选它了。troff据说历史更悠久,而且基本上Linux发行版都会预装,不过就不花功夫研究老古董了。

得益于Archlinux粗壮的大腿,使用Manjaro遇到的问题往往可以在Archlinux Wiki中找到答案。安装很简单:

sudo pacman -Sy texlive-most texlive-langchinese

texlive-most包含了texlive-core和其他一些可选模块,建议全选。texlive-langchinese包含了CTEX宏包。我选择xeLatex + CTEX的中文方案,所以这个包必装。

安装完毕后测试看看效果:

\documentclass{ctexbook}
\begin{document}
中文测试
\end{document}

输出符合预期。texdoc tikz还是一如既往地头大,而且现在又多了一个画花纹的pgfornament看起来很有趣。

参考:安装Manjaro之后的配置

平台还是R3300-M …… 准备用它当做阅读器专心读书,人不在家直接关闭显示器就行了,从外面还能SSH连回来做实验,电费可忽略不计。安装运行Calibre很简单,但是中文字体看起来很奇怪,汇总下网上搜来的解决办法。

安装字体

安装官方仓库中的字体

sudo pacman -S ttf-roboto noto-fonts ttf-dejavu
sudo pacman -S wqy-bitmapfont wqy-microhei wqy-microhei-lite wqy-zenhei
sudo pacman -S noto-fonts-cjk adobe-source-han-sans-cn-fonts adobe-source-han-serif-cn-fonts

上面的ttf-roboto noto-fonts如果系统已经安装了就不需要再装。

创建字体配置文件

/etc/fonts/fonts.conf里面提示不要修改此文件,所以创建~/.config/fontconfig/fonts.conf

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
    <its:rules xmlns:its="http://www.w3.org/2005/11/its" version="1.0">
        <its:translateRule translate="no" selector="/fontconfig/*[not(self::description)]"/>
    </its:rules>

    <description>Manjaro Font Config</description>

    <!-- Font directory list -->
    <dir>/usr/share/fonts</dir>
    <dir>/usr/local/share/fonts</dir>
    <dir prefix="xdg">fonts</dir>
    <dir>~/.fonts</dir> <!-- this line will be removed in the future -->

    <!-- 自动微调 微调 抗锯齿 内嵌点阵字体 -->
    <match target="font">
        <edit name="autohint"> <bool>false</bool> </edit>
        <edit name="hinting"> <bool>true</bool> </edit>
        <edit name="antialias"> <bool>true</bool> </edit>
        <edit name="embeddedbitmap" mode="assign"> <bool>false</bool> </edit>
    </match>

    <!-- 英文默认字体使用 Roboto 和 Noto Serif ,终端使用 DejaVu Sans Mono. -->
    <match>
        <test qual="any" name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Noto Serif</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>Roboto</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>monospace</string>
        </test>
        <edit name="family" mode="prepend" binding="strong">
            <string>DejaVu Sans Mono</string>
        </edit>
    </match>

    <!-- 中文默认字体使用思源宋体,不使用 Noto Sans CJK SC 是因为这个字体会在特定情况下显示片假字. -->
    <match>
        <test name="lang" compare="contains">
            <string>zh</string>
        </test>
        <test name="family">
            <string>serif</string>
        </test>
        <edit name="family" mode="prepend">
            <string>Source Han Serif CN</string>
        </edit>
    </match>
    <match>
        <test name="lang" compare="contains">
            <string>zh</string>
        </test>
        <test name="family">
            <string>sans-serif</string>
        </test>
        <edit name="family" mode="prepend">
            <string>Source Han Sans CN</string>
        </edit>
    </match>
    <match>
        <test name="lang" compare="contains">
            <string>zh</string>
        </test>
        <test name="family">
            <string>monospace</string>
        </test>
        <edit name="family" mode="prepend">
            <string>Noto Sans Mono CJK SC</string>
        </edit>
    </match>

    <!-- 把Linux没有的中文字体映射到已有字体,这样当这些字体未安装时会有替代字体 -->
    <match target="pattern">
        <test qual="any" name="family">
            <string>SimHei</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>Source Han Sans CN</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>SimSun</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>Source Han Serif CN</string>
        </edit>
    </match>
    <match target="pattern">
        <test qual="any" name="family">
            <string>SimSun-18030</string>
        </test>
        <edit name="family" mode="assign" binding="same">
            <string>Source Han Serif CN</string>
        </edit>
    </match>
    
    <!-- Load local system customization file -->
    <include ignore_missing="yes">conf.d</include>
    <!-- Font cache directory list -->
    <cachedir>/var/cache/fontconfig</cachedir>
    <cachedir prefix="xdg">fontconfig</cachedir>
    <!-- will be removed in the future -->
    <cachedir>~/.fontconfig</cachedir>

    <config>
        <!-- Rescan in every 30s when FcFontSetList is called -->
        <rescan> <int>30</int> </rescan>
    </config>

</fontconfig>

晚上试试看字体是否会正常一些。

更新:经测试,配置字体后使用Calibre-Viewer看书字体渲染效果满意。

手动安装字体

刷新字体命令:fc-cache -fv

Font directories:
        /home/youname/.local/share/fonts
        /usr/local/share/fonts
        /usr/share/fonts
        /home/youname/.fonts
        /usr/share/fonts/TTF
        /usr/share/fonts/adobe-source-code-pro
        /usr/share/fonts/adobe-source-han-sans
        /usr/share/fonts/adobe-source-han-serif
        /usr/share/fonts/cantarell
        /usr/share/fonts/droid
        /usr/share/fonts/encodings
        /usr/share/fonts/gsfonts
        /usr/share/fonts/liberation
        /usr/share/fonts/misc
        /usr/share/fonts/noto
        /usr/share/fonts/noto-cjk
        /usr/share/fonts/util
        /usr/share/fonts/wenquanyi
        /usr/share/fonts/wps-office
        /usr/share/fonts/encodings/large
        /usr/share/fonts/wenquanyi/wqy-microhei
        /usr/share/fonts/wenquanyi/wqy-microhei-lite
        /usr/share/fonts/wenquanyi/wqy-zenhei
/home/youname/.local/share/fonts: skipping, no such directory
/usr/local/share/fonts: skipping, no such directory
/usr/share/fonts: caching, new cache contents: 0 fonts, 15 dirs
/usr/share/fonts/TTF: caching, new cache contents: 148 fonts, 0 dirs
/usr/share/fonts/adobe-source-code-pro: caching, new cache contents: 30 fonts, 0 dirs
/usr/share/fonts/adobe-source-han-sans: caching, new cache contents: 7 fonts, 0 dirs
/usr/share/fonts/adobe-source-han-serif: caching, new cache contents: 7 fonts, 0 dirs
/usr/share/fonts/cantarell: caching, new cache contents: 11 fonts, 0 dirs
/usr/share/fonts/droid: caching, new cache contents: 27 fonts, 0 dirs
/usr/share/fonts/encodings: caching, new cache contents: 0 fonts, 1 dirs
/usr/share/fonts/encodings/large: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/gsfonts: caching, new cache contents: 35 fonts, 0 dirs
/usr/share/fonts/liberation: caching, new cache contents: 12 fonts, 0 dirs
/usr/share/fonts/misc: caching, new cache contents: 1 fonts, 0 dirs
/usr/share/fonts/noto: caching, new cache contents: 615 fonts, 0 dirs
/usr/share/fonts/noto-cjk: caching, new cache contents: 73 fonts, 0 dirs
/usr/share/fonts/util: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/wenquanyi: caching, new cache contents: 5 fonts, 3 dirs
/usr/share/fonts/wenquanyi/wqy-microhei: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/wenquanyi/wqy-microhei-lite: caching, new cache contents: 2 fonts, 0 dirs
/usr/share/fonts/wenquanyi/wqy-zenhei: caching, new cache contents: 3 fonts, 0 dirs
/usr/share/fonts/wps-office: caching, new cache contents: 14 fonts, 0 dirs
/home/youname/.fonts: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts/TTF: skipping, looped directory detected
/usr/share/fonts/adobe-source-code-pro: skipping, looped directory detected
/usr/share/fonts/adobe-source-han-sans: skipping, looped directory detected
/usr/share/fonts/adobe-source-han-serif: skipping, looped directory detected
/usr/share/fonts/cantarell: skipping, looped directory detected
/usr/share/fonts/droid: skipping, looped directory detected
/usr/share/fonts/encodings: skipping, looped directory detected
/usr/share/fonts/gsfonts: skipping, looped directory detected
/usr/share/fonts/liberation: skipping, looped directory detected
/usr/share/fonts/misc: skipping, looped directory detected
/usr/share/fonts/noto: skipping, looped directory detected
/usr/share/fonts/noto-cjk: skipping, looped directory detected
/usr/share/fonts/util: skipping, looped directory detected
/usr/share/fonts/wenquanyi: skipping, looped directory detected
/usr/share/fonts/wps-office: skipping, looped directory detected
/usr/share/fonts/encodings/large: skipping, looped directory detected
/usr/share/fonts/wenquanyi/wqy-microhei: skipping, looped directory detected
/usr/share/fonts/wenquanyi/wqy-microhei-lite: skipping, looped directory detected
/usr/share/fonts/wenquanyi/wqy-zenhei: skipping, looped directory detected
/var/cache/fontconfig: not cleaning unwritable cache directory
/home/youname/.cache/fontconfig: cleaning cache directory
/home/youname/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded

查找字体位置一目了然。过去一般习惯把字体文件直接丢到~/.fonts中,但是/etc/fonts/fonts.conf中提到

<!-- the following element will be removed in the future -->
<dir>~/.fonts</dir>

所以还是老实放到/usr/share/fonts/里面合适的目录中更合适。

在前面已经成功驱动了WIFI,于是再来看一看红外线:

$ dmesg | grep meson-ir

[    5.140483] rc rc0: meson-ir as /devices/platform/soc/c8100000.bus/c8100580.ir/rc/rc0
[    5.142659] rc rc0: lirc_dev: driver meson-ir registered at minor = 0, raw IR receiver, no transmitter
[    5.142827] input: meson-ir as /devices/platform/soc/c8100000.bus/c8100580.ir/rc/rc0/input4
[    5.147424] meson-ir c8100580.ir: receiver initialized

看起来红外线模块已经被成功识别并驱动。

再来看一看遥控文件:

$ ls /lib/udev/rc_keymaps/

adstech_dvb_t_pci.toml
af9005.toml
alink_dtu_m.toml
allwinner_ba10_tv_box.toml
allwinner_i12_a20_tv_box.toml
anysee.toml
apac_viewcomp.toml
astrometa_t2hybrid.toml
asus_pc39.toml
asus_ps3_100.toml
ati_tv_wonder_hd_600.toml
ati_x10.toml
avermedia.toml
avermedia_a16d.toml
avermedia_cardbus.toml
avermedia_dvbt.toml
avermedia_m135a.toml
avermedia_m733a_rm_k6.toml
avermedia_rm_ks.toml
avertv_303.toml
az6027.toml
azurewave_ad_tu700.toml
beelink_gs1.toml
behold.toml
behold_columbus.toml
budget_ci_old.toml
cec.toml
cinergy.toml
cinergy_1400.toml
cinergyt2.toml
d680_dmb.toml
delock_61959.toml
dib0700_nec.toml
dib0700_rc5.toml
dibusb.toml
digitalnow_tinytwin.toml
digittrade.toml
digitv.toml
dish_network.toml
dm1105_nec.toml
dntv_live_dvb_t.toml
dntv_live_dvbt_pro.toml
dtt200u.toml
dvbsky.toml
dvico_mce.toml
dvico_portable.toml
em_terratec.toml
encore_enltv.toml
encore_enltv2.toml
encore_enltv_fm53.toml
evga_indtube.toml
eztv.toml
flydvb.toml
flyvideo.toml
fusionhdtv_mce.toml
gadmei_rm008z.toml
geekbox.toml
genius_tvgo_a11mce.toml
gotview7135.toml
haupp.toml
hauppauge.toml
hisi_poplar.toml
hisi_tv_demo.toml
imon_mce.toml
imon_pad.toml
imon_rsc.toml
iodata_bctv7e.toml
it913x_v1.toml
it913x_v2.toml
kaiomy.toml
khadas.toml
kii_pro.toml
kworld_315u.toml
kworld_pc150u.toml
kworld_plus_tv_analog.toml
leadtek_y04g0051.toml
lme2510.toml
manli.toml
mce_keyboard.toml
medion_x10.toml
medion_x10_digitainer.toml
medion_x10_or2x.toml
megasky.toml
msi_digivox_ii.toml
msi_digivox_iii.toml
msi_tvanywhere.toml
msi_tvanywhere_plus.toml
nebula.toml
nec_terratec_cinergy_xs.toml
norwood.toml
npgtech.toml
odroid.toml
opera1.toml
pctv_sedna.toml
pinnacle310e.toml
pinnacle_color.toml
pinnacle_grey.toml
pinnacle_pctv_hd.toml
pixelview.toml
pixelview_002t.toml
pixelview_mk12.toml
pixelview_new.toml
powercolor_real_angel.toml
proteus_2309.toml
purpletv.toml
pv951.toml
rc6_mce.toml
real_audio_220_32_keys.toml
reddo.toml
snapstream_firefly.toml
streamzap.toml
su3000.toml
tango.toml
tanix_tx3mini.toml
tanix_tx5max.toml
tbs_nec.toml
technisat_ts35.toml
technisat_usb2.toml
terratec_cinergy_c_pci.toml
terratec_cinergy_s2_hd.toml
terratec_cinergy_xs.toml
terratec_slim.toml
terratec_slim_2.toml
tevii_nec.toml
tivo.toml
total_media_in_hand.toml
total_media_in_hand_02.toml
trekstor.toml
tt_1500.toml
tvwalkertwin.toml
twinhan_dtv_cab_ci.toml
twinhan_vp1027_dvbs.toml
vega_s9x.toml
videomate_k100.toml
videomate_s350.toml
videomate_tv_pvr.toml
vp702x.toml
wetek_hub.toml
wetek_play2.toml
winfast.toml
winfast_usbii_deluxe.toml
wobo_i5.toml
x96max.toml
xbox_dvd.toml
zx_irdec.toml

有很多,但显然没有我使用的遥控器。计划找出按键对应值,然后根据模板创建。寻找按键映射参照 https://discourse.coreelec.org/t/how-to-configure-ir-remote-control/31 ,我之前做过Coreelec的,不知道是否可以直接照抄。(此部分待补充)

创建遥控文件后,可以利用按键调用系统命令,比如执行某个脚本,或者重启等等。参考 https://forum.armbian.com/topic/11161-lirc-on-armbian-buster/ ,作者使用triggerhappy实现功能:

# Samsung TV Remote Control
KEY_RED     1   /usr/local/bin/script.sh red
KEY_GREEN   1   /usr/local/bin/script.sh green
KEY_YELLOW  1   /usr/local/bin/script.sh yellow
KEY_BLUE    1   /usr/local/bin/script.sh blue

triggerhappy使用yay可以安装,有空测试下。

硬件平台还是R3300-M …… 想要Firefly的Station P2,不过迫于没钱,继续折腾小红盒 XD

前言

WIFI设置好后,又动了折腾图形界面的心思。之前测试过XFCE,分辨率不正常,桌面拖动窗口有明显卡顿,打开firefox直接卡死。一则显卡驱动有问题,二则XFCE对于R3300-M还是太重了。于是换用wayland + sway方案,彻底放弃X11。显卡驱动选择Lima,已经集成在了mesa软件包中。如果选择尝鲜,也可以安装mesa-git。Lima是在反向官方驱动的基础上,由社区开发维护的开源驱动,对Mali-400Mali-450提供支持。详情可以在 https://docs.mesa3d.org/drivers/lima.html 查看。感谢Luc Verhaegen和Qiang Yu的开创性工作。

镜像

参见 https://manjaro.org/download/#khadas-vim-2-sway ,下载地址

https://github.com/manjaro-arm/vim2-images/releases/download/21.08/Manjaro-ARM-sway-vim2-21.08.img.xz
https://github.com/manjaro-arm/vim2-images/releases/download/21.08/Manjaro-ARM-sway-vim2-21.08.img.xz.torrent

安装

烧录镜像、修改u-boot.ext、修改extlinux等与之前无异。

配置

第一次启动会进入配置引导程序,配置结束后重启,进入sway图形界面。在开始探索之前,先修复系统的小小bug:

修复greetd服务

打开/etc/greetd/config.toml,看起来大概这样:

[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1

# The default session, also known as the greeter.
[default_session]
# `agreety` is the bundled agetty/login-lookalike. You can replace `$SHELL`
# with whatever you want started, such as `sway`.
command = "sway --config /etc/greetd/sway"

# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "greeter"
[initial_session]
command = "sway --config /etc/greetd/oem-setup"
user = "oem"

你需要将最后一行的oem修改为自己实际的用户名。 Manjaro ARM团队提到将[initial_session]部分完整删除(即删除上面配置文件最后三行),此问题预计很快会得到修复。

这一步本应由配置程序自动完成,如果忘记修改,下次启动将无法进入图形界面。这种情况下,按下Ctrl + Alt + F2进入tty2,手动修改过来就可以了。

同步时间

直接摘抄之前的文章:

user $ timedatectl set-ntp true
user $ sudo systemctl enable --now systemd-timesyncd

时间不准会造成SSL验证失败等一系列问题。

换国内源

sudo pacman-mirrors -i -c China -m rank
sudo pacman-mirrors -g
sudo pacman -Syyu

使用

文档获取

sway作为窗口管理器(window manager)提供了轻量的图形功能,大量依赖配置文件和快捷键操作。遵循linux传统,/etc/sway/config~/.config/sway/config各存在一份,前者全局,后者本地优先。另外桌面右上角的问号是入门操作文档,没接触过i3sway的用户必读。sway虽然轻量,但是仍然提供了丰富好用的功能,类似全屏、窗口、区域截图或录制功能均有对应快捷键,不逊色于macOS。

查看glxinfo输出

glxinfo由mesa-demos提供:

sudo pacman -S mesa-demos

然后执行glxinfo -B

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: lima (0x13b5)
    Device: Mali450 (0xffffffff)
    Version: 21.1.6
    Accelerated: yes
    Video memory: 0MB
    Unified memory: yes
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 2.0
OpenGL vendor string: lima
OpenGL renderer string: Mali450
OpenGL version string: 2.1 Mesa 21.1.6
OpenGL shading language version string: 1.20

OpenGL ES profile version string: OpenGL ES 2.0 Mesa 21.1.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16

显卡驱动正常。另外执行sensors可以看系统温度,负载一高很容易达到50-60°C,有必要考虑强化散热。

HiDPI设置

这部分可以参阅Archlinux:https://wiki.archlinux.org/title/Sway

我使用的某品牌2K分辨率,默认分辨率看起来很正常,实际也是如此:

$ swaymsg -t get_outputs
Output HDMI-A-1 'Unknown Q27D530VHP 0x00000000' (focused)
  Current mode: 2560x1440 @ 59.951 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:
    640x480 @ 72.809 Hz
    640x480 @ 75.000 Hz
    720x480 @ 59.940 Hz
    800x600 @ 60.317 Hz    
    800x600 @ 72.188 Hz
    800x600 @ 75.000 Hz
    1024x768 @ 60.004 Hz
    1024x768 @ 70.069 Hz
    1024x768 @ 75.029 Hz
    1280x720 @ 59.940 Hz
    1280x720 @ 60.000 Hz
    1280x800 @ 59.910 Hz
    1366x768 @ 59.964 Hz
    1280x1024 @ 60.020 Hz
    1280x1024 @ 75.025 Hz
    1600x900 @ 60.000 Hz
    1680x1050 @ 59.883 Hz
    1920x1080 @ 59.940 Hz
    1920x1080 @ 60.000 Hz
    1920x1080 @ 60.000 Hz
    1920x1200 @ 59.950 Hz
    2560x1440 @ 59.951 Hz

执行glxgears可以调出一个齿轮画面测试FPS,R3300-M稳定在34~35之间。电脑上这个值一般都是三位数,不过对于盒子而言已经很不错了。

2K分辨率下文字有点小,缩放到1.5:

swaymsg output HDMI-A-1 scale 1.5

这样看起来好了很多。

输入法安装

sudo pacman -S fcitx5-im #安装所有
sudo pacman -S fcitx5-chinese-addons    

然后打开/etc/environment添加参数:

GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx

最后在Fcitx 5 Configuration中,删除默认的Default Group,新建一个Chinese组,Keyboard-Chinese放上面,Pinyin放下面就万事大吉。默认输入法英文,使用Ctrl SpaceCtrl ShiftLeft Shift在中英文之间来回切换。除了候选框小一点没别的问题。

杂项

自带的firefox刷个论坛还是很舒服的,测试bilibili弹幕比较卡,而且会丢帧,看视频还是重启到安卓系统吧。libreoffice,gedit等用着很流畅。目前小红盒用来写hexo博客或者看PDF很安逸。

另外电源管理有点小问题,关机会直接重启。而且有时休眠后显示器点不亮,需要重新拔插HDMI。

换新电脑后利用git直接拉取的代码不是完整的hexo环境,缺失了node_modules(参见.gitignore)和主题(如果使用git clone 安装了第三方主题)。

恢复node_modules

随便新建一个文件夹,进入后执行hexo init,完成后把node_modules移动到刚才的hexo目录中。

安装主题

next为例,在hexo目录下执行git clone https://github.com/theme-next/hexo-theme-next themes/next。如果之前在hexo根目录下使用了 _config.next.yml进行配置,那么就不需要重新配置主题,推荐这种配置方式。

解决 TypeError: line.matchAll is not a function 问题

_config.yml中,将hightlight一段中enable字段由true修改为false即可。

目标硬件平台还是R3300-M …… 尝试解决下WIFI问题。

参考:Orange Pi

git clone https://github.com/jwrdegoede/rtl8189ES_linux.git
cd rtl8189ES_linux
make -j4 ARCH=arm KSRC=/usr/lib/modules/4.18.11-1-ARCH/build/
cp 8189es.ko /usr/lib/modules/4.18.11-1-ARCH/kernel/drivers/net/wireless/realtek/
depmod -a
modprobe 8189es

上述4.18.11-1-ARCH根据实际情况替换。有反馈说NanoPi A64使用5.11内核驱动正常,这几天抽空测试下。

更新:编译加载成功,步骤如下:

git clone https://github.com/jwrdegoede/rtl8189ES_linux.git
sudo pacman -S linux-headers
cd /usr/lib/modules/5.13.12-1-MANJARO-ARM/build/arch
sudo mv arm armold
sudo mv arm64 arm
cd ~/rtl8189ES_linux/
make -j4 ARCH=arm KSRC=/usr/lib/modules/5.13.12-1-MANJARO-ARM/build
sudo cp 8189es.ko /usr/lib/modules/5.13.12-1-MANJARO-ARM/kernel/drivers/net/wireless/realtek/
sudo depmod -a
sudo modprobe 8189es

使用的是5.13.12-1-MANJARO-ARM #1 SMP Wed Aug 18 07:36:58 UTC 2021 aarch64 GNU/Linux主线内核,模块编译过程很顺利,只需要对build目录做一点微小的改动,编译完成后可以把文件夹名称修改回去。测试重启后依然有效,不需要手动加载。

测试测试