waveshare / WM8960-Audio-HAT

The drivers of [WM8960 Audio HAT] for Raspberry Pi
GNU General Public License v3.0
100 stars 65 forks source link

install fails on patchos due to systemd-modules-load "Failed to insert module 'snd_soc_wm8960_soundcard': Device or resource busy" but somehow rebooting and running sudo ./install.sh again got it working #34

Open ericfont opened 3 years ago

ericfont commented 3 years ago

running patchbox image https://community.blokas.io/t/beta-patchbox-os-image-2020-11-23/2433 on RPi4. uname -a returns:

uname -a Linux patchbox 5.10.17-v7l+ #1421 SMP Thu May 27 14:00:13 BST 2021 armv7l GNU/Linux

What follows below is the output of the 2nd attempt at installing. After my first attempt installing, there was no "wm8960soundcard" device in aplay -l.

So on my second attempt installing I looked at the output...and noticed the errors "Job for systemd-modules-load.service failed because the control process exited with error code" and "Job for wm8960-soundcard.service failed because the control process exited with error code"

patch@patchbox:~/WM8960-Audio-HAT $ sudo ./install.sh 
Hit:1 http://archive.raspberrypi.org/debian buster InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian buster InRelease
Hit:3 http://apt.blokas.io rpi InRelease              
Reading package lists... Done                 
Building dependency tree       
Reading state information... Done
183 packages can be upgraded. Run 'apt list --upgradable' to see them.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
raspberrypi-kernel is already the newest version (1:1.20210527-1).
raspberrypi-kernel-headers is already the newest version (1:1.20210527-1).
0 upgraded, 0 newly installed, 0 to remove and 183 not upgraded.
Reading package lists... Done
Building dependency tree       
Reading state information... Done
dkms is already the newest version (2.6.1-4).
git is already the newest version (1:2.20.1-2+deb10u3).
i2c-tools is already the newest version (4.1-1).
libasound2-plugins is already the newest version (1.1.8-1).
0 upgraded, 0 newly installed, 0 to remove and 183 not upgraded.

------------------------------
Deleting module version: 1.0
completely from the DKMS tree.
------------------------------
Done.

Creating symlink /var/lib/dkms/wm8960-soundcard/1.0/source ->
                 /usr/src/wm8960-soundcard-1.0

DKMS: add completed.

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.10.17-v7l+ -C /lib/modules/5.10.17-v7l+/build M=/var/lib/dkms/wm8960-soundcard/1.0/build....
cleaning build area...

DKMS: build completed.

snd-soc-wm8960.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.17-v7l+/kernel/sound/soc/codecs/

snd-soc-wm8960-soundcard.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.17-v7l+/kernel/sound/soc/bcm/

depmod...
Job for systemd-modules-load.service failed because the control process exited with error code.
See "systemctl status systemd-modules-load.service" and "journalctl -xe" for details.

DKMS: install completed.
mkdir: cannot create directory ‘/etc/wm8960-soundcard’: File exists
Job for wm8960-soundcard.service failed because the control process exited with error code.
See "systemctl status wm8960-soundcard.service" and "journalctl -xe" for details.
------------------------------------------------------
Please reboot your raspberry pi to apply all settings
Enjoy!
------------------------------------------------------

running systemctl status systemd-modules-load.service reports:

