From 138d22226ed2b36a94d74873f8f1ac3193ee944f Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Fri, 4 Sep 2020 20:22:17 +0100 Subject: [PATCH 1/3] temporary work-around for not being able to read sysclk from dts for ac10x The "sysclk = 24000000" value is supposed to come from the "clock-frequency" field of ac108_mclk / ac10x_mclk, but somehow it isn't on 5.4 (vs 4.19). This is a temporary work-around. For some strange unknown reasons, this affects only the square 4-mic device, but not the linear 4-mic nor the 6-mics device. The other two devices have two ac108's, and seem to work fine without it. In v4.19: seeed_voice_card_probe [snd_soc_seeed_voicecard] -> devm_snd_soc_register_card [snd_soc_core] -> snd_soc_register_card [snd_soc_core] -> seeed_voice_card_dai_init [snd_soc_seeed_voicecard] -> asoc_simple_card_init_dai [snd_soc_simple_card_utils] -> snd_soc_dai_set_sysclk [snd_soc_core] -> ac108_set_sysclk [snd_soc_ac108] In 5.4: seeed_voice_card_probe [snd_soc_seeed_voicecard] -> devm_snd_soc_register_card [snd_soc_core] -> snd_soc_register_card [snd_soc_core] -> snd_soc_instantiate_card [snd_soc_core] -> seeed_voice_card_dai_init [snd_soc_seeed_voicecard] -> asoc_simple_init_dai.part.0 [snd_soc_seeed_voicecard] -> snd_soc_dai_set_sysclk [snd_soc_core] -> ac108_set_sysclk [snd_soc_ac108] Which results in the "ac108_set_sysclk :24000000" kernel message. Note the extra snd_soc_instantiate_card(), and the copied/renamed asoc_simple_init_dai() - it became static and not-available to other drivers in v5.x. See https://github.com/respeaker/seeed-voicecard/issues/246 --- seeed-voicecard.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/seeed-voicecard.c b/seeed-voicecard.c index 1ed9a0e..aceb7b9 100644 --- a/seeed-voicecard.c +++ b/seeed-voicecard.c @@ -457,6 +457,8 @@ static int seeed_voice_card_dai_link_of(struct device_node *node, #else ret = asoc_simple_parse_clk_codec(dev, codec, dai_link, codec_dai); #endif + if (!strncmp(dai_link->codecs->dai_name, "ac10", 4)) + codec_dai->sysclk = 24000000; if (ret < 0) goto dai_link_of_err; From e26006d40c9d97a654edc3035c0ca6399185536b Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Fri, 4 Sep 2020 06:37:57 +0100 Subject: [PATCH 2/3] Add reference to Ubuntu kernel package names Signed-off-by: Hin-Tak Leung --- install.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install.sh b/install.sh index 2665d29..c9fca53 100755 --- a/install.sh +++ b/install.sh @@ -100,7 +100,10 @@ function check_kernel_headers() { which apt &>/dev/null if [[ $? -eq 0 ]]; then apt update -y + # Raspbian kernel packages apt-get -y install raspberrypi-kernel-headers raspberrypi-kernel + # Ubuntu kernel packages + apt-get -y install linux-raspi linux-headers-raspi linux-image-raspi apt-get -y install dkms git i2c-tools libasound2-plugins # rpi-update checker check_kernel_headers From f2b2516426878ec1aaccc3cf9c5e1858a71e1ac8 Mon Sep 17 00:00:00 2001 From: Hin-Tak Leung Date: Fri, 4 Sep 2020 06:26:13 +0000 Subject: [PATCH 3/3] update check_kernel_headers() for Ubuntu header packages --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index c9fca53..1d8370b 100755 --- a/install.sh +++ b/install.sh @@ -80,6 +80,10 @@ function check_kernel_headers() { [ "X$VER_RUN" == "X$VER_HDR" ] && { return 0 } + VER_HDR=$(dpkg -L linux-headers-$VER_RUN | egrep -m1 "/lib/modules/[[:print:]]+/build" | awk -F'/' '{ print $4; }') + [ "X$VER_RUN" == "X$VER_HDR" ] && { + return 0 + } # echo RUN=$VER_RUN HDR=$VER_HDR echo " !!! Your kernel version is $VER_RUN"