element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs Pi3 Jessie Audio for USB Microphone Input and RPi3 3.5mm Jack Output
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: alanmcdonley
  • Date Created: 1 May 2016 6:51 PM Date Created
  • Views 422 views
  • Likes 1 like
  • Comments 0 comments
Related
Recommended

Pi3 Jessie Audio for USB Microphone Input and RPi3 3.5mm Jack Output

alanmcdonley
alanmcdonley
1 May 2016

This is how I configured my Raspberry Pi3 for USB Microphone input, and RPi3 3.5mm jack audio output (headphones/speakers)

 

=== My hardware:

Processor: Raspberry Pi3  (Thank you element14 Roadtest...)

Firmware: (uname -a) 4.1.19-v7+

OS: (cat /etc/os-release) Raspbian Jessie-lite

Audio out: speakers attached to  RPi3  3.5mm jack  (the built in RPi Broadcom device)

Audio in: using USB microphone (Kinobo Usb 2.0 Microphone - "Akiro" Mic )

 

(This is called a "split device" in ALSA because pcm audio comes in on one device and out on another. )

 

(  alsa  / ALSA  stand for Advanced Linux Sound Architecture  which is a feature of the Debian/Raspbian Linux OS )

 

=== first see if audio output works the way you want (auto) ===

Test audio out:

    aplay /usr/share/sounds/alsa/Front_Center.wav

 

===== If no sound: Set output device for desired audio output device (0=auto, 1=analog, 2=HDMI):

amixer        (to see current setting)

sudo amixer cset numid=3 1    (set to output sound to 3.5mm jack)

(up arrow till) aplay /usr/share/sounds/alsa/Front_Center.wav

 

========== If audio output is too soft =======

if soft:  alsamixer

          s (select card)

          downarrow to “0 bcm2835 ALSA”

          8      (4=default loudness, 8=100%, 9=125%)

          Escape (press Esc)

then make setting default:

   sudo alsactl store 0

 

==== List USB devices to be sure microphone is seen ====

lsusb         to list all usb devices

 

Bus 001 Device 007: ID  ...                        <-- my flash drive

Bus 001 Device 006: ID 062a:4104 Creative Labs     <-- my wireless keyboard/mouse  (no mouse)

Bus 001 Device 005: ID 045e:0773 Microsoft Corp.   <-- my Microsoft mouse

Bus 001 Device 004: ID 0c76:160a JMTek, LLC.       <-- my USB microphone  ********* we're good

Bus 001 Device 003: ... SMSC9512/9514 Fast Ethernet Adapter (wired)

Bus 001 Device 002: ... 9514 USB Hub  (root->four usb hub)

Bus 001 Device 001: ... root usb hub  (processor interface)

 

Pi3 Port Physical Layout

Eth  004  007

003  005  006

 

So system knows about my microphone

 

==== try a recording (hold the mic close for this test!) ====

  arecord -D plughw:1,0 -d 7 -c 1 test.wav

      say  "This is seven seconds of 8k 8bit unsigned mono audio"

and another:

   arecord -D plughw:1,0 -d 7 -f S16_LE -r 48000 -c 1 test48.wav

      say  "This is seven seconds of signed 16 bit little endian 48k mono audio"

play it back:

   aplay test.wav

     ( scratchy recording but it works )

   aplay test48.wav

     ( slightly less scratchy with higher sample rate)

 

==== make USB mic the default input device ====

ls /etc/asound.conf

(there is probably no /etc/asound.conf file, this creates)

sudo nano /etc/asound.conf

enter:

pcm.!default {

  type asym

  playback.pcm {

     type plug

     slave.pcm "hw:0,0"

  }

  capture.pcm {

     type plug

     slave.pcm "hw:1,0"

  }

}

 

press ctnl-o     "the letter O" to write a file

press Enter/return

press cntl-x     to exit

 

==========resetting alsa after changes =======

sudo alsactl kill rescan

 

===== test with default devices =====

arecord -d 7 testdefault.wav

  say "default 7 second recording unsigned 8 bit 8k mono audio"

aplay testdefault.wav

 

====== DONE for now ========

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube