USB Audio Cards with a Raspberry Pi

Similar documents
Adafruit MAX98357 I2S Class-D Mono Amp

Adafruit Speaker Bonnet for Raspberry Pi

Adafruit I2S Audio Bonnet for Raspberry Pi Created by lady ada. Last updated on :04:10 PM UTC

Adafruit PiUART - USB Console and Power Add-on for Raspberry Pi

IES-PI-HIFI Quick Start Guide

Adafruit MAX98357 I2S Class-D Mono Amp

Adafruit I2S MEMS Microphone Breakout

Adafruit's Raspberry Pi Lesson 6. Using SSH

Adding a Real Time Clock to Raspberry Pi

Adafruit I2S Stereo Decoder - UDA1334A

Setting up a Raspberry Pi as a WiFi access point

Adafruit NFC/RFID on Raspberry Pi

Adafruit NFC/RFID on Raspberry Pi

Adafruit DPI Display Kippah

HABIP-COMMS 2/23/2017 AX.25 Setup Tutorial Matt Zachary Adam Steenkamer

L.I.S.A Linux Client Documentation

Setting up a Raspberry Pi as a WiFi access point

Adafruit Ultimate GPS on the Raspberry Pi

Adafruit Ultimate GPS on the Raspberry Pi

Adafruit DPI Display Kippah

Digital Free Library. Created by Kirby Griese. Last updated on :35:15 PM UTC

igate / Digipeater APRX on a RASPBERRY PI using Soundmodem Monday, 4 August 2014 By PA0ESH For questions sent me an at pa0esh at amsat dot org

Cabinet features. Display features. Picade X HAT features

Manual to install experimental firmware on a TYTERA MD380

& Windows XP. ESC 12/Podcasting Workshop Handout/June 2009/Exec Svcs Tech/Rev 2

RX300 Settings Manual General

Networked Thermal Printer using Raspberry Pi and CUPS

Adafruit's Raspberry Pi Lesson 1. Preparing an SD Card for your Raspberry Pi

Adafruit PiOLED - 128x32 Mini OLED for Raspberry Pi

Getting started with ESP IoT phat

Raspberry Pi Setup Tutorial

By: Yushi Wang Partners: Shen Yue and Yubing Xu Group 6. How to Setup Pandaboard ES Software Environment for UAV Project

-You will need to provide 2 AA batteries and an SD card to use the recorder.

Davide Cavaliere 18 th February 2017

RETROPIE INSTALLATION GUIDE

SeeMeCNC Guides. RAMBo Control Firmware. This guide will show you how to install the firmware on your SeeMeCNC 3D printer.

Adafruit Optical Fingerprint Sensor

Adafruit's Raspberry Pi Lesson 2. First Time Configuration

Adafruit 2.2" PiTFT HAT - 320x240 Display

Circuit Playground Express: Piano in the Key of Lime

XLink Kai Raspberry Pi Beginners Tutorial

7inch HDMI LCD (H) User Manual

Preparing SD card for Pi

ugreen DAB Board Instructions v6

Microcontroller Compatible Audio File Conversion

How to Change the Default Playback & Recording Audio Device. How to Change the Default Playback Device

Adafruit Ultimate GPS HAT for Raspberry Pi

An Illustrated Guide to Shell Magic: Standard I/O & Redirection

Raspberry Pi NTP Clock Setup Guide

Adafruit Ultimate GPS HAT for Raspberry Pi

RaspiDigiHamClock. Raspberry Pi Amateur Radio Digital Clock. v WA4EFH R.Grokett

BeagleBone Black: Installing Operating Systems

Proper Debugging of ATSAMD21 Processors

Programming Microcontrollers using OpenOCD on a Raspberry Pi

Audio Recording. Technology in a Box. Box Contents: USB microphone Audacity Directions. What you can do:

Experimental Procedure. Frequently Asked Questions (FAQ) Kit General Questions. Setting Up and Using Your Raspberry Pi Projects Kit

APPLICATION NOTE. Configuring Audio over IP- Instreamer/Extreamer

Raspberry Pi as a VPN Wireless Access Point

SURROUND SOUND IN LINUX

Introduction. Basic Troubleshooting Tips. Computer Basics What are some troubleshooting techniques? What are Some Troubleshooting Techniques?

Back to the main page Back to the Tutorial Page Digital Audio Rules of Audacity Setup, Audio Import and Playback Recording with Audacity

The computer goes blank before the Word document was saved. The browser window freezes for no reason. You can't hear anything from your speakers.

Isabel Author. 2014/08/05 Date Posted. Rating

Mp3 Player with Speaker. Instruction Manual FOR MODEL NO FIESTA2. Please read this instruction carefully before the operation

