How to properly install alsa sound driver
I downloaded realek sound driver from to compile and install. When I did make the compile failed with
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' failedI still did sudo make install anyways, now I can't hear or record sound anymore. What do I do?
2 Answers
In reverse order, sudo make install following a failed make has nothing to install.
Then, it seems that what you downloaded is not compatible with the kernel source you have installed. The downloaded source wants to refer to a wait_queue_t structure, which is no longer used. Some familiar with the source could rewrite it to use the suggested wait_event structure.
Complaints should probably be directed to realtek.
A driver written in 2014 for Linux 3.0 is not compatible with current kernels.
To revert the effects of make install, try make uninstall.
The sound drivers are part of the kernel. If you want to update them, you have to update the kernel package.
2