Commit graph

186 commits

Author SHA1 Message Date
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
HinTak
48463b9a50 Correct typo
Fix typo in comment.
2020-03-30 09:01:36 +08:00
mxklb
2da704e872 Check for enough space on /boot volume (check #209) 2020-02-15 16:38:04 +08:00
HinTak
d6f808b278 fix typo 2020-01-29 14:32:30 +08:00
SamhithPottem
873580cfd5 Update install.sh (#182) to --force-yes install 2019-10-23 11:16:55 +08:00
turmary
ae32476755 Fix: try to use a specific version kernel & headers 2019-10-22 15:59:07 +01:00
Baozhu Zuo
277aeacb81
The latest kernel of raspberry PI is unstable, so do this anyway to make sure the driver loads correctly 2019-07-25 19:39:07 +08:00
Baozhu Zuo
08f0d96d68
raspberry pi 4 use the v7l+ suffix as the kernel identifier 2019-07-25 19:30:04 +08:00
turmary
da5f90473b Fix: removing asound.conf when detecting i2c addresses 2019-05-22 10:39:09 +08:00
turmary
0ea5d2bd98 Fix: dtoverlay on Linux v4.19 failed in phandle insertion 2019-05-21 12:18:25 +08:00
Baozhu Zuo
c7026a4048
remove sleep , accelerate the seeed-voicecard service startup 2019-04-17 14:58:21 +08:00
Baozhu Zuo
11e9db79b5
remove sleep , accelerate the seeed-voicecard service startup 2019-04-17 14:58:07 +08:00
turmary
90d2673610 Add: kernel headers checking after action rpi-update 2019-04-16 09:34:10 +08:00
Norbert Preining
09728d1c82 allow installation in qemu
Currently, installation is only supported on real hardware, but not
running in QEMU. Change the check to make sure the necessary
directories and programs are available instead of bailing out
on non-Raspberry archs.
2019-03-30 14:19:47 +08:00
respeaker
b98fce84e0 Add: compatible to linux-4.18 or higher 2019-03-14 03:13:25 +00:00
Pernat1y
6c6b9ab7de Install packages for Arch Linux 2019-01-28 09:23:40 +08:00
Pernat1y
27b6cdf252 Make grep searches more precise 2019-01-28 09:23:40 +08:00
Baozhu Zuo
f5b82b6b7d
Merge pull request #123 from baorepo/patch-1
test hardware mic phase position
2018-12-25 09:37:27 +08:00
Baozhu Zuo
5744fd1bbb
test hardware mic phase position
baozhu@bz:/tmp$ python wave_test.py record.wav 
2
['448.8125', '446.65625', '-0.1875', '330.8125', '448.375', '450.59375', '451.0']
['448.78125', '448.5625', '-0.1875', '-0.125', '448.3125', '-0.125', '-450.78125']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.0625', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.25']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.25']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.25']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.25']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '0.21875']
['0.0', '0.0', '0.0', '-0.09375', '-0.09375', '-0.09375', '-0.96875']
['0.03125', '0.0', '-0.0625', '-0.09375', '-0.0625', '-0.09375', '-23.0625']
['0.0', '0.0', '-0.0625', '-0.09375', '-0.0625', '-0.09375', '-23.125']
done
48000
2018-12-25 09:36:27 +08:00
turmary
95f4fe0688 Fix: remove spin lock in machine trigger 2018-11-27 09:47:44 +00:00
turmary
3392bf394b Fix: try to stop aif clock in thread environment 2018-11-07 18:33:55 -10:00
turmary
0965139ead Optimize: simplify AC101 debug message 2018-11-07 15:29:06 -10:00
Jack Shao
be0812c70b update: more convenient way to apply udev rules 2018-10-11 17:54:51 +08:00
KillingJacky
dfc7b404a5 change asound.state for 4mic array, lower down PGA to reduce static noise 2018-09-29 14:49:19 +08:00
Baozhu Zuo
deeddaabb4
seeed-voicecard: if the board detect seeed-voicecard then resetup asound.conf and asound.state 2018-09-29 14:36:01 +08:00
Yihui Xiong
bfe6978ef4 update 6 mic gain controls 2018-08-06 06:32:46 +00:00