Compare commits

...

35 commits

Author SHA1 Message Date
Hin-Tak Leung
f8abf23b1e Additional debug code to where the *_trigger()'s finish. 2021-04-24 22:14:05 +01:00
Hin-Tak Leung
b380ebfb26 older compiler than gcc 5 does not have __has_attribute
fix for older compiler than gcc 5

Reference: kernel's include/linux/compiler_attributes.h
2020-12-04 23:49:44 +00:00
Hin-Tak Leung
5c9e04cd57 Merge branch 'v4.19' into v5.5 - no-op
v4.19 is largely sync'ed to v5.5, so this is a no-op.
2020-12-02 16:36:14 +00:00
Hin-Tak Leung
c236752f91 stop systemd service before diabling in uninstall, taken from upstream c1c2e5ca 2020-12-02 15:57:10 +00:00
turmary
85160dac38 Remove: useless dd message in get_kernel_version() 2020-12-02 15:57:10 +00:00
Hin-Tak Leung
d9fdfac988 Adding missing shebang
This script has no bash-ism, so /bin/sh (dash on Debian/Ubuntu) is fine.
2020-12-02 15:57:10 +00:00
Hin-Tak Leung
5c311c4031 updating for Ubuntu location of dkms-generated kernel modules
Conflicts:
	uninstall.sh
2020-12-02 15:57:10 +00:00
Hin-Tak Leung
0248378f7f updating non-standard PATH for Ubuntu in uninstall.sh 2020-12-02 15:57:10 +00:00
Hin-Tak Leung
fc77a4c00a update check_kernel_headers() for Ubuntu header packages 2020-12-02 15:57:10 +00:00
Hin-Tak Leung
7e4917be89 Add reference to Ubuntu kernel package names
Signed-off-by: Hin-Tak Leung <htl10@users.sourceforge.net>
2020-12-02 15:57:10 +00:00
Hin-Tak Leung
f512fe32bd make the config un-install directory configurable, for Ubuntu 2020-12-02 15:57:10 +00:00
Hin-Tak Leung
99b29b06c1 make the overlay un-install directory configurable, for Ubuntu 2020-12-02 15:57:10 +00:00
Hin-Tak Leung
37cd69fc1a Allow kernel images to be elsewhere - Ubuntu kernel is not at Raspbian location 2020-12-02 15:57:10 +00:00
Hin-Tak Leung
408f71d2f4 adding new ubuntu-prerequisite.sh script
notes and typo
2020-12-02 15:57:10 +00:00
Hin-Tak Leung
cddfe7b15e /opt/vc/bin is not on standard $PATH on Ubuntu 2020-12-02 15:57:10 +00:00
Hin-Tak Leung
f4cb786a5b adding advice to run ./ubuntu-prerequisite.sh in install.sh 2020-12-02 15:46:31 +00:00
Hin-Tak Leung
115186c53c Ubuntu kernels is not at /boot/kernel.img. Revisit for Raspbian
check running kernel agree with installed kernel, and ask the user to reboot before continue

Ubuntu kernels are not installed at /boot/kernel.img
2020-12-02 15:45:24 +00:00
Hin-Tak Leung
4e29eb8f51 make the config file configurable, for Ubuntu 2020-12-02 15:45:13 +00:00
Hin-Tak Leung
de0e478df4 make the overlay install directory configurable, for Ubuntu 2020-12-02 15:45:04 +00:00
Hin-Tak Leung
f716cece88 spelling 2020-12-02 15:44:45 +00:00
Hin-Tak Leung
7958dd2076 comment about Raspberry Pi 4 having two HDMI ports
The if-endif block below around the amixer call fixes
https://github.com/respeaker/seeed-voicecard/issues/239
https://github.com/respeaker/seeed-voicecard/issues/240
https://github.com/respeaker/seeed-voicecard/issues/243
2020-12-02 15:40:46 +00:00
Hin-Tak Leung
64a207940f Use logic from raspi-config to determine if bcm2835 routing option exists or not - 3 merged commits
Number 1:
mask amixer failures - some user have different numbered / multiple audio devices

Number 2:

remove "-c 1" and also protect with test for older kernel / alsa

