Compare commits
37 commits
v6.6-order
...
v4.19
Author | SHA1 | Date | |
---|---|---|---|
|
dd94d86a09 | ||
|
267152505b | ||
|
28b9319379 | ||
|
71321134f6 | ||
|
796adb3f08 | ||
|
c236752f91 | ||
|
85160dac38 | ||
|
d9fdfac988 | ||
|
5c311c4031 | ||
|
0248378f7f | ||
|
fc77a4c00a | ||
|
7e4917be89 | ||
|
f512fe32bd | ||
|
99b29b06c1 | ||
|
37cd69fc1a | ||
|
408f71d2f4 | ||
|
cddfe7b15e | ||
|
f4cb786a5b | ||
|
115186c53c | ||
|
4e29eb8f51 | ||
|
de0e478df4 | ||
|
f716cece88 | ||
|
7958dd2076 | ||
|
64a207940f | ||
|
35bc08973c | ||
|
bafb3c85aa | ||
|
556ed21066 | ||
|
f4cc5722d0 | ||
|
49f1135da8 | ||
|
6244e5d618 | ||
|
5ce09f2095 | ||
|
140a220946 | ||
|
31bea0c3be | ||
|
b80f7bc89b | ||
|
6f03b0df86 | ||
|
26cfab95cf | ||
|
8497972d65 |
15 changed files with 167 additions and 78 deletions
17
ac101.c
17
ac101.c
|
@ -376,7 +376,7 @@ static int ac101_switch_probe(struct ac10x_priv *ac10x) {
|
|||
|
||||
ac10x->irq = gpiod_to_irq(ac10x->gpiod_irq);
|
||||
if (IS_ERR_VALUE(ac10x->irq)) {
|
||||
pr_info("[ac101] map gpio to irq failed, errno = %ld\n", ac10x->irq);
|
||||
pr_warn("[ac101] map gpio to irq failed, errno = %ld\n", ac10x->irq);
|
||||
ac10x->irq = 0;
|
||||
goto _err_irq;
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ static int ac101_switch_probe(struct ac10x_priv *ac10x) {
|
|||
/* request irq, set irq type to falling edge trigger */
|
||||
ret = devm_request_irq(ac10x->codec->dev, ac10x->irq, audio_hmic_irq, IRQF_TRIGGER_FALLING, "SWTICH_EINT", ac10x);
|
||||
if (IS_ERR_VALUE(ret)) {
|
||||
pr_info("[ac101] request virq %ld failed, errno = %ld\n", ac10x->irq, ret);
|
||||
pr_warn("[ac101] request virq %ld failed, errno = %ld\n", ac10x->irq, ret);
|
||||
goto _err_irq;
|
||||
}
|
||||
|
||||
|
@ -782,8 +782,8 @@ static struct snd_kcontrol_new ac101_controls[] = {
|
|||
SOC_DOUBLE_TLV("DAC volume", DAC_VOL_CTRL, DAC_VOL_L, DAC_VOL_R, 0xff, 0, dac_vol_tlv),
|
||||
SOC_DOUBLE_TLV("DAC mixer gain", DAC_MXR_GAIN, DACL_MXR_GAIN, DACR_MXR_GAIN, 0xf, 0, dac_mix_vol_tlv),
|
||||
SOC_SINGLE_TLV("digital volume", DAC_DBG_CTRL, DVC, 0x3f, 1, dig_vol_tlv),
|
||||
SOC_SINGLE_TLV("speaker volume", SPKOUT_CTRL, SPK_VOL, 0x1f, 0, speaker_vol_tlv),
|
||||
SOC_SINGLE_TLV("headphone volume", HPOUT_CTRL, HP_VOL, 0x3f, 0, headphone_vol_tlv),
|
||||
SOC_SINGLE_TLV("Speaker Playback Volume", SPKOUT_CTRL, SPK_VOL, 0x1f, 0, speaker_vol_tlv),
|
||||
SOC_SINGLE_TLV("Headphone Playback Volume", HPOUT_CTRL, HP_VOL, 0x3f, 0, headphone_vol_tlv),
|
||||
};
|
||||
|
||||
/* PLL divisors */
|
||||
|
@ -1152,14 +1152,14 @@ int ac101_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
|
|||
switch(fmt & SND_SOC_DAIFMT_MASTER_MASK) {
|
||||
case SND_SOC_DAIFMT_CBM_CFM: /* codec clk & frm master, ap is slave*/
|
||||
#if _MASTER_MULTI_CODEC == _MASTER_AC101
|
||||
pr_warn("AC101 as Master\n");
|
||||
pr_info("AC101 as Master\n");
|
||||
reg_val |= (0x0<<AIF1_MSTR_MOD);
|
||||
break;
|
||||
#else
|
||||
pr_warn("AC108 as Master\n");
|
||||
pr_info("AC108 as Master\n");
|
||||
#endif
|
||||
case SND_SOC_DAIFMT_CBS_CFS: /* codec clk & frm slave, ap is master*/
|
||||
pr_warn("AC101 as Slave\n");
|
||||
pr_info("AC101 as Slave\n");
|
||||
reg_val |= (0x1<<AIF1_MSTR_MOD);
|
||||
break;
|
||||
default:
|
||||
|
@ -1286,6 +1286,9 @@ int ac101_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
default:
|
||||
ret = -EINVAL;
|
||||
}
|
||||
AC101_DBG("stream=%s cmd=%d;finished %d\n",
|
||||
snd_pcm_stream_str(substream),
|
||||
cmd, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
11
ac108.c
11
ac108.c
|
@ -865,6 +865,7 @@ static int ac108_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) {
|
|||
/* TODO: Both cpu_dai and codec_dai(AC108) be set as slave in DTS */
|
||||
dev_dbg(dai->dev, "used as slave when AC101 is master\n");
|
||||
}
|
||||
fallthrough;
|
||||
case SND_SOC_DAIFMT_CBS_CFS: /*AC108 Slave*/
|
||||
dev_dbg(dai->dev, "AC108 set to work as Slave\n");
|
||||
/**
|
||||
|
@ -1087,6 +1088,10 @@ static int ac108_trigger(struct snd_pcm_substream *substream, int cmd,
|
|||
__ret:
|
||||
spin_unlock_irqrestore(&ac10x->lock, flags);
|
||||
|
||||
dev_dbg(dai->dev, "%s() stream=%s cmd=%d; finished %d\n",
|
||||
__FUNCTION__,
|
||||
snd_pcm_stream_str(substream),
|
||||
cmd, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1435,8 +1440,8 @@ static int ac108_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *i
|
|||
if (of_property_read_u32(np, "tdm-chips-count", &val)) val = 1;
|
||||
ac10x->tdm_chips_cnt = val;
|
||||
|
||||
pr_err(" ac10x i2c_id number: %d\n", index);
|
||||
pr_err(" ac10x data protocol: %d\n", ac10x->data_protocol);
|
||||
pr_info(" ac10x i2c_id number: %d\n", index);
|
||||
pr_info(" ac10x data protocol: %d\n", ac10x->data_protocol);
|
||||
|
||||
ac10x->i2c[index] = i2c;
|
||||
ac10x->i2cmap[index] = devm_regmap_init_i2c(i2c, &ac108_regmap);
|
||||
|
@ -1458,7 +1463,7 @@ static int ac108_i2c_probe(struct i2c_client *i2c, const struct i2c_device_id *i
|
|||
ac10x_fill_regcache(&i2c->dev, ac10x->i2cmap[index]);
|
||||
|
||||
ac10x->codec_cnt++;
|
||||
pr_err(" ac10x codec count : %d\n", ac10x->codec_cnt);
|
||||
pr_info(" ac10x codec count : %d\n", ac10x->codec_cnt);
|
||||
|
||||
ret = sysfs_create_group(&i2c->dev.kobj, &ac108_debug_attr_group);
|
||||
if (ret) {
|
||||
|
|
|
@ -338,7 +338,7 @@ state.seeed8micvoicec {
|
|||
}
|
||||
control.20 {
|
||||
iface MIXER
|
||||
name 'speaker volume'
|
||||
name 'Speaker Playback Volume'
|
||||
value 25
|
||||
comment {
|
||||
access 'read write'
|
||||
|
@ -352,7 +352,7 @@ state.seeed8micvoicec {
|
|||
}
|
||||
control.21 {
|
||||
iface MIXER
|
||||
name 'headphone volume'
|
||||
name 'Headphone Playback Volume'
|
||||
value 52
|
||||
comment {
|
||||
access 'read write'
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#!/bin/sh
|
||||
#dtoverlay -r seeed-2mic-voicecard
|
||||
DTC_FLAGS="-b 0 -Wno-unit_address_vs_reg -I dts -O dtb"
|
||||
|
||||
|
|
86
install.sh
86
install.sh
|
@ -1,7 +1,5 @@
|
|||
#!/bin/bash
|
||||
|
||||
FORCE_KERNEL="1.20190925+1-1"
|
||||
|
||||
if [[ $EUID -ne 0 ]]; then
|
||||
echo "This script must be run as root (use sudo)" 1>&2
|
||||
exit 1
|
||||
|
@ -33,14 +31,22 @@ fi
|
|||
# - check for /boot/overlays
|
||||
# - dtparam and dtoverlay is available
|
||||
errorFound=0
|
||||
if [ ! -d /boot/overlays ] ; then
|
||||
echo "/boot/overlays not found or not a directory" 1>&2
|
||||
|
||||
# Try Raspbian, Ubuntu, then LibreELEC location for OVERLAYS:
|
||||
OVERLAYS=/boot/overlays
|
||||
[ -d /boot/firmware/overlays ] && OVERLAYS=/boot/firmware/overlays
|
||||
[ -d /flash/overlays ] && OVERLAYS=/flash/overlays
|
||||
|
||||
if [ ! -d $OVERLAYS ] ; then
|
||||
echo "$OVERLAYS not found or not a directory" 1>&2
|
||||
errorFound=1
|
||||
fi
|
||||
# should we also check for alsactl and amixer used in seeed-voicecard?
|
||||
PATH=$PATH:/opt/vc/bin
|
||||
for cmd in dtparam dtoverlay ; do
|
||||
if ! which $cmd &>/dev/null ; then
|
||||
echo "$cmd not found" 1>&2
|
||||
echo "You may need to run ./ubuntu-prerequisite.sh"
|
||||
errorFound=1
|
||||
fi
|
||||
done
|
||||
|
@ -63,8 +69,9 @@ function get_kernel_version() {
|
|||
_VER_RUN=""
|
||||
[ -z "$_VER_RUN" ] && {
|
||||
ZIMAGE=/boot/kernel.img
|
||||
[ -f /boot/firmware/vmlinuz ] && ZIMAGE=/boot/firmware/vmlinuz
|
||||
IMG_OFFSET=$(LC_ALL=C grep -abo $'\x1f\x8b\x08\x00' $ZIMAGE | head -n 1 | cut -d ':' -f 1)
|
||||
_VER_RUN=$(dd if=$ZIMAGE obs=64K ibs=4 skip=$(( IMG_OFFSET / 4)) | zcat | grep -a -m1 "Linux version" | strings | awk '{ print $3; }')
|
||||
_VER_RUN=$(dd if=$ZIMAGE obs=64K ibs=4 skip=$(( IMG_OFFSET / 4)) 2>/dev/null | zcat | grep -a -m1 "Linux version" | strings | awk '{ print $3; }')
|
||||
}
|
||||
echo "$_VER_RUN"
|
||||
return 0
|
||||
|
@ -76,10 +83,14 @@ 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"
|
||||
echo " Not found *** coressponding *** kernel headers with apt-get."
|
||||
echo " Not found *** corresponding *** kernel headers with apt-get."
|
||||
echo " This may occur if you have ran 'rpi-update'."
|
||||
echo " Choose *** y *** will revert the kernel to version $VER_HDR then continue."
|
||||
echo " Choose *** N *** will exit without this driver support, by default."
|
||||
|
@ -92,43 +103,15 @@ function check_kernel_headers() {
|
|||
apt-get -y --reinstall install raspberrypi-kernel
|
||||
}
|
||||
|
||||
function download_install_debpkg() {
|
||||
local prefix name r
|
||||
prefix=$1
|
||||
name=$2
|
||||
|
||||
for (( i = 0; i < 3; i++ )); do
|
||||
wget $prefix$name -O /tmp/$name && break
|
||||
done
|
||||
dpkg -i /tmp/$name; r=$?
|
||||
rm -f /tmp/$name
|
||||
return $r
|
||||
}
|
||||
|
||||
function install_kernel() {
|
||||
local _url _prefix
|
||||
|
||||
# Instead of retriving the lastest kernel & headers
|
||||
[ "X$FORCE_KERNEL" == "X" ] && {
|
||||
apt-get -y --force-yes install raspberrypi-kernel-headers raspberrypi-kernel
|
||||
} || {
|
||||
# We would like to a fixed version
|
||||
KERN_NAME=raspberrypi-kernel_${FORCE_KERNEL}_armhf.deb
|
||||
HDR_NAME=raspberrypi-kernel-headers_${FORCE_KERNEL}_armhf.deb
|
||||
_url=$(apt-get download --print-uris raspberrypi-kernel | sed -nre "s/'([^']+)'.*$/\1/g;p")
|
||||
_prefix=$(echo $_url | sed -nre 's/^(.*)raspberrypi-kernel_.*$/\1/g;p')
|
||||
|
||||
download_install_debpkg "$_prefix" "$KERN_NAME"
|
||||
download_install_debpkg "$_prefix" "$HDR_NAME"
|
||||
}
|
||||
}
|
||||
|
||||
# update and install required packages
|
||||
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
|
||||
install_kernel
|
||||
# rpi-update checker
|
||||
check_kernel_headers
|
||||
fi
|
||||
|
@ -143,7 +126,8 @@ fi
|
|||
# it's just been updated)
|
||||
base_ver=$(get_kernel_version)
|
||||
base_ver=${base_ver%%[-+]*}
|
||||
kernels="${base_ver}+ ${base_ver}-v7+ ${base_ver}-v7l+"
|
||||
#kernels="${base_ver}+ ${base_ver}-v7+ ${base_ver}-v7l+"
|
||||
kernels=$(uname -r)
|
||||
|
||||
function install_module {
|
||||
local _i
|
||||
|
@ -177,9 +161,9 @@ install_module "./" "seeed-voicecard"
|
|||
|
||||
|
||||
# install dtbos
|
||||
cp seeed-2mic-voicecard.dtbo /boot/overlays
|
||||
cp seeed-4mic-voicecard.dtbo /boot/overlays
|
||||
cp seeed-8mic-voicecard.dtbo /boot/overlays
|
||||
cp seeed-2mic-voicecard.dtbo $OVERLAYS
|
||||
cp seeed-4mic-voicecard.dtbo $OVERLAYS
|
||||
cp seeed-8mic-voicecard.dtbo $OVERLAYS
|
||||
|
||||
#install alsa plugins
|
||||
# no need this plugin now
|
||||
|
@ -194,14 +178,20 @@ grep -q "^snd-soc-ac108$" /etc/modules || \
|
|||
grep -q "^snd-soc-wm8960$" /etc/modules || \
|
||||
echo "snd-soc-wm8960" >> /etc/modules
|
||||
|
||||
#set dtoverlays
|
||||
sed -i -e 's:#dtparam=i2c_arm=on:dtparam=i2c_arm=on:g' /boot/config.txt || true
|
||||
grep -q "^dtoverlay=i2s-mmap$" /boot/config.txt || \
|
||||
echo "dtoverlay=i2s-mmap" >> /boot/config.txt
|
||||
#set dtoverlays - Raspbian:
|
||||
CONFIG=/boot/config.txt
|
||||
# Ubuntu:
|
||||
[ -f /boot/firmware/usercfg.txt ] && CONFIG=/boot/firmware/usercfg.txt
|
||||
# LibreELEC:
|
||||
[ -f /flash/distroconfig.txt ] && CONFIG=/flash/distroconfig.txt
|
||||
|
||||
sed -i -e 's:#dtparam=i2c_arm=on:dtparam=i2c_arm=on:g' $CONFIG || true
|
||||
grep -q "^dtoverlay=i2s-mmap$" $CONFIG || \
|
||||
echo "dtoverlay=i2s-mmap" >> $CONFIG
|
||||
|
||||
|
||||
grep -q "^dtparam=i2s=on$" /boot/config.txt || \
|
||||
echo "dtparam=i2s=on" >> /boot/config.txt
|
||||
grep -q "^dtparam=i2s=on$" $CONFIG || \
|
||||
echo "dtparam=i2s=on" >> $CONFIG
|
||||
|
||||
#install config files
|
||||
mkdir /etc/voicecard || true
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
};
|
||||
|
||||
fragment@1 {
|
||||
target-path = "/clocks";
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
ac108_mclk: codec-mclk {
|
||||
compatible = "fixed-clock";
|
||||
|
|
Binary file not shown.
|
@ -13,7 +13,7 @@
|
|||
};
|
||||
|
||||
fragment@1 {
|
||||
target-path = "/clocks";
|
||||
target-path = "/";
|
||||
__overlay__ {
|
||||
ac10x_mclk: codec-mclk {
|
||||
compatible = "fixed-clock";
|
||||
|
|
Binary file not shown.
|
@ -21,13 +21,21 @@
|
|||
# THE SOFTWARE.
|
||||
|
||||
set -x
|
||||
exec 1>/var/log/$(basename $0).log 2>&1
|
||||
#exec 1>/var/log/$(basename $0).log 2>&1
|
||||
|
||||
export PATH=$PATH:/opt/vc/bin
|
||||
|
||||
# Try Raspbian, Ubuntu, then LibreELEC location for OVERLAYS:
|
||||
OVERLAYS=/boot/overlays
|
||||
[ -d /boot/firmware/overlays ] && OVERLAYS=/boot/firmware/overlays
|
||||
[ -d /flash/overlays ] && OVERLAYS=/flash/overlays
|
||||
|
||||
#enable i2c interface
|
||||
dtparam i2c_arm=on
|
||||
dtparam -d $OVERLAYS i2c_arm=on
|
||||
modprobe i2c-dev
|
||||
|
||||
#enable spi interface
|
||||
dtparam spi=on
|
||||
dtparam -d $OVERLAYS spi=on
|
||||
|
||||
_VER_RUN=
|
||||
function get_kernel_version() {
|
||||
|
@ -43,7 +51,13 @@ function get_kernel_version() {
|
|||
return 0
|
||||
}
|
||||
|
||||
# Raspbian:
|
||||
CONFIG=/boot/config.txt
|
||||
# Ubuntu:
|
||||
[ -f /boot/firmware/usercfg.txt ] && CONFIG=/boot/firmware/usercfg.txt
|
||||
# LibreELEC:
|
||||
[ -f /flash/distroconfig.txt ] && CONFIG=/flash/distroconfig.txt
|
||||
|
||||
get_overlay() {
|
||||
ov=$1
|
||||
if grep -q -E "^dtoverlay=$ov" $CONFIG; then
|
||||
|
@ -115,13 +129,12 @@ if [ "$overlay" ]; then
|
|||
rm /etc/asound.conf
|
||||
rm /var/lib/alsa/asound.state
|
||||
|
||||
: <<\EOF
|
||||
kernel_ver=$(get_kernel_version)
|
||||
kernel_ver=$(uname -r) # get_kernel_version)
|
||||
# echo kernel_ver=$kernel_ver
|
||||
|
||||
# TODO: dynamic dtoverlay Bug of v4.19.x
|
||||
# no DT node phandle inserted.
|
||||
if [[ "$kernel_ver" =~ ^4\.19.*$ ]]; then
|
||||
if [[ "$kernel_ver" =~ ^4\.19.*$ || "$kernel_ver" =~ ^5\.*$ ]]; then
|
||||
for i in $RPI_HATS; do
|
||||
if [ "$i" == "$overlay" ]; then
|
||||
do_overlay $overlay 0
|
||||
|
@ -131,9 +144,8 @@ if [ "$overlay" ]; then
|
|||
fi
|
||||
done
|
||||
fi
|
||||
EOF
|
||||
#make sure the driver loads correctly
|
||||
dtoverlay $overlay || true
|
||||
dtoverlay -d $OVERLAYS $overlay || true
|
||||
|
||||
|
||||
echo "create $overlay asound configure file"
|
||||
|
@ -145,5 +157,12 @@ fi
|
|||
alsactl restore
|
||||
|
||||
#Force 3.5mm ('headphone') jack
|
||||
amixer cset numid=3 1
|
||||
|
||||
# The Raspberry Pi 4, released on 24th Jun 2019, has two HDMI ports,
|
||||
# and can drive two displays with audios for two users simultaneously,
|
||||
# in a "multiseat" configuration. The earlier single virtual ALSA
|
||||
# option for re-directing audio playback between headphone jack and HDMI
|
||||
# via a 'Routing' mixer setting was turned off eventually to allow
|
||||
# simultaneous usage of all 3 playback devices.
|
||||
if aplay -l | grep -q "bcm2835 ALSA"; then
|
||||
amixer cset numid=3 1 || true
|
||||
fi
|
||||
|
|
|
@ -240,6 +240,10 @@ static int seeed_voice_card_trigger(struct snd_pcm_substream *substream, int cmd
|
|||
ret = -EINVAL;
|
||||
}
|
||||
|
||||
dev_dbg(rtd->card->dev, "%s() stream=%s cmd=%d play:%d, capt:%d;finished %d\n",
|
||||
__FUNCTION__, snd_pcm_stream_str(substream), cmd,
|
||||
dai->playback_active, dai->capture_active, ret);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,18 @@
|
|||
#define __NO_SND_SOC_CODEC_DRV 0
|
||||
#endif
|
||||
|
||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0)
|
||||
#ifndef __has_attribute
|
||||
# define __has_attribute(x) __GCC4_has_attribute_##x
|
||||
# define __GCC4_has_attribute___fallthrough__ 0
|
||||
#endif
|
||||
#if __has_attribute(__fallthrough__)
|
||||
# define fallthrough __attribute__((__fallthrough__))
|
||||
#else
|
||||
# define fallthrough do {} while (0) /* fallthrough */
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if __NO_SND_SOC_CODEC_DRV
|
||||
#define codec component
|
||||
#define snd_soc_codec snd_soc_component
|
||||
|
|
37
ubuntu-prerequisite.sh
Executable file
37
ubuntu-prerequisite.sh
Executable file
|
@ -0,0 +1,37 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Copyright (c) Hin-Tak Leung 2020
|
||||
#
|
||||
# Overview:
|
||||
# This script compiles and install the Broadcom VideoCore tools,
|
||||
# configure the dynamic loader for the non-standard library location,
|
||||
# and update the loader cache.
|
||||
#
|
||||
# A few steps explicitly requires root privilege, which are
|
||||
# marked with "sudo". The rest is just checking for duplicate/previous
|
||||
# action.
|
||||
#
|
||||
# This derived from my command history on ubuntu 20.04.1 .YMMV
|
||||
|
||||
sudo apt install -y git gcc make alsa-utils cmake
|
||||
|
||||
git clone git://github.com/raspberrypi/userland.git
|
||||
pushd userland/
|
||||
|
||||
arch=$(uname -m)
|
||||
if [[ "$arch" =~ aarch64 ]]; then
|
||||
./buildme --aarch64
|
||||
else
|
||||
./buildme
|
||||
fi
|
||||
# ./buildme already includes "sudo make install" at the end
|
||||
|
||||
popd
|
||||
|
||||
# matches Raspbian's location:
|
||||
if [ ! -f /etc/ld.so.conf.d/00-vmcs.conf ] ; then
|
||||
echo "/opt/vc/lib" | sudo tee -a /etc/ld.so.conf.d/00-vmcs.conf
|
||||
sudo ldconfig -v
|
||||
else
|
||||
echo "/etc/ld.so.conf.d/00-vmcs.conf exists - no need to update ld.cache!"
|
||||
fi
|
29
uninstall.sh
29
uninstall.sh
|
@ -13,7 +13,13 @@ fi
|
|||
|
||||
uname_r=$(uname -r)
|
||||
|
||||
# Raspbian:
|
||||
CONFIG=/boot/config.txt
|
||||
# Ubuntu:
|
||||
[ -f /boot/firmware/usercfg.txt ] && CONFIG=/boot/firmware/usercfg.txt
|
||||
# LibreELEC:
|
||||
[ -f /flash/distroconfig.txt ] && CONFIG=/flash/distroconfig.txt
|
||||
|
||||
get_overlay() {
|
||||
ov=$1
|
||||
if grep -q -E "^dtoverlay=$ov" $CONFIG; then
|
||||
|
@ -51,18 +57,26 @@ do_overlay() {
|
|||
|
||||
RPI_HATS="seeed-2mic-voicecard seeed-4mic-voicecard seeed-8mic-voicecard"
|
||||
|
||||
PATH=$PATH:/opt/vc/bin
|
||||
echo "remove dtbos"
|
||||
for i in $RPI_HATS; do
|
||||
dtoverlay -r $i
|
||||
done
|
||||
rm /boot/overlays/seeed-2mic-voicecard.dtbo || true
|
||||
rm /boot/overlays/seeed-4mic-voicecard.dtbo || true
|
||||
rm /boot/overlays/seeed-8mic-voicecard.dtbo || true
|
||||
|
||||
# Try Raspbian, Ubuntu, then LibreELEC location for OVERLAYS:
|
||||
OVERLAYS=/boot/overlays
|
||||
[ -d /boot/firmware/overlays ] && OVERLAYS=/boot/firmware/overlays
|
||||
[ -d /flash/overlays ] && OVERLAYS=/flash/overlays
|
||||
|
||||
rm ${OVERLAYS}/seeed-2mic-voicecard.dtbo || true
|
||||
rm ${OVERLAYS}/seeed-4mic-voicecard.dtbo || true
|
||||
rm ${OVERLAYS}/seeed-8mic-voicecard.dtbo || true
|
||||
|
||||
echo "remove alsa configs"
|
||||
rm -rf /etc/voicecard/ || true
|
||||
|
||||
echo "disabled seeed-voicecard.service "
|
||||
systemctl stop seeed-voicecard.service
|
||||
systemctl disable seeed-voicecard.service
|
||||
|
||||
echo "remove seeed-voicecard"
|
||||
|
@ -73,9 +87,12 @@ echo "remove dkms"
|
|||
rm -rf /var/lib/dkms/seeed-voicecard || true
|
||||
|
||||
echo "remove kernel modules"
|
||||
rm /lib/modules/${uname_r}/kernel/sound/soc/codecs/snd-soc-wm8960.ko || true
|
||||
rm /lib/modules/${uname_r}/kernel/sound/soc/codecs/snd-soc-ac108.ko || true
|
||||
rm /lib/modules/${uname_r}/kernel/sound/soc/bcm/snd-soc-seeed-voicecard.ko || true
|
||||
rm /lib/modules/*/kernel/sound/soc/codecs/snd-soc-wm8960.ko || true
|
||||
rm /lib/modules/*/kernel/sound/soc/codecs/snd-soc-ac108.ko || true
|
||||
rm /lib/modules/*/kernel/sound/soc/bcm/snd-soc-seeed-voicecard.ko || true
|
||||
rm /lib/modules/*/updates/dkms/snd-soc-wm8960.ko || true
|
||||
rm /lib/modules/*/updates/dkms/snd-soc-ac108.ko || true
|
||||
rm /lib/modules/*/updates/dkms/snd-soc-seeed-voicecard.ko || true
|
||||
|
||||
echo "remove $CONFIG configuration"
|
||||
for i in $RPI_HATS; do
|
||||
|
|
1
wm8960.c
1
wm8960.c
|
@ -753,6 +753,7 @@ static int wm8960_hw_params(struct snd_pcm_substream *substream,
|
|||
iface |= 0x000c;
|
||||
break;
|
||||
}
|
||||
fallthrough;
|
||||
default:
|
||||
dev_err(codec->dev, "unsupported width %d\n",
|
||||
params_width(params));
|
||||
|
|
Loading…
Reference in a new issue