我从下载了 realek 声音驱动程序http://www.realtek.com.tw/downloads/downloadsview.aspx编译并安装。当我这样做时,make
编译失败,并显示
make[1]: Entering directory '/usr/src/linux-headers-4.15.0-24-generic'
CC [M] /home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.o
/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.c: In function ‘snd_power_wait’:
/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.c:1002:2: error: unknown type name ‘wait_queue_t’; did you mean ‘wait_event’?
wait_queue_t wait;
^~~~~~~~~~~~
wait_event
/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.c:1008:23: error: passing argument 1 of ‘init_waitqueue_entry’ from incompatible pointer type [-Werror=incompatible-pointer-types]
init_waitqueue_entry(&wait, current);
^
In file included from ./include/linux/mmzone.h:10:0,
from ./include/linux/gfp.h:6,
from ./include/linux/umh.h:4,
from ./include/linux/kmod.h:22,
from ./include/linux/module.h:13,
from /home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/include/adriver.h:50,
from /home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.c:2:
./include/linux/wait.h:79:20: note: expected ‘struct wait_queue_entry *’ but argument is of type ‘int *’
static inline void init_waitqueue_entry(struct wait_queue_entry *wq_entry, struct task_struct *p)
^~~~~~~~~~~~~~~~~~~~
/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.c:1009:37: error: passing argument 2 of ‘add_wait_queue’ from incompatible pointer type [-Werror=incompatible-pointer-types]
add_wait_queue(&card->power_sleep, &wait);
^
In file included from ./include/linux/mmzone.h:10:0,
from ./include/linux/gfp.h:6,
from ./include/linux/umh.h:4,
from ./include/linux/kmod.h:22,
from ./include/linux/module.h:13,
from /home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/include/adriver.h:50,
from /home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.c:2:
./include/linux/wait.h:150:13: note: expected ‘struct wait_queue_entry *’ but argument is of type ‘int *’
extern void add_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);
^~~~~~~~~~~~~~
/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.c:1022:40: error: passing argument 2 of ‘remove_wait_queue’ from incompatible pointer type [-Werror=incompatible-pointer-types]
remove_wait_queue(&card->power_sleep, &wait);
^
In file included from ./include/linux/mmzone.h:10:0,
from ./include/linux/gfp.h:6,
from ./include/linux/umh.h:4,
from ./include/linux/kmod.h:22,
from ./include/linux/module.h:13,
from /home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/include/adriver.h:50,
from /home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.c:2:
./include/linux/wait.h:152:13: note: expected ‘struct wait_queue_entry *’ but argument is of type ‘int *’
extern void remove_wait_queue(struct wait_queue_head *wq_head, struct wait_queue_entry *wq_entry);
^~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:332: recipe for target '/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.o' failed
make[3]: *** [/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore/init.o] Error 1
scripts/Makefile.build:606: recipe for target '/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore' failed
make[2]: *** [/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa/acore] Error 2
Makefile:1552: recipe for target '_module_/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa' failed
make[1]: *** [_module_/home/user/Downloads/0001-LinuxPkg_5.18rc8/Rt-Linux-HDaudio-5.18/alsa-driver-RTv5.18rc8/alsa-driver-RTv5.18/alsa] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.15.0-24-generic'
Makefile:167: recipe for target 'compile' failed
无论如何,我还是这样做了sudo make install
,但现在我听不到声音,也录不到声音了。我该怎么办?
答案1
按照相反的顺序,sudo make install
失败后就make
没有什么可安装的了。
然后,您下载的内容似乎与您安装的内核源代码不兼容。下载的源代码想要引用一个wait_queue_t
不再使用的结构。熟悉源代码的人可以重写它以使用建议的wait_event
结构。
投诉可能应该直接向 realtek 提出。
答案2
2014 年为 Linux 3.0 编写的驱动程序与当前内核不兼容。
要恢复的效果make install
,请尝试make uninstall
。
声卡驱动是内核的一部分,如果要更新声卡驱动,需要更新内核包。