The "-c 1" was simply wrong. The default (-c 0) sound device of
older kernel / alsa has a numid=3 selector for auto vs headphone vs hdmi .
Newer kernel simply has multiple devices. Also, headphone is -c 0 .

$ amixer contents
numid=2,iface=MIXER,name='Headphone Playback Switch'
  ; type=BOOLEAN,access=rw------,values=1
  : values=on
numid=1,iface=MIXER,name='Headphone Playback Volume'
  ; type=INTEGER,access=rw---R--,values=1,min=-10239,max=400,step=0
  : values=-2000
  | dBscale-min=-102.39dB,step=0.01dB,mute=1

TODO: For now, broadly dividing by kernel v4.x vs v5.x is good enough, but
it would be nice to find out when / which kernel /alsa this is relevant.

closes https://github.com/respeaker/seeed-voicecard/issues/240

Number 3:

Use logic from raspi-config to determine if bcm2835 routing option exists or not

The snd_bcm2835.enable_compat_alsa option:

    enable_compat_alsa:Enables ALSA compatibility virtual audio device (bool)

is off these days, since the beginning of 2020 apparently.

Reference:

    raspi-config (20200120) buster; urgency=medium

      * Add audio switching for discrete internal ALSA devices

     -- Simon Long <simon@raspberrypi.org>  Mon, 20 Jan 2020 11:38:37 +0000
2020-12-02 15:38:06 +00:00
Hin-Tak Leung
35bc08973c likely v5 kernels behave like late 4.x, regarding dynamic dtoverlay; untested, and possibly revisit. 2020-12-02 15:38:06 +00:00
Claus-Justus Heine
bafb3c85aa Support ubuntu-server with /boot/firmware/overlays 2020-12-02 15:32:43 +00:00
Hin-Tak Leung
556ed21066 rebuilt dtbo on current Raspbian 2020-12-02 15:30:48 +00:00
Hin-Tak Leung
f4cc5722d0 relocating fixed-clock entry, based on upstream advice
See upstream -
https://github.com/raspberrypi/documentation/issues/1671
https://github.com/raspberrypi/documentation/pull/1673

Quoted here:

* Only Device Tree nodes at the top level of the tree and children of
  a bus node will be probed. For nodes added at run-time there is the
  further limitation that the bus must register for notifications of
  the addition and removal of children. However, there are exceptions
  that break this rule and cause confusion: the kernel explicitly
  scans the entire tree for some device types - clocks and interrupt
  controller being the two main ones - in order to (for clocks)
  initialise them early and/or (for interrupt controllers) in a
  particular order. This search mechanism only happens during booting
  and so doesn't work for nodes added by an overlay at run-time. It is
  therefore recommended for overlays to place fixed-clock nodes in the
  root of the tree unless it is guaranteed that the overlay will not
  be used at run-time.
2020-12-02 15:30:31 +00:00
Hin-Tak Leung
49f1135da8 Use pr_warn() for recoverable errors, not pr_info() 2020-12-02 15:21:14 +00:00
Hin-Tak Leung
6244e5d618 Use pr_info() for just routine information, not pr_warn() 2020-12-02 15:20:53 +00:00
Hin-Tak Leung
5ce09f2095 Use pr_info() for regular information 2020-12-02 15:20:33 +00:00
Hin-Tak Leung
140a220946 Following Standard ALSA Control Names convention
See kernel documentation, e.g. v5.5:Documentation/sound/designs/control-names.rst

Fixes https://github.com/respeaker/seeed-voicecard/issues/247
2020-12-02 15:16:13 +00:00
Hin-Tak Leung
31bea0c3be compatibility - fallthrough' pseudo keyword was introduced in v5.4
commit 294f69e662d1570703e9b56e95be37a9fd3afba5
Author: Joe Perches <joe@perches.com>
Date:   Sat Oct 5 09:46:42 2019 -0700

    compiler_attributes.h: Add 'fallthrough' pseudo keyword for switch/case use
2020-12-02 15:09:06 +00:00
Hin-Tak Leung
b80f7bc89b use the kernel's way of suppressing fallthrough
See include/linux/compiler_attributes.h:

