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
Rocking Raspberry Pi
  • Challenges & Projects
  • Design Challenges
  • Rocking Raspberry Pi
  • More
  • Cancel
Rocking Raspberry Pi
Blog Raspberry Pi and Karaoke Machine (Wolfson Pi Use and its Limitation)
  • Blog
  • Forum
  • Documents
  • Files
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: babusingh9211
  • Date Created: 18 Apr 2014 6:54 PM Date Created
  • Views 1659 views
  • Likes 2 likes
  • Comments 6 comments
  • wolfson_pi
  • rockingraspberrypi
  • raspberrypi
  • rocking_pi
Related
Recommended

Raspberry Pi and Karaoke Machine (Wolfson Pi Use and its Limitation)

babusingh9211
babusingh9211
18 Apr 2014

Hello everyone,

 

 

This week I’ll post to how to use Wolfson Pi and some limitation that I found in the Wolfson Pi while in use.

 

As previously said I used the technique explained by Ragnar Jensen. So I have attached the “use_case_script” folder it contains the script which helps in selecting your favourite choice of input and output device.

 

I have attached the use_case_script folder as archive in the post. Download and extract it in your /home/pi/ .

 

Now the next step is to select your choice of audio input and output device among the available input and output device.

 

In my case I have selected the Headset as output device and DMIC as Input for that I open the terminal and enter the following commands

 

cd ~/use_case_script
./Playback_to_Headset.sh
./Record_from_DMIC.sh

 

This will select your Headset device as output device and DMIC as your Input device you can also use Headset as input device as well. Or you can experiment with other input and output devices.

 

To record sound from the DMIC enter the following in terminal

 

 

arecord -t wav -d 20 -r 44100 -f dat test.wav

 

 

 

This will record audio with sample rate of 44100 Hz. I don’t know why wolfson pi don’t record 8000Hz or 16000Hz sample rate audio format. And also it doesn’t support 8- bit sample format.

 

To test the recorded sound file test.wav enter the following in terminal.

 

 

aplay test.wav

 

 

Other than this I install audacity to experiment with the audio features in the raspberry pi and wolfson pi.

To install audacity enter the following in terminal

 

 

sudo apt-get install audacity

 

 

Here is screenshot of audacity application which I have installed in my Raspberry Pi. Also you can see the stereo recoreded audio in the screenshot.

 

image

 

But If talking about the limitation according to me when using Wolfson Pi or which I have faced

 

  1. Unable to record 8000Hz/16000Hz sample rate format audio.
  2. Unable to record 8-Bit audio format.
  3. Unable to run 2 or more sound application using wolfson pi at the same time. (So definitely when I use it in karaoke either I hear music or I can loop back my voice).
    Getting error resource or device busy when using 2 sound instances at same time.
  4. And lastly it occupies your GPIO port so that you can unable to connect other devices with it.

 

If you have any problem and query regarding this don’t hesitate to ask I’ll try my best to answer it. If you have any suggestion’ please comment below.

 

 

Regards,


Sumit Rai

Attachments:
use_case_scripts.zip
  • Sign in to reply

Top Comments

  • Former Member
    Former Member over 11 years ago +1
    Hi! I don’t know why wolfson pi don’t record 8000Hz or 16000Hz sample rate audio format Those limitations crept in by mistake. This post explains: Re: PJSIP/PJSUA with Wolfson audio card Unable…
  • Former Member
    Former Member over 11 years ago in reply to babusingh9211 +1
    It seems that if you copy the text from the "view plain" box, extra characters are inserted when you paste it into your editor. I just tested that and I get the exact same errors as you do. Try with the…
  • Former Member
    Former Member over 11 years ago in reply to babusingh9211 +1
    .
