[SOLVED] Pisound stopped working (error code: -22)

It stayed healthy in my ongoing project

Summary

(I put pi/pisound/ a dsi display/ a DC power supply unit/cooling fans/… into an enclosure to build a multi fx pedal).

sorry for my unclear explanation but as a novice to this kind of DIY project, I am not 100% sure for what I am doing so I am at best describing what I have experienced.

but after a reboot it stopped working. before the moment, I was trying to solve some vnc problem (maybe unrelated software issue) and edited few lines in /boot/firmware/config.txt before reboot.

Then my lovely pisound dived into a coma.

miza@starry:~/pisound-firmware $ dmesg
[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x414fd0b1]
[    0.000000] Linux version 6.6.20+rpt-rpi-2712 (debian-kernel@lists.debian.org) (gcc-12 (Debian 12.2.0-14) 12.2.0, GNU ld (GNU Binutils for Debian) 2.40) #1 SMP PREEMPT Debian 1:6.6.20-1+rpt1 (2024-03-07)
[    0.000000] KASLR enabled
[    0.000000] random: crng init done
[    0.000000] Machine model: Raspberry Pi 5 Model B Rev 1.0
[    0.000000] efi: UEFI not found.
[    0.000000] Reserved memory: created CMA memory pool at 0x0000000002000000, size 320 MiB
...
[    2.926744] fuse: init (API version 7.39)
[    2.927774] systemd[1]: modprobe@loop.service: Deactivated successfully.
[    2.928118] systemd[1]: Finished modprobe@loop.service - Load Kernel Module loop.
[    2.928677] systemd[1]: modprobe@fuse.service: Deactivated successfully.
[    2.928816] systemd[1]: Finished modprobe@fuse.service - Load Kernel Module fuse.
[    2.930679] systemd[1]: Mounting sys-fs-fuse-connections.mount - FUSE Control File System...
[    2.933255] systemd[1]: Mounting sys-kernel-config.mount - Kernel Configuration File System...
[    2.933566] systemd[1]: systemd-repart.service - Repartition Root Disk was skipped because no trigger condition checks were met.
[    2.938276] systemd[1]: Mounted sys-kernel-config.mount - Kernel Configuration File System.
[    2.938659] systemd[1]: Mounted sys-fs-fuse-connections.mount - FUSE Control File System.
[    2.961451] EXT4-fs (mmcblk0p2): re-mounted 7de846e5-f05a-4a3e-a95b-cb4e344a1d8c r/w. Quota mode: none.
[    2.963691] systemd[1]: Finished systemd-remount-fs.service - Remount Root and Kernel File Systems.
[    2.964122] systemd[1]: systemd-firstboot.service - First Boot Wizard was skipped because of an unmet condition check (ConditionFirstBoot=yes).
[    2.964193] systemd[1]: systemd-pstore.service - Platform Persistent Storage Archival was skipped because of an unmet condition check (ConditionDirectoryNotEmpty=/sys/fs/pstore).
[    2.983093] i2c_dev: i2c /dev entries driver
[    2.998274] systemd[1]: Starting systemd-random-seed.service - Load/Save Random Seed...
[    3.000040] systemd[1]: Starting systemd-sysusers.service - Create System Users...
[    3.000471] systemd[1]: Started systemd-journald.service - Journal Service.
[    3.010274] systemd-journald[310]: Oldest entry in /run/log/journal/09d1d1189bce4122a1dc5b195b4b026e/system.journal is older than the configured file retention duration (1month), suggesting rotation.
[    3.010288] systemd-journald[310]: /run/log/journal/09d1d1189bce4122a1dc5b195b4b026e/system.journal: Journal header limits reached or header out-of-date, rotating.
[    3.051426] systemd-journald[310]: Received client request to flush runtime journal.
[    3.099792] systemd-journald[310]: File /var/log/journal/09d1d1189bce4122a1dc5b195b4b026e/system.journal corrupted or uncleanly shut down, renaming and replacing.
[    3.266783] systemd-journald[310]: Oldest entry in /var/log/journal/09d1d1189bce4122a1dc5b195b4b026e/system.journal is older than the configured file retention duration (1month), suggesting rotation.
[    3.266797] systemd-journald[310]: /var/log/journal/09d1d1189bce4122a1dc5b195b4b026e/system.journal: Journal header limits reached or header out-of-date, rotating.
[    3.395509] systemd-journald[310]: Failed to read journal file /var/log/journal/09d1d1189bce4122a1dc5b195b4b026e/user-1000.journal for rotation, trying to move it out of the way: Text file busy
[    4.085308] rpi-gpiomem 107d508500.gpiomem: window base 0x107d508500 size 0x00000040
[    4.085886] rpi-gpiomem 107d508500.gpiomem: initialised 1 regions as /dev/gpiomem1
[    4.101639] rpi-gpiomem 107d517c00.gpiomem: window base 0x107d517c00 size 0x00000040
[    4.101802] rpi-gpiomem 107d517c00.gpiomem: initialised 1 regions as /dev/gpiomem2
[    4.102402] rpi-gpiomem 107d504100.gpiomem: window base 0x107d504100 size 0x00000020
[    4.102548] rpi-gpiomem 107d504100.gpiomem: initialised 1 regions as /dev/gpiomem3
[    4.102893] rpi-gpiomem 107d510700.gpiomem: window base 0x107d510700 size 0x00000020
[    4.102975] rpi-gpiomem 107d510700.gpiomem: initialised 1 regions as /dev/gpiomem4
[    4.103402] rpi-gpiomem 1f000d0000.gpiomem: window base 0x1f000d0000 size 0x00030000
[    4.103491] rpi-gpiomem 1f000d0000.gpiomem: initialised 1 regions as /dev/gpiomem0
[    4.107405] mc: Linux media interface: v0.10
[    4.201231] videodev: Linux video capture interface: v2.00
[    4.232326] pisound: Using SPI speed: 100000
[    4.232333] pisound: Searching for spi device...
[    4.232339] pisound: 	Found!
[    4.273021] pispbe 1000880000.pisp_be: bcm2712_iommu_of_xlate: MMU 1000005100.iommu
[    4.273225] pispbe 1000880000.pisp_be: pispbe_probe: HW version:  0x02252700
[    4.273232] pispbe 1000880000.pisp_be: pispbe_probe: BatchStatus: 0x00000000
[    4.273236] pispbe 1000880000.pisp_be: pispbe_probe: Status:      0x00000000
[    4.273239] pispbe 1000880000.pisp_be: Register nodes for group 0
[    4.275819] pispbe 1000880000.pisp_be: input device node registered as /dev/video20
[    4.277902] pispbe 1000880000.pisp_be: tdn_input device node registered as /dev/video21
[    4.278095] pispbe 1000880000.pisp_be: stitch_input device node registered as /dev/video22
[    4.281656] pispbe 1000880000.pisp_be: hog_output device node registered as /dev/video23
[    4.282010] pispbe 1000880000.pisp_be: output0 device node registered as /dev/video24
[    4.286701] pispbe 1000880000.pisp_be: output1 device node registered as /dev/video25
[    4.288900] pispbe 1000880000.pisp_be: tdn_output device node registered as /dev/video26
[    4.289802] pispbe 1000880000.pisp_be: stitch_output device node registered as /dev/video27
[    4.290449] pispbe 1000880000.pisp_be: config device node registered as /dev/video28
[    4.306834] rpivid_hevc: module is from the staging directory, the quality is unknown, you have been warned.
[    4.311478] rpivid 1000800000.codec: bcm2712_iommu_of_xlate: MMU 1000005100.iommu
[    4.318390] pispbe 1000880000.pisp_be: Register nodes for group 1
[    4.318505] pispbe 1000880000.pisp_be: input device node registered as /dev/video29
[    4.318562] pispbe 1000880000.pisp_be: tdn_input device node registered as /dev/video30
[    4.322170] pispbe 1000880000.pisp_be: stitch_input device node registered as /dev/video31
[    4.351582] pispbe 1000880000.pisp_be: hog_output device node registered as /dev/video32
[    4.351610] rpivid 1000800000.codec: Device registered as /dev/video19
[    4.352522] pispbe 1000880000.pisp_be: output0 device node registered as /dev/video33
[    4.352581] pispbe 1000880000.pisp_be: output1 device node registered as /dev/video34
[    4.352618] pispbe 1000880000.pisp_be: tdn_output device node registered as /dev/video35
[    4.352661] pispbe 1000880000.pisp_be: stitch_output device node registered as /dev/video36
[    4.352699] pispbe 1000880000.pisp_be: config device node registered as /dev/video37
[    4.352960] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    4.360183] pisound: Reading card info failed: -22
[    4.360196] pisound: pisnd_spi_init failed: -22
[    4.360200] snd-rpi-pisound: probe of soc:sound failed with error -22
[    4.362340] Loaded X.509 cert 'benh@debian.org: 577e021cb980e0e820821ba7b54b4961b8b4fadf'
[    4.363255] Loaded X.509 cert 'romain.perier@gmail.com: 3abbc6ec146e09d1b6016ab9d6cf71dd233f0328'
[    4.363597] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    4.363941] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
[    4.398743] Bluetooth: Core ver 2.22
[    4.405970] NET: Registered PF_BLUETOOTH protocol family
[    4.405981] Bluetooth: HCI device and connection manager initialized
[    4.405989] Bluetooth: HCI socket layer initialized
[    4.405995] Bluetooth: L2CAP socket layer initialized
[    4.406003] Bluetooth: SCO socket layer initialized
[    4.468781] brcmfmac: F1 signature read @0x18000000=0x15264345
[    4.470286] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    4.481991] Bluetooth: HCI UART driver ver 2.3
[    4.482001] Bluetooth: HCI UART protocol H4 registered
[    4.482039] Bluetooth: HCI UART protocol Three-wire (H5) registered
[    4.482136] Bluetooth: HCI UART protocol Broadcom registered
[    4.482223] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
[    4.482281] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
[    4.503229] usbcore: registered new interface driver brcmfmac
[    4.519609] alsactl[495]: memfd_create() called without MFD_EXEC or MFD_NOEXEC_SEAL set
[    4.722840] brcmfmac_wcc: brcmf_wcc_attach: executing
[    4.731545] brcmfmac: brcmf_c_process_txcap_blob: no txcap_blob available (err=-2)
[    4.731881] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Apr 15 2021 03:03:20 version 7.45.234 (4ca95bb CY) FWID 01-996384e2
...