/*
 * Add the pseudo keyword 'fallthrough' so case statement blocks
 * must end with any of these keywords:
 *   break;
 *   fallthrough;
 *   goto <label>;
 *   return [expression];
 *
 *  gcc: https://gcc.gnu.org/onlinedocs/gcc/Statement-Attributes.html#Statement-Attributes
 */
-if __has_attribute(__fallthrough__)
- define fallthrough                    __attribute__((__fallthrough__))
-else
- define fallthrough                    do {} while (0)  /* fallthrough */
-endif
2020-12-02 15:09:06 +00:00
Hin-Tak Leung
6f03b0df86 suppress another "this statement may fall through" warning
The whole warning is quite long but looks like this:

  CC [M]  seeed-voicecard/ac108.o
In file included from ./include/linux/printk.h:331,
                 from ./include/linux/kernel.h:15,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:12,
                 from seeed-voicecard/ac108.c:15:
seeed-voicecard/ac108.c: In function ‘ac108_set_fmt’:
./include/linux/dynamic_debug.h:122:52: warning: this statement may fall through [-Wimplicit-fallthrough=]
  122 | #define __dynamic_func_call(id, fmt, func, ...) do { \
      |                                                    ^
./include/linux/dynamic_debug.h:143:2: note: in expansion of macro ‘__dynamic_func_call’
  143 |  __dynamic_func_call(__UNIQUE_ID(ddebug), fmt, func, ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~
./include/linux/dynamic_debug.h:157:2: note: in expansion of macro ‘_dynamic_func_call’
  157 |  _dynamic_func_call(fmt,__dynamic_dev_dbg,   \
      |  ^~~~~~~~~~~~~~~~~~
./include/linux/device.h:1795:2: note: in expansion of macro ‘dynamic_dev_dbg’
 1795 |  dynamic_dev_dbg(dev, dev_fmt(fmt), ##__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~
seeed-voicecard/ac108.c:866:4: note: in expansion of macro ‘dev_dbg’
  866 |    dev_dbg(dai->dev, "used as slave when AC101 is master\n");
      |    ^~~~~~~
seeed-voicecard/ac108.c:868:2: note: here
  868 |  case SND_SOC_DAIFMT_CBS_CFS:    /*AC108 Slave*/
      |  ^~~~
2020-12-02 15:09:06 +00:00
Hin-Tak Leung
26cfab95cf suppress "this statement may fall through" warning
The semi-colon is needed, to prevent the comment being parsed as part of the "if {...}" statement.

The warning looks like this:

seeed-voicecard/wm8960.c: In function ‘wm8960_hw_params’:
seeed-voicecard/wm8960.c:752:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
  752 |   if ((iface & 0x3) != 0) {
      |      ^
seeed-voicecard/wm8960.c:757:2: note: here
  757 |  default:
      |  ^~~~~~~
2020-12-02 15:09:06 +00:00
Hin-Tak Leung
8497972d65 Don't force kernel downgrade
Revert "Fix: try to use a specific version kernel & headers"

This reverts commit ae32476755.

Conflicts:
	install.sh
2020-04-27 00:16:44 +01:00
4 changed files with 15 additions and 0 deletions

View file

@ -1286,6 +1286,9 @@ int ac101_trigger(struct snd_pcm_substream *substream, int cmd,
default: default:
ret = -EINVAL; ret = -EINVAL;
} }
AC101_DBG("stream=%s cmd=%d;finished %d\n",
snd_pcm_stream_str(substream),
cmd, ret);
return ret; return ret;
} }

View file

@ -1091,6 +1091,10 @@ static int ac108_trigger(struct snd_pcm_substream *substream, int cmd,
__ret: __ret:
spin_unlock_irqrestore(&ac10x->lock, flags); 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; return ret;
} }

View file

@ -245,6 +245,10 @@ static int seeed_voice_card_trigger(struct snd_pcm_substream *substream, int cmd
ret = -EINVAL; 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; return ret;
} }

View file

@ -16,6 +16,10 @@
#endif #endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,4,0) #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__) #if __has_attribute(__fallthrough__)
# define fallthrough __attribute__((__fallthrough__)) # define fallthrough __attribute__((__fallthrough__))
#else #else