Script for i2c HAT detection and configuration on a Raspberry Pi
Scripts in this repo require sudo access to use and install
currently only apt based OS
Clone this repository.
git clone https://github.com/OpenVoiceOS/ovos-i2csound
Change into the ovos-i2csound
directory.
cd ovos-i2csound
Run the install script.
sudo ./install.sh
Reboot for the changes to take effect.
This script does several things to enable auto detection of a variety of i2c
sound cards for the Raspberry Pi. (A list of supported devices, or soon to be supported devices can be found in the ovos-i2csound
script) PR's are always welcome to support more devices.
The install.sh
script is an auto installer for ovos-i2csound
. It will check for the required apt packages and install them if needed. It then copies the rest of the scripts used to the required directories on the host system. After installation, it is safe to delete this directory.
Place the following files in the respective directory, and reboot your system.
i2c.conf
-> /etc/modules-load.d/i2c.conf
bcm2835-alsa.conf
-> /etc/modules-load.d/bcm2835-alsa.conf
i2csound.service
-> /etc/systemd/system/i2csound.service
ovos-i2csound
-> /usr/libexec/ovos-i2csound
99-i2c.rules
-> /usr/lib/udev/rules.d/99-i2c.rules
Create the directory for ovos-i2csound to store a variable in
sudo mkdir /etc/OpenVoiceOS
When installed and enabled, this script will run at boot time and try to detect the attached card if any. If a supported card is detected, ovos-i2csound will setup Alsa to the correct values for that card.
Also, as an added feature, when a card is detected, a file will be created at /etc/OpenVoiceOS/i2c_platform
. It contains a single line with the name of the card detected.
This file can be read and used as validation for plugins, or any other use you may find.
If the file does not exist, ovos-i2csound ran, but did not find a supported card.
Issues can be made here