dmesg tells me SPI speed was tried by 100000 (on rpi 5) and 150000 (on rpi4) i didn’t see such speed messages from other users’ log and I don’t understand what it is and why they differs.

also, I found reflashing may be a cure for several -22 cases so i tried but only got

miza@starry:~/pisound-firmware $ ./flash.sh
avrdude: linuxspi_gpio_op_wr(): Unable to open file /sys/class/gpio/gpio24/directionavrdude: linuxspi_gpio_op_wr(): Unable to open file /sys/class/gpio/gpio24/direction
avrdude done.  Thank you.

modprobe: ERROR: ../libkmod/libkmod-module.c:856 kmod_module_remove_module() could not remove 'snd_rawmidi': Resource temporarily unavailable

Please reboot your system now (sudo reboot). Thank you!

come to think a bit, the midi in LED kept lit during operation before the sudden death and I thought it’s weird but someone on forum reported same behavior was for their MOD plugin generated midi signal, so i decided to not to care for the LED. but at this point, I think it might have been a sign of some issue was going on for its I/O perhapse?

Anyway, now midi in LED turns on during boot and it goes off at some point of booting precesses.

I tried pisound with two units (one is pi5 and the other is pi4). pi5 is possibly having damaged gpio because I have tinkered with this for project but still pisound and modep worked until last night.

