Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
raspberry:audio_injector [2020/02/06 20:13]
admin [I2S Pins]
raspberry:audio_injector [2020/03/05 23:38]
admin [Alsa Mixer Settings]
Line 1: Line 1:
 ===== Audio Injector Installation ===== ===== Audio Injector Installation =====
  
-[[http://www.audioinjector.net/rpi-hat|Audio Injector]] is a audio hat for the [[https://www.raspberrypi.org/|Raspberry Pi]]. This sound card comes with two inputs and two outputs, plus a build in microphone.\\+[[http://www.audioinjector.net/rpi-hat|Audio Injector Stereo Soundcard]] and the [[http://www.audioinjector.net/rpi-zero|Raspberry Zero Soundcard]] by [[http://www.audioinjector.net/|Audio Injector]] are audio hats for the [[https://www.raspberrypi.org/|Raspberry Pi]]. These sound cards comes with two inputs and two outputs, plus a build in microphone.\\
  
-==== Installation === +---- 
-This manual is made for an Raspberry Pi 4 running [[https://www.raspberrypi.org/downloads/raspbian/|Raspian Buster]] on it.\\ +==== Installation ===
-After connecting the Audio Injector to the Raspberry Pi change some configurations, in:+ 
 +This manual is made for an Raspberry Pi 4 running [[https://www.raspberrypi.org/downloads/raspbian/|Raspian Buster]] on it. It's also tested with a Raspberry Pi Zero running Raspian Buster.\\ 
 + 
 +After connecting the Audio Injector to the Raspberry Pi some software should be installed.\\ 
 +First you have to download the deb package from [[http://forum.audioinjector.net/viewtopic.php?f=5&t=3]]. Unpack it: 
 +   $ tar -xf audio.injector.scripts_0.1-1_all.deb.tar.gz 
 +And install it: 
 +   $ sudo apt install ./audio.injector.scripts_0.1-1_all.deb 
 +Change some configurations, in:
    $ sudo nano /boot/config.txt    $ sudo nano /boot/config.txt
 Comment out: Comment out:
Line 14: Line 22:
 Reboot your Raspberry Pi: Reboot your Raspberry Pi:
    $ sudo reboot    $ sudo reboot
-\\ + 
-After the reboot download:+---- 
 +---- 
 +==== Alsa Mixer Settings ==== 
 + 
 +[[https://github.com/Audio-Injector/stereo-and-zero]]\\ 
 +There are two reference alsa mixer files which will allow you to setup default output with either line input or microphone input : 
 +Download:
    $ wget https://github.com/Audio-Injector/stereo-and-zero/archive/master.zip    $ wget https://github.com/Audio-Injector/stereo-and-zero/archive/master.zip
 Unpack it: Unpack it:
    $ unzip master.zip    $ unzip master.zip
 go into the folder: go into the folder:
-   $ cd stereo-and-zero-master/+   $ cd stereo-and-zero-master/audio.injector.scripts-0.1
 and run: and run:
    $ alsactl --file asound.state.MIC.thru.test restore    $ alsactl --file asound.state.MIC.thru.test restore
Line 27: Line 41:
 ---- ----
 ==== Test ==== ==== Test ====
-For testing follow the instructions on [[https://github.com/Audio-Injector/stereo-and-zero]]. Then install sox:+For the 10 kHz test follow the instructions on [[https://github.com/Audio-Injector/stereo-and-zero]].\\ 
 +Then install sox:
    $ sudo apt install sox    $ sudo apt install sox
 In /home/pi/stereo-and-zero-master/ run: In /home/pi/stereo-and-zero-master/ run:
Line 34: Line 49:
  
 ---- ----
-==== I2S Pins ==== +==== Simple Play and Record ==== 
-Beside the power and ground the I2S bus needs the following pins: +Recording:\\ 
-   GPIO 18 (Pin12)    BITCLOCK+   $ arecord -r 48000 -f S16_LE -c 2 -d 20 test.wav 
-   GPIO 19 (Pin 35)   LRCLOCK+Playing back:\\ 
-   GPIO 20 (Pin 38)   DATA IN; +   $ aplay test.wav 
-   GPIO 21 (Pin 40)   DATA OUT;+ 
 +---- 
 +==== I2S and I2C Pins ==== 
 + 
 +The following pins are used by the sound card, don't use them for anything else!\\ 
 +Beside the power (5V and 3V3) and ground (GND) the I2S bus needs the following pins: 
 +   GPIO 18 (Pin12)    BIT CLOCK (BCLK)
 +   GPIO 19 (Pin 35)   IN and OUT LR CLOCK (DACLRC and ADCLRC)
 +   GPIO 20 (Pin 38)   DATA IN (ADCDAT)
 +   GPIO 21 (Pin 40)   DATA OUT (DACDAT); 
 +And the I2C bus needs these pins: 
 +   GPIO 02 (pin 03)   SDIN 
 +   GPIO 03 (pin 05)   SCLK
  
 <html> <html>
Line 45: Line 72:
 </html> </html>
  
-graphic from: +//graphic from: 
-[[https://hifiduino.wordpress.com/2014/11/13/raspberry-pi-b-digital-audio/]]\\+[[https://hifiduino.wordpress.com/2014/11/13/raspberry-pi-b-digital-audio/]]//\\
  
 ---- ----
Line 53: Line 80:
 [[https://github.com/Audio-Injector/stereo-and-zero]]\\ [[https://github.com/Audio-Injector/stereo-and-zero]]\\
 [[https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/raspberry-pi-usage]]\\ [[https://learn.adafruit.com/adafruit-max98357-i2s-class-d-mono-amp/raspberry-pi-usage]]\\
 +[[https://www.richardmudhar.com/blog/2018/07/raspberry-pi-zero-audio-recording-with-the-audioinjector-hat/]]\\
  
 ---- ----