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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Raspberry PI Wolfson Audio card and ALSA
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 5 replies
  • Subscribers 676 subscribers
  • Views 677 views
  • Users 0 members are here
Related

Raspberry PI Wolfson Audio card and ALSA

kjciszewski
kjciszewski over 11 years ago

I'm working with some code from an article "Introduction to Sound Programming with ALSA" from Linux Journal (http://www.linuxjournal.com/article/6735), from around 2004. It looked interesting, so I took the "listing3" and "listing4" files and compiled them (gcc filename.c -lasound).

 

I have a Wolfson audio card installed on a PI. I have been able to get the "listing4" recording program compiled and recording, and I can playback the "sound.raw" files created using the "aplay" scripts that Ragnar Jensen provided recently. Getting the "listing3" playback program to play back has all kinds of errors, mostly "underrun" errors. I did notice that the files played using the "aplay" scripts sounded faster (up-tempo) than the original recording.

 

I was wondering if anyone would take a look at this and see what might be going on.

 

Thanks!

 
Posts: 21
Joined: Sat Aug 11, 2012 2:20 pm

  

  • Sign in to reply
  • Cancel
Parents
  • royleith
    0 royleith over 11 years ago

    Kenneth,

     

    Are you using a Class 10 SD card? I found that a good quality Class 4 card still caused stuttering on HD playback and underrun errors might be an indicator of low SD card data transfer. It would be unusual for playback software to slow down the tempo. If it did so, there would be a commensurate dropping in audio pitch. However, audio buffer underruns might leave many short silences which can be perceived as a slower tempo as the brain cannot 'hear' short silences.

     

    Roy Leith

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • kjciszewski
    0 kjciszewski over 11 years ago in reply to royleith

    The card is marked "10", so I think it is class 10.

     

     

    Do you know how the sampling rates for record and playback are set for the Wolfson device?  I did some testing--the card appears to support 44100, 48000, 96000, and 192000 codec rates, but nothing slower (using Ragnar Jensen's record and play scripts) in a loop around mode.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 11 years ago in reply to kjciszewski

    I have the root file system mounted on hard drives or USB memory sticks on all my RPIs.

    I have seen the underrun errors when playing back from old, slow memory sticks.

     

    Class 10 cards are optimized for sequential reading and writing of very large files, i.e. video. They often don't work well for file systems with many small files, especially if the file system gets fragmented. Class 4 or 6 cards are many times a better choice.

     

    There is a bug in the Wolfson driver; sample rates below 32K are not supported. http://www.element14.com/community/message/107271/l/re-pjsippjsua-with-wolfson-audio-card#107271

    Usable sample rates are 32000, 44100, 48000, 88200, 96000, 176400 and 192000.

     

    I have tested "listing3". It works OK on my Pis, playing back from HDD.

    --

    Ragnar

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • kjciszewski
    0 kjciszewski over 11 years ago in reply to Former Member

    Thanks, Ragnar, for taking the time to investigate this.  What brand of HDD do you use?  I assume it's a USB type of some sort.

     

    I have a small USB hard drive from about three years ago (Verbatim AC320GB) that I might want to use for this purpose.  It's a FAT32 format when plugged into a Windows 7 machine.  I don't know (because I don't know a lot about Linux) what the required format for an HDD is for a PI running Raspian, so perhaps you could enlighten me.

     

    Is there information somewhere on how to mount the root file system on an HDD or USB stick?

     

    I apologize for asking so many questions, but I am not very far up the Linux learning curve, so I often need some help.  You a

    have been a great help.

     

    Thanks again.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • kjciszewski
    0 kjciszewski over 11 years ago in reply to Former Member

    Thanks, Ragnar, for taking the time to investigate this.  What brand of HDD do you use?  I assume it's a USB type of some sort.

     

    I have a small USB hard drive from about three years ago (Verbatim AC320GB) that I might want to use for this purpose.  It's a FAT32 format when plugged into a Windows 7 machine.  I don't know (because I don't know a lot about Linux) what the required format for an HDD is for a PI running Raspian, so perhaps you could enlighten me.

     

    Is there information somewhere on how to mount the root file system on an HDD or USB stick?

     

    I apologize for asking so many questions, but I am not very far up the Linux learning curve, so I often need some help.  You a

    have been a great help.

     

    Thanks again.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
  • Former Member
    0 Former Member over 11 years ago in reply to kjciszewski

    Thanks, Ragnar, for taking the time to investigate this. What brand of HDD do you use? I assume it's a USB type of some sort.

    I have more than a dozen different USB HDDs; Verbatim, Western Digital, LaCie... Also some generic enclosures together with USB to eSATA adapters and some USB/eSATA docking stations where I use drives from the small mountain of drives I have in the garage...image

     

     

     

    I have a small USB hard drive from about three years ago (Verbatim AC320GB) that I might want to use for this purpose.

    That one is bus powered (if it is this one) and that is where one might get into trouble. It gets its power from the USB socket. The RPi cannot supply the amount of current the drive needs from its USB ports, so the drive has to be connected through an USB hub that has its own power supply. Furthermore, some bus powered drives draw so much current that a single USB socket cannot cope. That can be remedied by using an USB Y cable to power the drive from two of the hub's USB ports. I have two drives, a Verbatim and a Western Digital, that need an Y cable.

     

    It's a FAT32 format when plugged into a Windows 7 machine. I don't know (because I don't know a lot about Linux) what the required format for an HDD is for a PI running Raspian, so perhaps you could enlighten me.

    ext2 or ext4 are the standard file system types in Linux. They are basically the same, the big difference being that ext4 has journaling that makes it more robust and more likely to survive a sudden crash. Journaling creates more writing activity though, so ext4 is often not used on memory cards. I use ext4 on all my RPi-connected HDDs.

     

     

    Is there information somewhere on how to mount the root file system on an HDD or USB stick?

    http://www.raspberrypi.org/forums/viewtopic.php?f=29&t=44177

     

     

    I apologize for asking so many questions, but I am not very far up the Linux learning curve, so I often need some help.

    No problem at all image

    --

    Ragnar

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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