element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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
Upcycle It
  • Challenges & Projects
  • Design Challenges
  • Upcycle It
  • More
  • Cancel
Upcycle It
Blog [Upcycle It] Interactive Race Car Driver - Making the Furby Speak
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Workshopshed
  • Date Created: 26 May 2017 10:41 PM Date Created
  • Views 1161 views
  • Likes 6 likes
  • Comments 4 comments
  • alsa
  • upcycled_interactiveracecardriver
  • intel_edison
Related
Recommended

[Upcycle It] Interactive Race Car Driver - Making the Furby Speak

Workshopshed
Workshopshed
26 May 2017

As much as I was enjoying messing about with the mechanical part of the Furby there was still a big unknown for me that I wanted resolved. That was how to get the sound to make the Furby speak. I had considered an I2S audio module as that does seem the more elegant option. However, as I'd already decided to control my Furby using the breakout board that meant that I was working with 1.8v I/O so I2C could be problematic.

 

Instead, I went for the USB option with a cheap USB module from Ebay that mentioned it supported Linux. I'd bought this right at the beginning of the challenge as I'd heard that Ben Heck has gone for USB Audio in his last project. Apart from plugging it into a windows machine to make sure it actually worked I'd not done anything with it..

image

I spotted a few other challengers have already used USB sound so I had a quick read of their articles.

[Upcycle it Design Challenge] Embedded Web SDR client on Analog Radio Receiver #8: Problem with Audio.

Upcycle It - Funeka - The Skull #5 : Ohh, it's music to my ears

Blog Entry #1: Recording and Calibrating the Tockman

 

Looks like aplay is a nice simple way to play the audio file and that can be called from nodejs either as a child process using execFile or via a npm package. These are both asynchronous so I can get on with other things such as making the mouth move whilst the sound is playing.

 

Setup

I booted up the Edison Arduino with the audio card wired in and ran :

lsusb

 

To see all the devices, instead I got an error.

unable to initialize libusb: -99

 

To check that the USB was present I ran

lspci | grep USB

 

And that returned

00:11.0 USB controller: Intel Corporation Device 119e (rev 01)

 

Googling the above error -99 I found that it was simply that I needed to swap SW1 from Device to Host.

 

I repeated the command (and got a strange red light on the Audio card) and the following was returned:

root@Eddie:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0d8c:013c C-Media Electronics, Inc. CM108 Audio Controller
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

Next following the "Rock out with the Edison" article I checked that there was a PCM audio device available.

root@Eddie:~# cat /proc/asound/pcm
00-00: Loopback PCM : Loopback PCM : playback 8 : capture 8
00-01: Loopback PCM : Loopback PCM : playback 8 : capture 8
01-00: 14 :  : playback 1 : capture 1
01-01: ((null)) :  : playback 1 : capture 1
01-02: ((null)) :  : playback 1 : capture 1
02-00: USB Audio : USB Audio : playback 1 : capture 1

 

Next up was checking the playback and audio devices with PulseAudio sound server control

root@Eddie:~# pactl list | grep Name | grep usb
        Name: alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.analog-stereo
        Name: alsa_output.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.analog-stereo.monitor
        Name: alsa_input.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device.analog-mono
        Name: alsa_card.usb-C-Media_Electronics_Inc._USB_PnP_Sound_Device-00-Device

 

Test

I wanted to know if the sound would be loud enough so I plugged in some headphones. I was looking for a test sound to try so I did some googling and found these sounds Electronic Furby: Furby Sounds but I decided to go with http://sounds.stoutman.com/sounds/better.wav  instead.

 

Aplay showed my card listed as card 2: Device

root@Eddie:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 1: dummyaudio [dummy-audio], device 0: 14 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 

So I played the file using "Device" as that is the name of the USB audio.

 

aplay -D default:Device better.wav

 

It's possible to configure the ALSA subsystem so that the USB device is the default so I may do that in the future.

 

Turn it up to 11

The volume from the headphones was not very loud so amplification was necessary. Interestingly, the Furby does not have an audio amplifier although that may be tucked away in the COB#2. So I used a new PAM8302A 2.5W amplifier module.

image

I wired the amplifier supply to the power lines on the USB, IN- to GND, IN+ to one of the audio channels and /SD to +5v. And tested.

image

 

USB On the Go

The Edison mini has micro USB sockets and my sound card had a full sized USB. I could have included an adapter but instead I decided to put on a micro-USB connector with the suitable OTG wiring i.e. pins 4 and 5 shorted, so that it would correctly be detected by the Edison.

 

Here's the connections seen from the plug end.

image

It was at this point I realised I still had an issue powering the Mini-Breakout board. Because of the extra regulator on the J21 route it won't run from the 5v I was producing from my battery box. It would run fine from the USB (at 5v) but I now needed that for the sound card.

The Grove kit came to my rescue in that it had a PP3 to Jack connector. I cropped that off and connected on a 2 pin socket.

I plugged it all together and my audio did not work. I had a little adapter that turns big USB into mini so I used that with a memory stick to check that the port was working. It was, so I returned my audio card to the bench and resoldered the connections. I hooked it back up and this time it was properly detected. So I tested it one last time with the audio file, "I'm feeling better now, I really am".

imageimage

https://youtu.be/i-d8-FxrRbs

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Reference

IntelRegistered Edison Audio Setup Guide

Advanced Linux Sound Architecture

Rock out with Edison

2.5W Class D Audio Amplifier - PAM8302

Max98357 I2S Class D Mono Amp

Maxim - Understanding USB On the Go

Understanding execfile spawn exec and fork in node

How-to-make-your-own-usb-otg-cable-for-an-android-smartphone

 

Previous Posts

Upcycle It Blogs tagged with upcycled_interactiveracecardriver

  • Sign in to reply

Top Comments

  • jasonwier92
    jasonwier92 over 8 years ago +2
    Normal amps only go to 10!
  • mcb1
    mcb1 over 8 years ago +1
    It's all coming together very well. Look like I might need to go shopping for a few more parts .... Mark
  • DAB
    DAB over 8 years ago +1
    Good update. Adding the audio capability would give you a lot of fun options, like ouch sounds if it hits the bumper, "don't Hit Me" output when someone gets near. DAB
  • DAB
    DAB over 8 years ago

    Good update.

     

    Adding the audio capability would give you a lot of fun options, like ouch sounds if it hits the bumper, "don't Hit Me" output when someone gets near.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Workshopshed
    Workshopshed over 8 years ago in reply to jasonwier92

    My thought is that if my Amp goes up to 11 then I can turn it down to a normal level in the software.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jasonwier92
    jasonwier92 over 8 years ago

    Normal amps only go to 10!

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • mcb1
    mcb1 over 8 years ago

    It's all coming together very well.

     

    Look like I might need to go shopping for a few more parts ....

     

     

    Mark

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
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