pi4 is less likely damaged but does not recognise pisound too now.

both units are running the recent beta patchboxos (4-4-24).

advice me for anything I have to look into. thanks!

This is expected, the Pi 5 is using a different kind of CPU which works with Pisound at 100kHz better, it’s still a sufficient speed to accommodate all Pisound’s functionality :slight_smile:.

Was anything plugged in to the Pisound’s input? The input LED lights up either when receiving MIDI events, or when some visual output is triggered via /sys/kernel/pisound/led file (this is how various Pisound scripts give visual feedback).

If it went lit for an extended period of time, and it wasn’t due to above, as it is controlled by a tiny microcontroller on Pisound, it would mean something happened to it (or its supporting parts). It’s the tiny rectangular chip on the bottom side, very close to the 40 pin GPIO header, you should inspect whether there’s no physical damage or possibly missing parts (it’s possible to accidentally ‘scratch off’ some capacitors or other parts), inspect the area directly on top of the board as well, if there’s any missing or damaged parts or traces.

The error indicated in the kernel log means that the Raspberry Pi fails to communicate with that chip on Pisound via SPI, there can be many causes, most of them physical, but trying to reflash the firmware might help. At the moment this must be done with OS releases based on either buster or bullseye and Pi 4 or earlier, as described here:

This is due to the changed GPIO pin numbering on latest Raspberry Pi OS release, the script hasn’t been ported just yet.

Let us know what sort of outptus you get from the flashing scripts, you may have to give it multiple tries.

As your instruction I carefully inspected the area and Bingo! I found sludge of rosin flux is stuck between legs of an IC. (the most square one near the extra pin hole) It must be from when I soldered pin headers for my build.

I gently scraped with alcohol cotton swap thoroughly and now pisound is detected and works as before. Thank you for detailed explanation and it saved my day. :star_struck:

1 Like