[Seek Help] 安装声卡驱动报错,不知道怎么办 Resolved
Tofloor
poster avatar
ㅤ旭旭哥
deepin
2025-02-21 10:13
Author

如图所示,安装声卡驱动报错,不知道怎么办。在Ubuntu上完全正常,看代码好像是python脚本错误,求大神指导。

相关链接:https://github.com/WeirdTreeThing/chromebook-linux-audio
image.png

ubuntu也没有那个路径,安装正常

image.png

Reply Favorite View the author
All Replies
lin_lcs
deepin
2025-02-21 11:00
#1

你看看这个路径 /sys/firmware/devicetree/base/firmware/chromeos/hardware-id存不存在?他不是报错该路径不存在

Reply View the author
ㅤ旭旭哥
deepin
2025-02-21 11:05
#2
lin_lcs

你看看这个路径 /sys/firmware/devicetree/base/firmware/chromeos/hardware-id存不存在?他不是报错该路径不存在

不是这个原因 ,代码里面是两种架构:

def get_board():
if not args.board_name[0]:

#x86: Get the board name from dmi

if path_exists("/sys/devices/virtual/dmi/id/"):
with open("/sys/devices/virtual/dmi/id/product_name", "r") as dmi:
device_board = dmi.read()

#arm: Get board name from CrOS HWID

if path_exists("/sys/firmware/devicetree/base/"):
with open("/sys/firmware/devicetree/base/firmware/chromeos/hardware-id", "r") as hwid:
device_board = hwid.read().split(" ")[0].split("-")[0]
else: # use the board name from the args, for testing only
device_board = str(args.board_name[0])
print_warning(f"Board name override: {device_board}")
return device_board.lower().strip()

Reply View the author
lin_lcs
deepin
2025-02-21 13:08
#3
ㅤ旭旭哥

不是这个原因 ,代码里面是两种架构:

def get_board():
if not args.board_name[0]:

#x86: Get the board name from dmi

if path_exists("/sys/devices/virtual/dmi/id/"):
with open("/sys/devices/virtual/dmi/id/product_name", "r") as dmi:
device_board = dmi.read()

#arm: Get board name from CrOS HWID

if path_exists("/sys/firmware/devicetree/base/"):
with open("/sys/firmware/devicetree/base/firmware/chromeos/hardware-id", "r") as hwid:
device_board = hwid.read().split(" ")[0].split("-")[0]
else: # use the board name from the args, for testing only
device_board = str(args.board_name[0])
print_warning(f"Board name override: {device_board}")
return device_board.lower().strip()

源代码我也看了,我以为你是ARM架构的

def get_board():
    if not args.board_name[0]:
        # x86: Get the board name from dmi
        if path_exists("/sys/devices/virtual/dmi/id/"):
            with open("/sys/devices/virtual/dmi/id/product_name", "r") as dmi:
                device_board = dmi.read()
        # arm: Get board name from CrOS HWID
        if path_exists("/sys/firmware/devicetree/base/"):
            with open("/sys/firmware/devicetree/base/firmware/chromeos/hardware-id", "r") as hwid:
                device_board = hwid.read().split(" ")[0].split("-")[0]
    else:  # use the board name from the args, for testing only
        device_board = str(args.board_name[0])
        print_warning(f"Board name override: {device_board}")
    return device_board.lower().strip()

这个函数看起来是为了获得 borad name,通过判断 /sys/devices/virtual/dmi/id//sys/firmware/devicetree/base/这两个文件夹存在情况来确定从哪里获取这个 borad name

Ubuntu没报错可能是因为没有 /sys/firmware/devicetree/base/这个文件夹?从而不会去尝试打开 /sys/firmware/devicetree/base/firmware/chromeos/hardware-id这个文件。

一般来说arm才有设备树(devicetree)

比较冒险的做法就是注释报错的代码,像这样()

def get_board():
    if not args.board_name[0]:
        # x86: Get the board name from dmi
        if path_exists("/sys/devices/virtual/dmi/id/"):
            with open("/sys/devices/virtual/dmi/id/product_name", "r") as dmi:
                device_board = dmi.read()
        # arm: Get board name from CrOS HWID
        #if path_exists("/sys/firmware/devicetree/base/"):
        #    with open("/sys/firmware/devicetree/base/firmware/chromeos/hardware-id", "r") as hwid:
        #        device_board = hwid.read().split(" ")[0].split("-")[0]
    else:  # use the board name from the args, for testing only
        device_board = str(args.board_name[0])
        print_warning(f"Board name override: {device_board}")
    return device_board.lower().strip()

更新:

我问了一个用Ubuntu的朋友是没有 /sys/firmware/devicetree/这个文件夹,所以Ubuntu不会报错,那大概可能像上面注释掉就好了?

Reply View the author
ㅤ旭旭哥
deepin
2025-02-21 17:32
#4
lin_lcs

源代码我也看了,我以为你是ARM架构的

def get_board():
    if not args.board_name[0]:
        # x86: Get the board name from dmi
        if path_exists("/sys/devices/virtual/dmi/id/"):
            with open("/sys/devices/virtual/dmi/id/product_name", "r") as dmi:
                device_board = dmi.read()
        # arm: Get board name from CrOS HWID
        if path_exists("/sys/firmware/devicetree/base/"):
            with open("/sys/firmware/devicetree/base/firmware/chromeos/hardware-id", "r") as hwid:
                device_board = hwid.read().split(" ")[0].split("-")[0]
    else:  # use the board name from the args, for testing only
        device_board = str(args.board_name[0])
        print_warning(f"Board name override: {device_board}")
    return device_board.lower().strip()

这个函数看起来是为了获得 borad name,通过判断 /sys/devices/virtual/dmi/id//sys/firmware/devicetree/base/这两个文件夹存在情况来确定从哪里获取这个 borad name

Ubuntu没报错可能是因为没有 /sys/firmware/devicetree/base/这个文件夹?从而不会去尝试打开 /sys/firmware/devicetree/base/firmware/chromeos/hardware-id这个文件。

一般来说arm才有设备树(devicetree)

比较冒险的做法就是注释报错的代码,像这样()

def get_board():
    if not args.board_name[0]:
        # x86: Get the board name from dmi
        if path_exists("/sys/devices/virtual/dmi/id/"):
            with open("/sys/devices/virtual/dmi/id/product_name", "r") as dmi:
                device_board = dmi.read()
        # arm: Get board name from CrOS HWID
        #if path_exists("/sys/firmware/devicetree/base/"):
        #    with open("/sys/firmware/devicetree/base/firmware/chromeos/hardware-id", "r") as hwid:
        #        device_board = hwid.read().split(" ")[0].split("-")[0]
    else:  # use the board name from the args, for testing only
        device_board = str(args.board_name[0])
        print_warning(f"Board name override: {device_board}")
    return device_board.lower().strip()

更新:

我问了一个用Ubuntu的朋友是没有 /sys/firmware/devicetree/这个文件夹,所以Ubuntu不会报错,那大概可能像上面注释掉就好了?

膜拜大神,果然成功了,谢谢,太牛了!!!
image.png

Reply View the author