Rs-Pi USB- 4 Hub & I2C RS232 User Manual

ToF T1 User Guide. a module solution provider. Date: 2017/02/13. Hardware Test Supervisor. Software Test Engineer. Center Supervisor Rex

AT-LP2D-USB Turntable. Software Guide

Manage Music Iphone 5

FINAL PROJECT: MUSIC SERVER

Microprocessor-Based Systems (E155)

Experiments 1 How to set up Raspberry Pi B+ The little computer you can cook into DIY tech projects

Raspberry Pi Kernel-o-Matic

How to Make a Raspberry Pi Web Server

Rapoo E6700 Setup Instructions

Adafruit 5" and 7" 800x480 TFT HDMI Backpack

Raspberry Pi as an Ad Blocking Access Point

C - Colour Mixing. Let's use the Sparkle module and some switches to make a colour mixer! 2018 courses.techcamp.org.

Lab 0: Intro to running Jupyter Notebook on a Raspberry Pi

INTRODUCTION. To avoid the PHP7 conflicts use this OS image: STEP 1 - Parts List:

SeeMeCNC Guides. Step 5: Installing the Firmware. This guide will show you how to install the firmware on your Rostock MAX v3 3D printer.

4 Ways To Boot Into Safe Mode In Windows 10

Zen Cape Audio Guide. Table of Contents. by Brian Fraser Last update: June 26, 2018

Bluetooth Keyboard Setup Instructions

Grand Central Soundboard in Ten Minutes Created by Mike Barela. Last updated on :11:24 PM UTC

Introducing the Raspberry Pi Model B+

Using a Raspberry Pi to Remote Access a Windows Computer

Raspberry PI 'How-To' Series

How To Sync Iphone To New Itunes Without >>>CLICK HERE<<<

CircuitPython with Jupyter Notebooks

CIS c. University of Pennsylvania Zachary Goldberg. Notes

ECE471: Embedded Systems Homework 7 SPI, A/D and Temperature Probe. Due: Friday, 2 November 2018, 10:00am

User-space SPI TFT Python Library - ILI9341

Programming Scratch to Control a K NEX Fairground Ride

DIY WiFi Raspberry Pi Touchscreen Camera

10.1inch HDMI LCD (B) User Manual

Node-RED Dashboard: Pi Control

D C. TASCAM PCM Recorder. iphone/ipad/ipod touch Application USER'S GUIDE

GNSS Logger Unit with RTKLIB. Tiphat Areeyapinun Shizuoka University

The Stack, Free Store, and Global Namespace

Manual Format Flash Drive For Mac And Pc Use Same

Transcription:

USB Audio Cards with a Raspberry Pi Created by lady ada Last updated on 2017-07-15 12:17:57 AM UTC

Guide Contents Guide Contents Instructions Pre-requisites Figure out your chipset Figure out your chipset CM108 Type If you have CM108 CM-Headphone Type CM109 Type Updating ALSA Config Raspbian Jessie - Updating alsa options Raspbian Wheezy - Updating alsa options Testing Audio Testing! Headphone vs Audio card Setting Audio Levels Recording Audio Troubleshooting! 2 3 3 5 5 6 6 9 10 11 11 11 13 13 13 15 16 17 Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 2 of 17

