Xorg 红蓝两色通道异常 默认分辨率和色深设置

现象:红色显示蓝色,蓝色显示黄色
原因:Xorg色深设置错误,从8bit提升至16bit后显示正确
相关conf:

Section "Device"
    Identifier    "AMD"
    Driver      "amdgpu"
EndSection

Section    "Screen"
    Identifier    "Default Screen"
    Device    "amdgpu"
    Monitor    "Default Monitor"
    DefaultDepth 16

    SubSection "Display"
        Depth     16
    Modes     "1920x1080"
    EndSubSection
EndSection

### Valid values for rotation are "normal", "left", "right"
Section    "Monitor"
    Identifier    "Default Monitor"
    # Option    "Rotate" "normal"
    # 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz
    Modeline "1920x1080_60.00"  172.80  1920 2040 2248 2576  1080 1081 1084 1118  -HSync +Vsync
EndSection

正点原子RK3568的默认配置中,Device使用的驱动是modesetting,该驱动在16bit色深下不能提升分辨率至1920x1080
你可以通过执行 sudo X :1 -configure (:1 可以是其它非0数字,不要是已激活的屏幕就行)

X.Org X Server 1.21.1.7
X Protocol Version 11, Revision 0
Current Operating System: Linux atompi-ca1 5.10.160 #1 SMP Tue Jan 30 11:01:02 CST 2024 aarch64
Kernel command line: earlycon=uart8250,mmio32,0xfe660000 root=/dev/mmcblk0p3 earlyprintk console=ttyFIQ0 rootwait rw 
xorg-server 2:21.1.7-3+deb12u7 (https://www.debian.org/support) 
Current version of pixman: 0.42.2
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Sun Jul 14 18:42:15 2024
List of video drivers:
    amdgpu
    ati
    nouveau
    radeon
    modesetting
    fbdev
    vesa
No devices to configure.  Configuration failed.
(EE) Server terminated with error (2). Closing log file.

sysv-rc-conf 升级失败 依赖冲突 AtomPi 正点原子RK3568 Debian升级小记

故事略长,但是先讲重点
如果你是systemd作为init程序,那么不要升级sysv-rc-conf,甚至可以直接卸载
正文:AtomPi 正点原子RK3568 Debian升级小记
新拿到手的RK3568,自带的是Debian11 说实话,能用,如果不像我一样对新系统偏执完全不用升级
升级系统步骤如下:
设置timeshift系统备份,很重要,不要莽,去搜,简单易用有效!!
删除所有dbgsym
dpkg -l | grep dbgsym | awk '{print $2}' | xargs sudo dpkg --purge
这个命令说实话有点危险,它本意是删除所有带dbgsym的软件包,后续升级时,这些软件包会造成依赖问题
修改/etc/apt/sources.list 我这里是Debian11升12,所以把bullseye改为bookworm
sudo apt update $$ sudo apt upgrade
升级后你会发现一些软件包没有被升级,我的处理方式挺麻烦的,当然你选择不升级也不会有任何影响。
我这边大概有80多个未升级的软件包,很多软件包能看出来是一类的,当你使用
'''
sudo apt upgrade
sudo apt dist-upgrade
'''
都不能升级,但sudo apt upgrade [特定软件包名]又可以升级时,可以试试这样(例如gstreamer):
dpkg -l | grep gstreamer | awk '{print $2}' | xargs sudo apt dist-upgrade -y --allow-change-held-packages
好,其实以上这些都不是我想讲的
我想说的是其中一个软件包sysv-rc-conf
在尝试单独升级这个包时,会出现systemd相关的依赖冲突问题。但是奇怪的是其他软件包的依赖问题都是这样子的:
升级A时
A依赖B B版本不对
B依赖A A的新版本不能被B接受
但是sysv-rc-conf却没有出现在依赖问题中。
然后我试着删掉包重装。然后发现重装时要求删掉我的systemd
这下我知道为什么我第一次升级把systemd升没了。上一次我的处理方法是,记录所有包,删掉所有包,重装所有包。
sysv init和systemd init是冲突的。用systemd就好了。

LagrangeCoreApi 开发小记

public static class ControllerBaseExtension
{
    public static IActionResult Success(this ControllerBase controller) =>
        new ApiResponse<int>(200);

    public static IActionResult Success(this ControllerBase controller, string msg) =>
        new ApiResponse<int>(200, msg);

    public static IActionResult Success<T>(this ControllerBase controller, T data) =>
        new ApiResponse<T>(200, "", data);

    public static IActionResult Success<T>(
        this ControllerBase controller,
        string msg,
        T? data
    ) => new ApiResponse<T>(200, msg, data);

    public static IActionResult Fail(this ControllerBase controller) =>
        new ApiResponse<int>(500);

    public static IActionResult Fail(this ControllerBase controller, string msg) =>
        new ApiResponse<int>(500, msg);
}

之前写这段代码时遇到一个问题,如果想要使用一个参数,发送string类型的data,但msg留空。在全用范型方法的情况下是做不到的。当时把这个问题暂时搁置了。但后续使用方法时,由于忘记填写范型类型导致报错,让我想出了如上的方法。如果有范型则最后一个参数为data。否则没有data数据。后续可能会用object和null代替。

第二,Lagrange.Core现在有官方的Api地址,可以不用自己设置sign服务了
https://sign.lagrangecore.org/api/sign
Thanks for 外国热心网友 for Provision of Azure Servlet
Built-in SignServer is now provided, Enjoy!

第三,VS的git真的难用。点了半天后上网搜了git命令直接解决了。建议只把VS的git作为一个可视化工具。

Hyprland 新进展

上次blog有提到swww的相关问题,在提交issue后,开发者说是当前正在重构导致的不稳定。并且把main分支回退到了一个更稳定的版本
然后就能用了捏quq
图片.png
好看!
另外一件事是fcitx5在electron中无法使用的问题。翻遍各种网站后,还真让我找到了正确的解决方案(屎里淘金说是)
另外顺着这个网站找到了一个不大的mc服务器群quq
下一步是jetbrain系软件(继续搞fcitx5)安装和生产力软件(word、excel、powerpoint、...)还有各种折腾

Hyprland

今天开搞一个一直想搞的桌面: hyprland
hyprland是一个平铺式桌面,理论上,在熟悉快捷键后,应该能有一个很高的效率。此外,我希望这能成为一个新的开始,关于linux新的,有趣的技术的开始。
今天做的事:
备份原来linux中的少部分关键个人文件
设置Ubuntu镜像,准备安装。
安装Ubuntu24.04
Screenshot from 2024-06-30 09-55-22.png
这个安装竟然自动使用清华镜像源 好耶!

设置Clash
安装hyprland
安装Ubuntu24.04
设置Clash
安装并设置timeshift
安装hyprland 取消了sddm的安装
配置hyprland,这东西设置多显示器的分辨率和方向是通过文件设置的。但是在修改文件后立刻就能更改。这一点感觉有点特别。
配置fcitx5
swww运行不正确,看不到壁纸,给原作者发很烂的issue。希望作者别打我。
今天就做到这么多,有时间再试试解决壁纸问题。(遇到困难睡大觉说是)
推荐一个很好听的歌:幽世桔梗