● systemd-modules-load.service - Load Kernel Modules
   Loaded: loaded (/lib/systemd/system/systemd-modules-load.service; static; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2021-06-15 16:29:59 EDT; 3min 51s ago
     Docs: man:systemd-modules-load.service(8)
           man:modules-load.d(5)
 Main PID: 2666 (code=exited, status=1/FAILURE)

Jun 15 16:29:59 patchbox systemd[1]: Starting Load Kernel Modules...
Jun 15 16:29:59 patchbox systemd-modules-load[2666]: Failed to insert module 'snd_soc_wm8960_soundcard': Device or resource busy
Jun 15 16:29:59 patchbox systemd[1]: systemd-modules-load.service: Main process exited, code=exited, status=1/FAILURE
Jun 15 16:29:59 patchbox systemd[1]: systemd-modules-load.service: Failed with result 'exit-code'.
Jun 15 16:29:59 patchbox systemd[1]: Failed to start Load Kernel Modules.

and running systemctl status wm8960-soundcard.service reports:

● wm8960-soundcard.service - WM8960 soundcard service
   Loaded: loaded (/lib/systemd/system/wm8960-soundcard.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2021-06-15 16:30:03 EDT; 4min 24s ago
  Process: 2699 ExecStart=/usr/bin/wm8960-soundcard (code=exited, status=99)
 Main PID: 2699 (code=exited, status=99)

Jun 15 16:30:00 patchbox su[2723]: pam_unix(su:session): session closed for user patch
Jun 15 16:30:01 patchbox su[2743]: (to patch) root on none
Jun 15 16:30:01 patchbox su[2743]: pam_unix(su:session): session opened for user patch by (uid=0)
Jun 15 16:30:01 patchbox su[2743]: pam_unix(su:session): session closed for user patch
Jun 15 16:30:02 patchbox su[2754]: (to patch) root on none
Jun 15 16:30:02 patchbox su[2754]: pam_unix(su:session): session opened for user patch by (uid=0)
Jun 15 16:30:02 patchbox su[2754]: pam_unix(su:session): session closed for user patch
Jun 15 16:30:03 patchbox systemd[1]: wm8960-soundcard.service: Main process exited, code=exited, status=99/n/a
Jun 15 16:30:03 patchbox systemd[1]: wm8960-soundcard.service: Failed with result 'exit-code'.
Jun 15 16:30:03 patchbox systemd[1]: Failed to start WM8960 soundcard service.

and journalctl -xe reports:

-- Support: https://www.debian.org/support
-- 
-- A stop job for unit pisound-ctl.service has finished.
-- 
-- The job identifier is 5809 and the job result is done.
Jun 15 16:34:47 patchbox systemd[1]: Started Bluetooth service for Pisound companion app..
-- Subject: A start job for unit pisound-ctl.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit pisound-ctl.service has finished successfully.
-- 
-- The job identifier is 5809.
Jun 15 16:34:47 patchbox pisound-ctl[3456]: Reading Pisound version failed, did the kernel module load successfully?
Jun 15 16:34:47 patchbox pisound-ctl[3456]: [3456] main: Pisound Control Server 1.03 starting...
Jun 15 16:34:47 patchbox systemd[1]: pisound-ctl.service: Main process exited, code=exited, status=234/n/a
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit pisound-ctl.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 234.
Jun 15 16:34:47 patchbox systemd[1]: pisound-ctl.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit pisound-ctl.service has entered the 'failed' state with result 'exit-code'.
Jun 15 16:34:48 patchbox pisound-btn[425]: 2021-06-15.16:34:48: Blink.
Jun 15 16:34:49 patchbox pisound-btn[425]: 2021-06-15.16:34:49: Blink.
Jun 15 16:34:50 patchbox pisound-btn[425]: 2021-06-15.16:34:50: Blink.
Jun 15 16:34:51 patchbox pisound-btn[425]: 2021-06-15.16:34:51: Blink.
Jun 15 16:34:52 patchbox pisound-btn[425]: 2021-06-15.16:34:52: Blink.
Jun 15 16:34:53 patchbox pisound-btn[425]: 2021-06-15.16:34:53: Blink.
Jun 15 16:34:53 patchbox systemd[1]: pisound-ctl.service: Service RestartSec=5s expired, scheduling restart.
Jun 15 16:34:53 patchbox systemd[1]: pisound-ctl.service: Scheduled restart job, restart counter is at 71.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Automatic restarting of the unit pisound-ctl.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jun 15 16:34:53 patchbox systemd[1]: Stopped Bluetooth service for Pisound companion app..
-- Subject: A stop job for unit pisound-ctl.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A stop job for unit pisound-ctl.service has finished.
-- 
-- The job identifier is 5870 and the job result is done.
Jun 15 16:34:53 patchbox systemd[1]: Started Bluetooth service for Pisound companion app..
-- Subject: A start job for unit pisound-ctl.service has finished successfully
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- A start job for unit pisound-ctl.service has finished successfully.
-- 
-- The job identifier is 5870.
Jun 15 16:34:53 patchbox pisound-ctl[3469]: Reading Pisound version failed, did the kernel module load successfully?
Jun 15 16:34:53 patchbox pisound-ctl[3469]: [3469] main: Pisound Control Server 1.03 starting...
Jun 15 16:34:53 patchbox systemd[1]: pisound-ctl.service: Main process exited, code=exited, status=234/n/a
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- An ExecStart= process belonging to unit pisound-ctl.service has exited.
-- 
-- The process' exit code is 'exited' and its exit status is 234.
Jun 15 16:34:53 patchbox systemd[1]: pisound-ctl.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- The unit pisound-ctl.service has entered the 'failed' state with result 'exit-code'.

And as this is my second time, fortunately aplay -l does report the device is available at this point...:

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 4/4
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
card 3: wm8960soundcard [wm8960-soundcard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 [bcm2835-i2s-wm8960-hifi wm8960-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And upon reboot, the wm8960soundcard alsa device is still available.

So I don't know what exactly the problem is or if there is really one, but at least it works, but it seems something is slightly off.

naeldavid commented 1 year ago

Have you tried setting the wm8960soundcard as main audio output ? sudo rasp-config then system options ; audio ; and then choose the wm8960soundcard. Did it work ?