Instructions The Raspberry Pi has an on-board audio jack, which is super handy for all kinds of sound effects and speech, just plug and go! However, for when you want better audio for music playback, a USB audio card can greatly improve the sound quality and volume, this tutorial will show you how. This guide will also show you how to record audio via the headphone jack on the adapter Pre-requisites First up, you will need a fully set up Raspberry Pi that is otherwise working and you can log into. We have tons of tutorials on that front (http://adafru.it/ckb), so get your SD card loaded with Raspbian (http://adafru.it/awq) (that's what we're using in this tutorial), and either Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 3 of 17

(http://adafru.it/aub)ssh (http://adafru.it/aub) in, log in with a monitor and keyboard, or a USB console cable (http://adafru.it/aua) Just a reminder, this tutorial is only known good for the USB audio card in the Adafruit shop. Audio cards all use different chipsets so if you have another card, it may not work here! You'll have to figure out what's different for your model. Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 4 of 17

Figure out your chipset Figure out your chipset Start by having your Raspi turned off/shutdown (perform a clean shutdown!) and then plugging in your USB audio card. Then boot the Pi as normal. Once you log in, type dmesg grep cm109 to look at the boot messages. You should either see some lines about cm109 if you have a CM109 chipset (http://adafru.it/dgh) (http://adafru.it/kd1) or if nothing comes up, try dmesg grep Headphone you will see the C-Media USB Headphone Set driver. This means its a CM-headphone or if nothing comes up, try dmesg grep C-Media you will see some C-Media notes but no mention of the cm109 driver. This means its a CM108 Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 5 of 17

CM108 Type If you have CM108 If you type in lsusb you should see a reference to C-Media Electronics, Inc. CM108 Audio Adapter We'll need to update the firmware, this requires Internet access but only takes 15 minutes or so. You might want to run sudo apt-get update first if you haven't lately. Then run the following commands in order: sudo apt-get update sudo apt-get upgrade sudo reboot You may see a lot of stuff happening like the below: Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 6 of 17

Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 7 of 17

Now you can go down to the update alsa module options (http://adafru.it/xeo) section Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 8 of 17

CM-Headphone Type Type dmesg to look at the boot messages. You should see a bunch of lines that talk about C-Media USB Headphone Set And if you type in lsusb you should see a reference to C-Media Electronics Audio Adapter but no mention of CM108 and the VID/PID is 0x0d8c:0x00c Nothing special needs to be done! Hurray! Continue on to the Updating ALSA Config section Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 9 of 17

CM109 Type Type dmesg to look at the boot messages. You should see a bunch of lines that talk about cm109 And if you type in lsusb you should see a reference to C-Media Electronics Audio Adapter but no mention of CM108 (http://adafru.it/dgj) Nothing special needs to be done! Hurray! Continue on to the next section Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 10 of 17

Updating ALSA Config Raspbian Jessie - Updating alsa options All we have to do is tell Raspbian to look at "card #1" for the default audio. Card #0 is the built in audio, so this is fairly straightforward. run sudo nano /etc/asound.conf and put the following in the file and save pcm.!default { type hw card 1 } ctl.!default { type hw card 1 } This will make the default PCM (audio) output card #1 and the default control also card #1 Raspbian Wheezy - Updating alsa options Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 11 of 17

If you're using Wheezy, we'll edit the audio system configuration file with sudo nano /etc/modprobe.d/alsa-base.conf For all but the most recent Raspbian Wheezy releases, look for the line that reads: #options snd-usb-audio index=0 Change this to: options snd-usb-audio index=0 Note we removed the # at the start of the line. For the latest Raspbian Wheezy versions, look for this line instead: options snd-usb-audio index=-2 There's no # to remove in this case, just change the index from -2 to 0: options snd-usb-audio index=0 Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 12 of 17

Testing Audio Testing! OK now that you've configured ALSA depending on your OS...that's it! Now reboot with sudo reboot and log in again, you can test with speaker-test by running speaker-test -c2 Which will play white noise through the left and right 'speakers' on the audio card. Once you've got something coming out, try to play an audio file with speaker-test (for WAV files, not MP3) speaker-test -c2 --test=wav -w /usr/share/sounds/alsa/front_center.wav If you want to play a stream of music, you can try sudo apt-get install mpg123 mpg123 http://ice1.somafm.com/u80s-128-mp3 (http://adafru.it/d26) If you want to play MP3's on command, check out this tutorial which covers how to set that up (http://adafru.it/atd) Headphone vs Audio card Don't forget, you still have the built in headphone jack on the Pi, if you edited alsa confit might be called card 1 now (not the default card 0) You can run aplay -l to list the devices Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 13 of 17

If you want to aplay through a specific card, specify card 1 with -D plughw:1,0 or card 0 -D plughw:0,0 etc speaker-test -c2 -D plughw:1,0 aplay --device=hw:1,0 test.wav Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 14 of 17

Setting Audio Levels You can set audio levels for both output and input with alsamixer -c 1 Use the arrow keys and return/escape to set and save the settings. It's a sorta-cute textgraphics system Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 15 of 17

Recording Audio At least with the CM-Headphone type adapter, you can also record audio. arecord --device=hw:1,0 --format S16_LE --rate 44100 -c1 test.wav Will record signed 16-bit (S16_LE) audio at 44100 Hz (--rate 44100) mono (-c1) audio to test.wav. We've noted that any audio input will be echoed out the speakers as well You can have a little VU meter show up if you add to the-v mono command line. Press control-c to quit Once you're done recording you can play back with aplay --device=plughw:1,0 test.wav Adafruit Industries https://learn.adafruit.com/usb-audio-cards-with-a-raspberry-pi Page 16 of 17

Troubleshooting! If you're using a Raspberry Pi and notice the output isnt totally clean, some USB Audio adapters don't like USB-1.2 and produce crackling in the output. You can work around the problem by adding dwc_otg.speed=1 to /boot/cmdline.txt and setting the USB ports to USB- 1.1 mode. You can get user access to the audio hardware with other devices by granting access using sudo usermod -a -G audio username Adafruit Industries Last Updated: 2017-07-15 12:17:56 AM UTC Page 17 of 17