Skip to content

Setting up the hardware for the project

Anirban Banik edited this page Aug 8, 2018 · 6 revisions

The hardware setup for the project requires the following main components:

  • PocketBeagle. PocketBeagle
  • USB Audio Device. USB Audio Device
  • Microphone with Automatic Gain Control. Mic
  • USB Breakout Board. Breakout

Circuit Assembly

The entire circuit is connected as shown in the assembly diagram: Assembly

The actual circuit looks like this: Practical

Steps:

  • Boot up the PocketBeagle with the latest Linux image The process of flashing the linux image on a microSD card is described here

  • Connect to the internet to install the required packages, if you are using Windows visit this link or if Linux use this link

  • Make some changes in the ALSA configuration files in order to use the USB Audio device as default.

Edit /usr/share/alsa/alsa.conf

Uncomment this line

load card-specific configuration files (on request)

Edit these lines

defaults.ctl.card 1 (from 0)
defaults.pcm.card 1 (from 0)

Comment out these lines (Just gets rid of some unnecessary ALSA warnings)

# pcm.rear cards.pcm.rear
# pcm.center_lfe cards.pcm.center_lfe
# pcm.side cards.pcm.side
# pcm.hdmi cards.pcm.hdmi
# pcm.modem cards.pcm.modem
# pcm.phoneline cards.pcm.phoneline

Edit /etc/asound.conf

pcm.usb
{
    type hw
    card 1
}
pcm.internal
{
    type hw
    card ALSA
}
pcm.!default
{
    type asym
    playback.pcm
    {
        type plug
        slave.pcm "usb"
    }
    capture.pcm
    {
        type plug
        slave.pcm "usb"
    }
}
ctl.!default
{
    type asym
    playback.pcm
    {
        type plug
        slave.pcm "usb"
    }
    capture.pcm
    {
        type plug
        slave.pcm "usb"
    }

}
  • Testing the gain of the AGC microphone, you can follow the link for details on how to set the gain effectively.

Issues faced with the hardware during the project

I will generally recommend everyone to try to solder male headers to the USB breakout board. I personally used female headers and so had to use additional wires to connect to the PocketBeagle. One thing that I learnt was that for the D+- pins we should try to use wires as short as possible. In my case I had an error -71 in my dmesg logs everytime I connected the USB audio device using this configuration, signifying a power issue, the pocketbeagle was overwhelmed by it, as also signified by some babble errors. One way to tackle the problem is by using a USB powered hub to power the audio device so that it does not draw power from the pocketbeagle, but this too didn't work in my case. All my errors were removed using a rather simple hack, using male headers for the breakout board as well as shorting ID-GND and VB-VI pins on the pocketbeagle directly, like the pic below:this.