HinTak / seeed-voicecard

This is an enhancement fork with the explicit aim of supporting current shipping Raspbian/Ubuntu kernels without requiring downgrading. Please donate at https://hintak.github.io/ if it works for you. Use vX.Y branch for kernel version vX.Y
GNU General Public License v3.0
196 stars 73 forks source link

Kernel Panic trying to test with arecord #22

Open belzedaar opened 9 months ago

belzedaar commented 9 months ago

I am using the Seeed Respeaker 4 mic hat: https://files.seeedstudio.com/wiki/ReSpeaker-4-Mic-Array-for-Raspberry-Pi/img/connect2.jpg

The SD card died in my Pi3b voice assistant so I thought I'd try and upgrade it to a Pi4 I was using elsewhere.

Flash latest official Pi Lite version to SD card:

Linux vision 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

git clone https://github.com/HinTak/seeed-voicecard.git

The default branch is v6.1 so good to go there.

sudo ./install.sh and reboot

After reboot: arecord -L

hw:CARD=seeed4micvoicec,DEV=0
    seeed-4mic-voicecard, bcm2835-i2s-ac10x-codec0 ac10x-codec0-0
    Direct hardware device without any conversions

Try and record as per the instructions on the wiki:

arecord -Dac108 -f S32_LE -r 16000 -c 4 hello.wav

Kernel Panic when pressing Ctrl+C to stop recording 20231228_150718 Seems to be 100% repro rate

I tried using the linked (super old) version of Buster with the drivers pre-installed (https://files.seeedstudio.com/linux/Raspberry%20Pi%204%20reSpeaker/2021-05-07-raspios-buster-armhf-lite-respeaker.img.xz)

That works correctly and I can record, sox to stereo and playback via headphones as expected, so it's not a hardware issue with the hat.

I tried using 32 bit instead of 64 bit, bit that doesn't seem to install correctly, cannot get card index for seeed4micvoicec when trying to record. I also tried 64 bit full desktop RPi image in case somehow that was using a different kernel, but no luck there.

It seems lots of people are working OK with 6.1 kernels from various forums around the place, so I am really not sure what is going wrong in my case. (I did also try the hat on the PI3b with latest Pi OS and that also failed, so it's not specific to the 4)

Any help would be greatly appreciated (via donation!)

rknobbe commented 9 months ago

Same issue here. Dmesg shows this:


[Mon Jan  1 16:28:18 2024] BUG: scheduling while atomic: arecord/1875/0x00000000
[Mon Jan  1 16:28:18 2024] Modules linked in: xt_nat xt_tcpudp veth xt_conntrack nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack_netlink nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 xfrm_user xfrm_algo xt_addrtype nft_compat nf_tables nfnetlink br_netfilter bridge stp llc cmac algif_hash aes_arm64 aes_generic algif_skcipher af_alg bnep snd_soc_bcm2835_i2s i2c_bcm2835 i2c_dev overlay vc4 hci_uart btbcm bluetooth brcmfmac snd_usb_audio v3d gpu_sched joydev snd_soc_hdmi_codec rpivid_hevc(C) brcmutil bcm2835_isp(C) bcm2835_v4l2(C) drm_shmem_helper bcm2835_codec(C) snd_hwdep v4l2_mem2mem bcm2835_mmal_vchiq(C) videobuf2_vmalloc videobuf2_dma_contig drm_display_helper cec videobuf2_memops cfg80211 raspberrypi_hwmon drm_dma_helper videobuf2_v4l2 snd_usbmidi_lib ecdh_generic videobuf2_common snd_rawmidi ecc videodev snd_seq_device binfmt_misc libaes rfkill snd_bcm2835(C) drm_kms_helper vc_sm_cma(C) fb_sys_fops syscopyarea mc raspberrypi_gpiomem sysfillrect sysimgblt nvmem_rmem uio_pdrv_genirq uio
[Mon Jan  1 16:28:18 2024]  snd_soc_wm8960(O) drm snd_soc_ac108(O) regmap_i2c snd_soc_seeed_voicecard(O) snd_soc_simple_card_utils snd_soc_core snd_compress snd_pcm_dmaengine snd_pcm snd_timer fuse snd drm_panel_orientation_quirks backlight dm_mod ip_tables x_tables ipv6 spidev i2c_brcmstb spi_bcm2835
[Mon Jan  1 16:28:18 2024] CPU: 1 PID: 1875 Comm: arecord Tainted: G        WC O       6.1.0-rpi7-rpi-v8 #1  Debian 1:6.1.63-1+rpt1
[Mon Jan  1 16:28:18 2024] Hardware name: Raspberry Pi 4 Model B Rev 1.2 (DT)
[Mon Jan  1 16:28:18 2024] Call trace:
[Mon Jan  1 16:28:18 2024]  dump_backtrace.part.0+0xec/0x100
[Mon Jan  1 16:28:18 2024]  show_stack+0x20/0x30
[Mon Jan  1 16:28:18 2024]  dump_stack_lvl+0x88/0xb4
[Mon Jan  1 16:28:18 2024]  dump_stack+0x18/0x34
[Mon Jan  1 16:28:18 2024]  __schedule_bug+0x5c/0x74
[Mon Jan  1 16:28:18 2024]  __schedule+0x80c/0x924
[Mon Jan  1 16:28:18 2024]  schedule+0x64/0x10c
[Mon Jan  1 16:28:18 2024]  schedule_timeout+0xa4/0x1c0
[Mon Jan  1 16:28:18 2024]  __snd_pcm_lib_xfer+0x378/0x830 [snd_pcm]
[Mon Jan  1 16:28:18 2024]  snd_pcm_common_ioctl+0x10f8/0x1790 [snd_pcm]
[Mon Jan  1 16:28:18 2024]  snd_pcm_ioctl+0x38/0x50 [snd_pcm]
[Mon Jan  1 16:28:18 2024]  __arm64_sys_ioctl+0xb4/0xfc
[Mon Jan  1 16:28:18 2024]  invoke_syscall+0x50/0x120
[Mon Jan  1 16:28:18 2024]  el0_svc_common.constprop.0+0x68/0x124
[Mon Jan  1 16:28:18 2024]  do_el0_svc+0x34/0xd0
[Mon Jan  1 16:28:18 2024]  el0_svc+0x30/0x94
[Mon Jan  1 16:28:18 2024]  el0t_64_sync_handler+0xf4/0x120
[Mon Jan  1 16:28:18 2024]  el0t_64_sync+0x18c/0x190
[Mon Jan  1 16:28:25 2024] bcm2835-i2s fe203000.i2s: I2S SYNC error!
Weaverzhu commented 8 months ago

same here

removing -Dac108 seems to solve the problem for arecord, but a lot of other functions will still cause the kernel panic (e.g. pyaudio)

nahuelproietto commented 6 months ago

same issue... I'm using kernel 5.15.0-1049-raspi with ubuntu-22.04 server arm64 (raspberry pi 4 model B)