Closed h4de5 closed 3 years ago
The current code has dropped older kernel (4.19) support, I think, and also too much bash-isms. Busybox's emulation of bash isn't up for it, I think. And I have never agreed with the whole check disk space and downgrade kernel thing , so you may have better luck with https://github.com/HinTak/seeed-voicecard . That said, it should be possible to rollback and get 4.19 support back again. (revert commits marked "v5.x" etc) . You probably want to follow some of the raspberrypi dev tips I wrote in the raspberrypi-dev repo. See https://hintak.github.io .
I don't agree with the whole downgrade kernel thing which "Warning: /boot volume" is for.
@HinTak thank you very much for the fast response and the idea.
I am trying to manually go through your install.sh script on libreelec.
i2cdetec
and arecord
are not available.how far would I need to go back in the git history? I see the bigger changes are starting at around beginning of this year. and adding support for 4.18 at around march 2019. so somewhere in between?
@h4de5 actually 5.4 support (for current raspbian /Ubuntu ) was only merged in summer 2020 (after many months of unhappiness of users being forced to stay in old OSes) - so you only need to roll back a few months. I'll make a v4.19 branch soon - just stay on that branch and you'd be fine, and I'd be interested to know what adjustments you need to make to make it work.
Your first 4 points aren't important, if you are happy with staying with one device and hardcoding that into your config.txt . A lot of the complexity is strictly speaking not necessary and only for dynamically detectino which respeaker it is and load the correct one. So that covers half of your 5th point too. To check that you have manually configure correctly you need to read your boot messages (dmesg
).
It is a bit painful without arecord
but maybe you have pyalsa (python binding of libalsa) or equivalent?
The v4.19 branch on https://github.com/HinTak/seeed-voicecard is now synced to v5.5 with all the Ubuntu related stuff earlier this year, minus v4.19+ necessary code changes. So you should use that, and possibly let me know of any interesting distro-related modifications needed for you.
I don't work for Seeed Studio so maintaining two (current Ubuntu v5.4 and oldish Raspbian 4.19) and tracking a 3rd keeping x86_64 buildable on most current kernel (v5.9) is already beyond what I should... you are welcomed to click on the donate link at the bottom of https://hintak.github.io , if only to pay for a few SD cards to play with different OSes...
wow. thanks a lot.
but I am not sure where to start from here. I switched to the new branch and run seeed-voicecard
thats the outcome.
+ export 'PATH=/usr/bin:/usr/sbin:/storage/.kodi/addons/service.system.docker/bin:/storage/.kodi/addons/virtual.multimedia-tools/bin:/storage/.kodi/addons/virtual.rpi-tools/bin:/storage/.kodi/addons/virtual.system-tools/bin:/opt/vc/bin'
+ OVERLAYS=/boot/overlays
+ '[' -d /boot/firmware/overlays ]
+ dtparam -d /boot/overlays 'i2c_arm=on'
+ modprobe i2c-dev
+ dtparam -d /boot/overlays 'spi=on'
+ _VER_RUN=
+ CONFIG=/boot/config.txt
+ '[' -f /boot/firmware/usercfg.txt ]
+ i2cdetect -y 1 0x1a 0x1a
+ egrep '(1a|UU)'
+ awk '{print $2}'
+ is_1a=
+ i2cdetect -y 1 0x35 0x35
+ egrep '(35|UU)'+ awk '{print $2}'
+ is_35=
+ i2cdetect -y 1 0x3b 0x3b
+ egrep '(3b|UU)'
+ awk '{print $2}'
+ is_3b=3b
+ RPI_HATS='seeed-2mic-voicecard seeed-4mic-voicecard seeed-8mic-voicecard'
+ overlay=
+ '[' x '!=' x ]
+ '[' x3b '!=' x ]
+ '[' x '==' x ]
+ echo 'install 4mic'
install 4mic
+ overlay=seeed-4mic-voicecard
+ asound_conf=/etc/voicecard/asound_4mic.conf
+ asound_state=/etc/voicecard/ac108_asound.state
+ '[' x3b '!=' x ]
+ '[' x '!=' x ]
+ '[' seeed-4mic-voicecard ]
+ echo Install seeed-4mic-voicecard ...
Install seeed-4mic-voicecard ...
+ rm /etc/asound.conf
rm: can't remove '/etc/asound.conf': No such file or directory
+ rm /var/lib/alsa/asound.state
rm: can't remove '/var/lib/alsa/asound.state': No such file or directory
+ uname -r
+ kernel_ver=4.19.127
+ '[[' 4.19.127 '=~' '^4.19.*$' -o 4.19.127 '=~' '^5.*$' ]]
bash: =~: unknown operand
+ dtoverlay -d /boot/overlays seeed-4mic-voicecard
DTOVERLAY[error]: failed to open '/boot/overlays/seeed-4mic-voicecard.dtbo'
* Failed to read '/boot/overlays/seeed-4mic-voicecard.dtbo'
+ true
+ echo 'create seeed-4mic-voicecard asound configure file'
create seeed-4mic-voicecard asound configure file
+ ln -s /etc/voicecard/asound_4mic.conf /etc/asound.conf
ln: /etc/asound.conf: Read-only file system
+ echo 'create seeed-4mic-voicecard asound status file'
create seeed-4mic-voicecard asound status file
+ ln -s /etc/voicecard/ac108_asound.state /var/lib/alsa/asound.state
ln: /var/lib/alsa/asound.state: No such file or directory
+ alsactl restore
alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory
alsactl: sysfs_init:48: sysfs path '/sys' is invalid
Found hardware: "bcm2835_alsa" "Broadcom Mixer" "" "" ""
Hardware is initialized using a generic method
+ + grepaplay -q -l 'bcm2835 ALSA'
+ amixer cset 'numid=3' 1
numid=3,iface=MIXER,name='PCM Playback Route'
; type=INTEGER,access=rw------,values=1,min=0,max=3,step=0
: values=1
I also found a way to install i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- 3b -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
there is no /boot/
folder - overlays are located in: /flash/overlays/
and /etc/
is readonly. asound.conf
should go into /storage/.config/
(which I did)
i think asound.state
should go to: /var/media/root/var/lib/alsa/asound.state
(which I did)
still - alsoctl
searches for the wrong path:
alsactl restore
alsactl: load_state:1683: Cannot open /var/lib/alsa/asound.state for reading: No such file or directory
I now also found a way to install alsamixer through Kodi's multimedia tools (not sure if this helps)
PS: I followed your advice about that buttons on your website - keep up the good work!
@h4de5 that seems to have gone better than expected. So now we have a 3rd variants:
Possibly /flash/config.txt
?
"bash: =~: unknown operand" is another busybox vs bash issue.
I think you need to have a look at /flash/config.txt
. Adding a line
dtoverlay=seeed-4mic-voicecard
to the config file manually is equivalent to all the i2cdetect and dtoverlay -d ...
, so if you add that line you can drop most of
seeed-voicecard 's content. As I wrote earlier most of it is just trying to dynamically determine if you have 2-mics 4 mics or 6-mics.
mmh. you are making me feel, like we could actually get this thing running..
I had put dtoverlay=seeed-4mic-voicecard.dtbo
- which I fixed that now.
I also added this stuff (that I found on the internet, but actually have no idea about..)
dtparam=i2c1=on
dtparam=i2c_arm=on
dtoverlay=i2s-mmap
dtparam=audio=on
is any of this needed?
not sure about: usercfg.txt
is there any way to test it without seeed-voicecard
?
I have downloaded the LibreELEC image and have a look. So I updated the v4.19 branch. The correct place is /flash/distroconfig.txt
though /boot/config.txt
includes the former and works too.
Since you seem to be able to run i2cdetect
correctly, you don't need to worry about the dtparam stuff.
I think we need to see your dmesg
output with the config.txt change and the card physically hooked up, that"s all. Curious libreELEC have aplay but no arecord! But you should be able to look at aplay -L
and verify that the card is installed correctly, and use it to play some sound through the respeaker's phone output jack! (follow the instruction in the README).
aplay -L
:
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=ALSA
bcm2835 ALSA, bcm2835 ALSA
Default Audio Device
iec958:CARD=ALSA,DEV=0
bcm2835 ALSA, bcm2835 IEC958/HDMI
IEC958 (S/PDIF) Digital Audio Output
maybe a stupid question, but should there be any vital signs on the respeaker if its pluged in correctly? like would it light a led or something? I already changed the connector twice because I was not sure - but there is no led on at the moment.
@h4de5 libreELEC has pacmd
so you can use that to see if the recording part of the card is detected with pacmd list-sources
. If that works, you might be able to use parecord
instead of arecord
to record off the 4-mics!
it is not showing up, right?
@h4de5 okay, your dmesg is half-way to correct - these two lines means your overlay is half-loaded:
[ 791.433743] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/i2c@7e804000/status
[ 791.544905] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/spi@7e204000/status
your question about LEDs: no, the leds are programable and you can play with them (I have a script which makes them do a spinning rainbow...), but they don't automatically light up.
@h4de5 since LibreELEC does not have dkms, we need to do things the old-fashioned way: if you do make
, it should hopefully create a few "*.ko". make install
should copy them to some place under /lib/modules/4.19.127
or /usr/lib/kernel-overlays/base/lib/modules/4.19.127
?
The part of interesting dmesg on raspbian looks like this:
[ 2.224602] snd_soc_seeed_voicecard: loading out-of-tree module taints kernel.
...
[ 3.452025] ac10x i2c_id number: 1
[ 3.452036] ac10x data protocol: 0
...
[ 3.836116] ac10x codec count : 1
[ 3.836963] ac10x i2c_id number: 0
[ 3.836973] ac10x data protocol: 0
...
[ 4.165136] ac10x codec count : 2
...
[ 4.491265] input: seed-voicecard-headset as /devices/platform/soc/fe804000.i2c/i2c-1/1-0035/input/input0
[ 4.503653] ac108_set_sysclk :24000000
[ 4.518598] AC101 as Master
[ 4.523353] seeed-voicecard soc:sound: ac10x-codec.1-0035 <-> fe203000.i2s mapping ok
...
[ 6.542662] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/i2c@7e804000/status
...
[ 6.901904] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/spi@7e204000/status
[ 7.187898] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/i2s@7e203000/#sound-dai-cells
[ 7.187968] OF: overlay: WARNING: memory leak will occur if overlay removed, property: /soc/i2s@7e203000/status
This is the 6-mics devices; I believe the 4-mics shows fewer ac10x lines, with a "codec count 1", and does not have the "input: seed-voicecard-headset" lines.
It appears that the libreELEC does not ship any dev tools, so unfortunately you may need to install "make", "gcc", "kernel-dev" and perhaps a few other dev-related packages before you can run "make" correctly to generate the "*.ko" files.
@h4de5 I had a look at volumio - it turns out to be just old raspbian, so as far as I see it should just work, if you are careful about kernel header package installation.
My notes - https://github.com/HinTak/RaspberryPi-Dev/blob/master/LibreELEC-and-Volumio.md
It looks like Volumio is perhaps easier.
If your apt list -a raspberrypi-kernel
on Volumio looks like this:
Listing... Done
raspberrypi-kernel/testing 1.20201022-1 armhf [upgradable from: 1.20200512-2]
raspberrypi-kernel/now 1.20200512-2 armhf [installed,upgradable to: 1.20201022-1]
You should be able to download the matching header,
dpkg -i
the downloaded file, then do apt-mark hold raspberrypi-kernel raspberrypi-kernel-headers
and verify with apt-mark showholds
that they are marked to stay not to auto-upgrade, and just follow ./install.sh as normal raspbian.
I'll put these in the Volumio section of the above doc.
I had no luck finding a way to get the build tools into kodi.
lets assume - just for a moment - that I have no idea about building stuff with make .. what happens if I build it in a docker container that is running within libreelec or even on a separate raspbian installation on that rpi and copy them over?
so, you think installation on volumio would be easier? i just checked, and that volumio is running on a rpi3b (not a rpi4).
@h4de5 Volumio seems to be just older raspbian (Jesse), it may indeed be a bit too old for pi4? Not sure about this.
@h4de5 I think volumio would work on pi4 - while most of the system is older raspbian, the kernel is a fairly current one - 20200512 as far as I can see, identical to what I am running on my kernel-version-locked current raspbian).
ok. in this case i'll have a look at volumio later today. not sure - but the last time i tried to get the respeaker run there, I got stuck somewhere else..
btw. I have put ac108_asound.state
to: /var/media/root/var/lib/alsa/asound.state
I am on volumio now. install.sh ran through - but had many errors:
at least arecord is there:
$ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server
default
playback
ac108
$ pacmd list-sources
1 source(s) available.
* index: 0
name: <null.monitor>
driver: <module-null-sink.c>
flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
state: IDLE
suspend cause:
priority: 1000
volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
base volume: 65536 / 100% / 0.00 dB
volume steps: 65537
muted: no
current latency: 0.00 ms
max rewind: 344 KiB
sample spec: s16le 2ch 44100Hz
channel map: front-left,front-right
Stereo
used by: 0
linked by: 0
configured latency: 2000.00 ms; range is 0.50 .. 2000.00 ms
monitor_of: 0
module: 3
properties:
device.description = "Monitor of Null Output"
device.class = "monitor"
device.icon_name = "audio-input-microphone"
I am going through them right now.
this is was my headers look like:
apt list -a raspberrypi-kernel
Listing... Done
raspberrypi-kernel/oldstable 1.20170703-1 armhf
this is was my headers look like:
apt list -a raspberrypi-kernel Listing... Done raspberrypi-kernel/oldstable 1.20170703-1 armhf
How old is your volumio installation? As it says 2017, it is antique...
I am wondering myself - its the current volumio (2.853), but I mostly updated it through the service itself - still 2017 seems a little too old.
also - not sure if this matters - this installation is running on a berryboot bootloader, with the image located on a iSCSI mount.
I tried to download those headers (only after I already tried to run install.sh)
$ sudo dpkg -i raspberrypi-kernel-headers_1.20170703-1_armhf.deb
[sudo] password for volumio:
Selecting previously unselected package raspberrypi-kernel-headers.
dpkg: warning: files list file for package 'libgc1c2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libunistring0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'guile-2.0-libs:armhf' missing; assuming package has no files currently installed
(Reading database ... 34657 files and directories currently installed.)
Preparing to unpack raspberrypi-kernel-headers_1.20170703-1_armhf.deb ...
Unpacking raspberrypi-kernel-headers (1.20170703-1) ...
Setting up raspberrypi-kernel-headers (1.20170703-1) ...
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.9.35+
Error! Bad return status for module build on kernel: 4.9.35+ (armv7l)
Consult /var/lib/dkms/seeed-voicecard/0.3/build/make.log for more information.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.9.35-v7+
Error! Bad return status for module build on kernel: 4.9.35-v7+ (armv7l)
Consult /var/lib/dkms/seeed-voicecard/0.3/build/make.log for more information.
$ cat /var/lib/dkms/seeed-voicecard/0.3/build/make.log
DKMS make.log for seeed-voicecard-0.3 for kernel 4.9.35-v7+ (armv7l)
Fri Dec 4 21:30:41 UTC 2020
make: Entering directory '/usr/src/linux-headers-4.9.35-v7+'
LD /var/lib/dkms/seeed-voicecard/0.3/build/built-in.o
CC [M] /var/lib/dkms/seeed-voicecard/0.3/build/wm8960.o
In file included from /var/lib/dkms/seeed-voicecard/0.3/build/wm8960.c:28:0:
/var/lib/dkms/seeed-voicecard/0.3/build/sound-compatible-4.18.h:19:5: warning: "__has_attribute" is not defined [-Wundef]
#if __has_attribute(__fallthrough__)
^
/var/lib/dkms/seeed-voicecard/0.3/build/sound-compatible-4.18.h:19:20: error: missing binary operator before token "("
#if __has_attribute(__fallthrough__)
^
scripts/Makefile.build:293: recipe for target '/var/lib/dkms/seeed-voicecard/0.3/build/wm8960.o' failed
make[1]: *** [/var/lib/dkms/seeed-voicecard/0.3/build/wm8960.o] Error 1
Makefile:1490: recipe for target '_module_/var/lib/dkms/seeed-voicecard/0.3/build' failed
make: *** [_module_/var/lib/dkms/seeed-voicecard/0.3/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.9.35-v7+'
$ apt-mark showholds
raspberrypi-kernel-headers
@h4de5 okay, for some strange reason, it is stuck at the older 4.9 kernel. Anyway, the error you saw is because of older compiler (than gcc 5 ... Current is 10, you know...) did not have __has_attribute . I just pushed a fix - please pull and see if you manage to continue compilation?
$ cat /var/lib/dkms/seeed-voicecard/0.3/build/make.log
DKMS make.log for seeed-voicecard-0.3 for kernel 4.9.35-v7+ (armv7l)
Fri Dec 4 22:22:06 UTC 2020
make: Entering directory '/usr/src/linux-headers-4.9.35-v7+'
LD /var/lib/dkms/seeed-voicecard/0.3/build/built-in.o
CC [M] /var/lib/dkms/seeed-voicecard/0.3/build/wm8960.o
In file included from /var/lib/dkms/seeed-voicecard/0.3/build/wm8960.c:28:0:
/var/lib/dkms/seeed-voicecard/0.3/build/sound-compatible-4.18.h:19:48: error: missing binary operator before token "("
#if defined(__has_attribute) && __has_attribute(__fallthrough__)
^
scripts/Makefile.build:293: recipe for target '/var/lib/dkms/seeed-voicecard/0.3/build/wm8960.o' failed
make[1]: *** [/var/lib/dkms/seeed-voicecard/0.3/build/wm8960.o] Error 1
Makefile:1490: recipe for target '_module_/var/lib/dkms/seeed-voicecard/0.3/build' failed
make: *** [_module_/var/lib/dkms/seeed-voicecard/0.3/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.9.35-v7+'
should I try to update the berryboot installation?
did I mentioned, that volumio is running on a rpi3 (not a 4) ? maybe thats the difference?
Okay, made a mistake with the fix - pushed a better fix.
Likely volumio has a special pi4 build with a more current kernel? I mean, pi 4 did not exist in 2017.
i tried to update some more stuff. getting the latest berryboot version - it seems its running on 64bit now.
$ sudo dpkg -i raspberrypi-kernel-headers_1.20170703-1_armhf.deb
[sudo] password for volumio:
dpkg: warning: files list file for package 'libgc1c2:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libunistring0:armhf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'guile-2.0-libs:armhf' missing; assuming package has no files currently installed
(Reading database ... 65410 files and directories currently installed.)
Preparing to unpack raspberrypi-kernel-headers_1.20170703-1_armhf.deb ...
Unpacking raspberrypi-kernel-headers (1.20170703-1) over (1.20170703-1) ...
kSetting up raspberrypi-kernel-headers (1.20170703-1) ...
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.9.35+
Error! Bad return status for module build on kernel: 4.9.35+ (aarch64)
Consult /var/lib/dkms/seeed-voicecard/0.3/build/make.log for more information.
run-parts: executing /etc/kernel/header_postinst.d/dkms 4.9.35-v7+
Error! Bad return status for module build on kernel: 4.9.35-v7+ (aarch64)
Consult /var/lib/dkms/seeed-voicecard/0.3/build/make.log for more information.
$ cat /var/lib/dkms/seeed-voicecard/0.3/build/make.log
DKMS make.log for seeed-voicecard-0.3 for kernel 4.9.35-v7+ (aarch64)
Sat Dec 5 00:20:05 UTC 2020
make: Entering directory '/usr/src/linux-headers-4.9.35-v7+'
LD /var/lib/dkms/seeed-voicecard/0.3/build/built-in.o
CC [M] /var/lib/dkms/seeed-voicecard/0.3/build/wm8960.o
gcc: error: unrecognized command line option ‘-mgeneral-regs-only’
scripts/Makefile.build:293: recipe for target '/var/lib/dkms/seeed-voicecard/0.3/build/wm8960.o' failed
make[1]: *** [/var/lib/dkms/seeed-voicecard/0.3/build/wm8960.o] Error 1
Makefile:1490: recipe for target '_module_/var/lib/dkms/seeed-voicecard/0.3/build' failed
make: *** [_module_/var/lib/dkms/seeed-voicecard/0.3/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.9.35-v7+'
According to the berryboot changelog, https://www.berryterminal.com/doku.php/berryboot/changelog , current berryboot is 5.4 based, same as Ubuntu and raspbian...
yes. thats what I hoped to get :\
but apt list -a raspberrypi-kernel
still shows the one from 2017
the kernel only changed a little - from 4.19.49v6v7 to 4.19.127v64
$ uname -a Linux Kallisto 4.19.127v64 #1 SMP PREEMPT Fri Jun 12 22:09:51 CEST 2020 aarch64 GNU/Linux
$ cat /proc/version Linux version 4.19.127v64 (max@lynx) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #1 SMP PREEMPT Fri Jun 12 22:09:51 CEST 2020
You need version-matched header package - apt list -a raspberrypi-kernel-headers
. And you should use a arm64
header package raspberrypi-kernel-headers_1.20170703-1_arm64.deb
?
The "error: unrecognized command line option ‘-mgeneral-regs-only’" comes from armhf/arm64 32-bit/64-bit confusion.
so.. while talking about confusion..
$ uname -a
Linux Kallisto 5.4.73v64 #2 SMP PREEMPT Tue Nov 3 16:11:05 CET 2020 aarch64 GNU/Linux
$ cat /proc/version
Linux version 5.4.73v64 (max@lynx) (gcc version 7.5.0 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)) #2 SMP PREEMPT Tue Nov 3 16:11:05 CET 2020
$ sudo apt list -a raspberrypi-kernel
Listing... Done
raspberrypi-kernel/oldstable 1.20170703-1 armhf
the arm64 header files starting only in 2020.
lets call it a day for now - I learned a lot, thanks for the help and for your patience!
@h4de5 I think that is berryboot - it uses its own kernel (outside of the volumio/raspbian packaging system) to boot the rest of volumio. It is not a bootloader like the one on the x86 desktop. It is more like customisation of kernel + initramfs .
It is an interesting journey for me - didn't know about any of these other distros, and I have been using Linux since it was only about 5 years old! (it is just over 30 now).
I liked berryboot because it would allow me to install, change, add and reuse multiple distros on the same sdcard. I could just add another os and play around, or clone an existing partition before i try out something new. With the iscsi setup backups are even easier.
The downsides seems to surface slowly only now. I often needed special images that allow updates (like volumio and kodi: https://github.com/macmpi/berryboot-scripts) Also HATs like that often ask for additional efforts.
Good to hear that you to learned something ;)
Any more ideas i could go after?
@h4de5 it is a little painful, but since berryboot runs its own kernel, you really needs to have a customized berryboot image to add new kernel modules for hardware drivers such as this. So "HATs ask for additional efforts" is exactly it. For example https://github.com/maxnet/berryboot/issues/631 is somewhat a similar problem.
@HinTak Kodi is running no noobs. would this help?
This is more directly relevant https://github.com/maxnet/berryboot/issues/576
mmh. i think this is part of the upgrade procedure (to manually extract the shared modules)
I did this yesterday as well: https://github.com/maxnet/berryboot/issues/666#issuecomment-739083724
@h4de5 stock volumio (without berryboot) is easiest, I think; berryboot (with anything) requires some customization of the berryboot build process and is next. LibreELEC is missing a lot of dev tools so hardest.
Noobs isn't really relevant - it installs the others as they are.
Berryboot seems small enough, I might have a go at inserting the respeaker driver in there...
and this would be possible? adding a driver?
my issue with berryboot is, that both - the kodi and the volumio on the rpi3 - have other partitions I am currently using. so in this case i may have to put it on a different place altogether. I have two dedicated volumios, but those are running on a rpi0 and they do have HATs installed already (a PHAT Dac for sound output: https://de.pinout.xyz/pinout/phat_dac).
how do you see the chances that they work well together, after the last two days? 🤣
if not, I may have to just postbone the usage of this piece for now. I'll add one (propably) last device in the future anyway and I was thinking about having a normal raspian installation and run volumio as app or from a docker image. I mean, this would be the most straight forward solution anyway, right?
@h4de5 I suspect that how berryboot works, is booting its own kernel while having a (small) addition to the full OSes it boots by adding a "/lib/modules/
Devices with in-tree drivers (I guess your PHAT DAC is) is much easier, but the respeaker driver will be never be in-tree ... See https://github.com/respeaker/seeed-voicecard/issues/213
The problem with the phat dac is that they may use the same gpio pins.. at least thats what i expect after the last two days ;)
In-tree drivers only requires additing a line config.txt to activate (and removing to deactivate). Out-of-tree driver needs to adds a few things to /lib/modules/-kernelversion- , in addition to editing config.txt . Berryboot is tricky because /lib/modules itself comes from the OSes (volumio) but /lib/modules/-kernel version- from berryboot.
dkms and other stuff we covered earlier tries to build and add the respeaker driver to /lib/modules/-kernelversion-, but it requirea compiler and also other relevant stuff (kernel headers) under /lib/modules/-version-/build/
.
Dkms is more or less jus copying the respeaker source to /usr/src and "make; make install" automatically for each new kernel. (hence if you are happy to stay with the same kernel forever, you can live without it)
Edit: stupid markdown did not show angle brackets... Changed them to "-".
Have a look at shared.img
in the berryboot package. During an upgrade I manually extract this file on the first start using berryboots own tty terminal. It holds the modules and the kernel files. If its enough to place them there before volumio can access it, it should work.
Yes, that looks like it - I also just unzipped berryboot, and it looks like what I thought - it is a custom kernel to run the rest of other OSes. So it probably can be rebuilt with the respeaker driver modules included; then it is easier editing config.txt and adding the other scripts on the rest of the OSes.
@h4de5 backup your stuff and have a go with this ? https://github.com/HinTak/berryboot/releases . You mostly want the +respeaker.zip (the *.sig are the accompanying gpg signatures - ignore if you don't know what that is; not important) , in fact perhaps even less - you just need "kernel_rpi64.img" and "shared.img" . They need to be a matching pair - I built from berryboot current, so it is more recent that 5.4.73, and it is 5.4.81:
Linux version 5.4.81v64 (Hin-Tak@localhost.localdomain) (gcc version 10.2.1 20200826 (Red Hat Cross 10.2.1-3) (GCC)) #1 SMP PREEMPT Tue Dec 8 00:15:44 GMT 2020
Please backup your boot folder before you try this (so that you can roll back to your known good berryboot). Then you need a dtoverlay=seeed-4mic-voicecard
line in config.txt . The rest is in userland and in the rest of the OS (alsa in volumio etc).
and its working in volumio/rhasspy assistant.
thank you for your help! couldn't have done it without that.
shall we try to convince berryboot to include your drivers to their upstream?
Cool! I'd be interested to see what you need to do on the OS side (I think it is probably just blindly running install.sh or most of it, and igoring errors...) , and any anomalies when using. And click donate if you feel generous :-).
I have already got a pull on updating the Readme on the 64-bit vanilla build instruction - https://github.com/maxnet/berryboot/pull/674
I have collected a few patches for Berryboot at https://github.com/HinTak/RaspberryPi-Dev/tree/master/patches - mostly because my desktop (fedora 33, a few weeks old) is a lot newer than the berryboot guy's (it seems he is using Ubuntu 18.04, which is 2018 spring), compiler-wise. I just need to write up some instructions from my notes to new arbitrary out-of-tree drivers to berryboot. It is basically build berryboot (which took about 4 hours) plus some extra steps at the end (making additional content for shared.img and re-generate it).
@HinTak I have setup now a completely new volumio on berryboot with your image. which branch from your respeaker repo should I try ? the v5.5 or the v4.19?
@h4de5 v5.5, but it doesn't really matter as the difference is in the c code (the kernel modules) which is already in the modified berryboot. In fact you probably don't need to do anything other than the extra line of "dtoverlay=..." in config.txt.
To be on the safe side I would suggest removing all the "apt-get kernel..." lines so as not to mess up berryboot.
Hello,
I am wondering if it was possible to install and run the 4mic-array on any other OS than raspbian. I would like to install them on Kodi (https://github.com/LibreELEC/LibreELEC.tv) or Volumio (https://github.com/volumio). On both systems the install script fails:
Both systems are running on a RPI4.
kodi:
volumio: