diff --git a/pulseaudio/91-seeedvoicecard.rules b/pulseaudio/91-seeedvoicecard.rules new file mode 100644 index 0000000..8b41dd1 --- /dev/null +++ b/pulseaudio/91-seeedvoicecard.rules @@ -0,0 +1,8 @@ +SUBSYSTEM!="sound", GOTO="seeedvoicecard_end" +ACTION!="change", GOTO="seeedvoicecard_end" +KERNEL!="card*", GOTO="seeedvoicecard_end" + +ATTR{id}=="seeed4micvoicec",ENV{PULSE_PROFILE_SET}="seeed-voicecard-4mic.conf" +ATTR{id}=="seeed8micvoicec",ENV{PULSE_PROFILE_SET}="seeed-voicecard-8mic.conf" + +LABEL="seeedvoicecard_end" \ No newline at end of file diff --git a/pulseaudio/README.md b/pulseaudio/README.md index 24bb5f0..11e6f45 100644 --- a/pulseaudio/README.md +++ b/pulseaudio/README.md @@ -1,10 +1,32 @@ # PulseAudio Configuration for seeed-voicecard -Following this guide if you want to use your seeed-voicecard as a default source/sink of pulseaudio. +Follow this guide if you want to use your seeed-voicecard as a default source/sink of pulseaudio. + +### Prerequisites + +1. Download PulseAudio +``` +sudo apt install -y pulseaudio +``` + +2. PulseAudio Profiles +``` +cd seeed-voicecard/pulseaudio +sudo cp pulse_config_4mic/seeed-voicecard.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/seeed-voicecard-4mic.conf +sudo cp pulse_config_6mic/seeed-voicecard.conf /usr/share/pulseaudio/alsa-mixer/profile-sets/seeed-voicecard-8mic.conf +``` + +3. Add `udev` Rules + +During the system start, when the card "seeed4micvoicec" is detected, the PULSE_PROFILE_SET variable will be set in the udev database, and PulseAudio will be forced to use `seeed-voicecard-4mic.conf`. Similarly, if the card "seeed8micvoicec" is detected, PulseAudio will be forced to use `seeed-voicecard-8mic.conf`. + +``` +sudo cp 91-seeedvoicecard.rules /etc/udev/rules.d/91-seeedvoicecard.rules +``` ### ReSpeaker 4 Mic Array - + -4. config `default.pa` and `daemon.conf` +1. config `default.pa` and `daemon.conf` ``` -sudo cp default.pa /etc/pulse/ -sudo cp daemon.conf /etc/pulse/ +sudo cp pulse_config_4mic/default.pa /etc/pulse/ +sudo cp pulse_config_4mic/daemon.conf /etc/pulse/ ``` -5. reboot raspberry pi and check +2. reboot raspberry pi and check ``` sudo reboot pulseaudio --start # start pulse at first @@ -105,7 +127,7 @@ Cookie: 3b12:70b3 ### 6-Mics Circular Array Kit and 4-Mics Linear Array - + -4. config `default.pa` and `daemon.conf` +1. config `default.pa` and `daemon.conf` ``` -sudo cp default.pa /etc/pulse/ -sudo cp daemon.conf /etc/pulse/ +sudo cp pulse_config_6mic/default.pa /etc/pulse/ +sudo cp pulse_config_6mic/daemon.conf /etc/pulse/ ``` -5. reboot raspberry pi and check +2. reboot raspberry pi and check ``` sudo reboot pulseaudio --start # start pulse at first @@ -221,7 +243,7 @@ Cookie: 3523:e5af 3. How to get PulseAudio started automatically - Normally the PulseAudio server is started automatically. If you want to disable it, you can set `autospawn = no` in `~/.config/pulse/client.conf` or `/etc/pulse/client.conf`. + Normally the PulseAudio server is started automatically. If you want to disable it, you can set `autospawn = no` in `~/.config/pulse/client.conf` or `/etc/pulse/client.conf`. [Click this for more details](https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Running/). 4. Why the default sample rate is 96000? What if my audio's sample rate is not the same as the default?