Parents
  • Former Member
    Former Member over 11 years ago

    Hi!

     

    I don’t know why wolfson pi don’t record 8000Hz or 16000Hz sample rate audio format

    Those limitations crept in by mistake. This post explains:Re: PJSIP/PJSUA with Wolfson audio card

     

    1. Unable to record 8000Hz/16000Hz sample rate format audio.
    2. Unable to record 8-Bit audio format.
    3. Unable to run 2 or more sound application using wolfson pi at the same time. (So definitely when I use it in karaoke either I hear music or I can loop back my voice).
      Getting error resource or device busy when using 2 sound instances at same time.

    You could try my .asoundrc.

    Save this script as /home/pi/.asoundrc (make a copy of the original first, just to be safe).

    #######################################################################
    #
    # Use libsamplerate instead of internal resampler.
    # You might have to: sudo apt-get install libasound2-plugins
    # Or just comment out the next line if the internal one is good enough for your needs.
    defaults.pcm.rate_converter "samplerate"
    
    ######################################################################
    #
    # Wolfson Audio Card for Raspberry Pi
    #
    pcm.wolfson_pi_soundcard {
      type hw
      card sndrpiwsp
      device 0
    }
    # Create a Master volume control
    pcm.softvol {
      type softvol
      slave {
      pcm "pduplex"
      }
      control {
      name "Master"
      card 0
      }
    }
    
    pcm.!default {
      type asym
      playback.pcm "plug:softvol"
      capture.pcm "pduplex"
    }
    
    #####################################################################
    #
    # Mixing and resampling goodness :-)
    #
    # Several clients can record and play back simultaneously.
    # The dmix and dsnoop plugins operate at 48kHz by default, i.e. the sound card will be kept at 48kHz at all times.
    # All playback streams are converted to 2 channels/48kHz/16bit.
    # All recording streams are converted from the card's 2 channels/48kHz/16bit
    # to the requested number of channels, sample rate and bit depth.
    
    # We define one pcm device called "playmixer" for playback.
    pcm.playmixer {
      ipc_key 140324 # Any number will do, as long as it's unique in the system.
      ipc_key_add_uid true
      type dmix
      slave.pcm "wolfson_pi_soundcard"
    }
    
    # Define another one called "recmixer" for capture.
    # The sound card will run at 48kHz and input is resampled to the requested rate.
    pcm.recmixer {
      ipc_key 140325
      ipc_key_add_uid true
      type dsnoop
      slave.pcm "wolfson_pi_soundcard"
    }
    
    # Define a duplex device, with both in- and outputs.
    pcm.duplex {
      type asym
      playback.pcm "playmixer"
      capture.pcm "recmixer"
    }
    
    # Add a "plug" plugin for the above "duplex" device.
    # This is where all the converting takes place.
    # Sample rate, number of channels, bit depth.
    # By the way, who thought that "plug" was a good name for a plugin?
    #
    # Use this device for all your playback and recording resampling needs.
    pcm.pduplex {
      type plug
      slave.pcm "duplex"
    }
    
    # A ctl device to keep xmms happy
    ctl.pduplex {
      type hw
      card 0
    }
    
    # A DSP to keep the alsa-oss layer happy:
    pcm.dsp0 {
      type plug
      slave.pcm "duplex"
    }
    
    ctl.mixer0 {
      type hw
      card 0
    }

     

    You should now be able to record at 8000 and 16000 and in 8 bit in both mono and stereo, using the "default" device.

    --

    Ragnar

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • babusingh9211
    babusingh9211 over 11 years ago in reply to Former Member

    Hi,

    I am getting error

     

    ALSA lib conf.c:1686:(snd_config_load1) _toplevel_:18:1:Unexpected char
    ALSA lib conf.c:3406:(config_file_open) /home/pi/.asoundrc may be old or corrupted: consider to remove or fix it

     

    Also I have installed the libasound2-plugins.

    Any other suggestion.

     

    ~ Sumit Rai

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to babusingh9211

    It seems that if you copy the text from the "view plain" box, extra characters are inserted when you paste it into your editor.

    I just tested that and I get the exact same errors as you do.

    Try with the "expand source" and copy the text from there.

    --

    Ragnar

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • babusingh9211
    babusingh9211 over 11 years ago in reply to Former Member

    Hi Ragnar,

    You rocked again  image

    Thanks alot, everything is now working.

     

    ~Sumit Rai

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Former Member
    Former Member over 11 years ago in reply to babusingh9211

    image

     

    .

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Former Member
    Former Member over 11 years ago in reply to babusingh9211

    image

     

    .

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