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 Wolfson Audio Capture With DarkIce, How?
  • 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 Verified Answer
  • Replies 17 replies
  • Subscribers 677 subscribers
  • Views 3837 views
  • Users 0 members are here
  • wolfson
  • alsa
  • darkice
  • raspberry_pi
  • raspeberry_pi_accessories
  • icecast
Related

Wolfson Audio Capture With DarkIce, How?

Former Member
Former Member over 11 years ago

Hi all, so I received my Wolfson a few weeks ago and finally got round to working with it image

 

I'm trying to put together an Icecast Source Client via the pi, previously without the wolfson it would glitch and generally cause a substandard broadcast, so I'm hoping with the wolfson I can make a nice cost effective broadcast box.

 

However, I downloaded the wheezy image (Re: Wolfson modified Noobs raspbian zipped img  Cannot unzip new download) with the precompiled drivers in and duely set off compiling Darkice with MP3 support (Live mp3 streaming from audio-in with DarkIce and Icecast2 on Raspberry Pi)

 

My problem however is I've tried selecting the correct device but I just dont know which one it is.

 

I've executed the Record_from_lineIn.sh script to start with and then tried arecorder -l which returns:

**** List of CAPTURE Hardware Devices ****

card 0: sndrpiwsp [snd_rpi_wsp], device 0: WM5102 AiFi wm5102-aif1-0 []

  Subdevices: 1/1

  Subdevice #0: subdevice #0

so I've tried entering hw:0,0 into the darkice.cfg device line and I get the following:

Using config file: /etc/darkice.cfg

Using ALSA DSP input device: hw:0,0

Could not set POSIX real-time scheduling, this may cause recording skips.

Try to run darkice as the super-user.

DarkIce: AlsaDspSource.cpp:173: can't set channels [1]

(also tried it sudo'd but no change)

 

I've also tried device = default but get the same error, also tried options such as snd_rpi_wsp, sndrpiwsp but cant get it to capture effectively.

 

Any ideas what the capture device should be set as for the line in at all (as a start image)

  • Sign in to reply
  • Cancel
  • Former Member
    0 Former Member over 11 years ago

    Hi Leigh!

    Look for channel = 1 in the configuration file. The Wolfson card won't allow anything other than 2 channels.

    This is my darkice.cfg, which works splendidly, streaming mp3: (server name and password have been changed to protect the guilty...)

    [general]
    duration = 0 # duration of encoding, in seconds. 0 means forever
    bufferSecs = 5 # size of internal slip buffer, in seconds
    reconnect = yes # reconnect to the server(s) if disconnected
    
    # this section describes the audio input that will be streamed
    [input]
    device = hw:0,0 # ALSA device
    sampleRate = 44100 # sample rate in Hz. try 11025, 22050 or 44100
    bitsPerSample = 16 # bits per sample. try 16
    channel = 2 # channels. 1 = mono, 2 = stereo
    
    # this section describes a streaming connection to an IceCast2 server
    [icecast2-0]
    format = mp3 # format of the stream: MP3
    bitrateMode = cbr # constant bit rate
    bitrate = 256 # bitrate of the stream sent to the server
    quality = 0.8
    server = www.example.local # host name of the server
    port = 8000 # port of the IceCast2 server, usually 8000
    password = xxxxxx # source password to the IceCast2 server
    mountPoint = liveob # mount point of this stream on the IceCast2 server
    sampleRate = 44100
    channel = 2 # Stereo
    name = OB case # name of the stream
    description = Live from the field # description of the stream
    url = http://www.example.com/liveob # URL related to the stream
    genre = Speech # genre of the stream
    public = no # advertise this stream?
    #localDumpFile = dump.ogg # local dump file

    --

    Ragnar

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

    Thanks for that - spot on! that was easy and I've been streaming now for the last hour without a glitch so looks as it its done the trick!

     

    Darkice seems to be consuming approx 50% cpu at the moment as a point of reference - thats streaming a 96k/44100/stereo/abr track the whole time.

     

    Thanks very much image

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

    Ragnar,

     

    I am having trouble setting the soundcard up with Darkice as well.

    This is the error that I recieve.

     

    Using config file: /etc/darkice.cfg

    Using ALSA DSP input device: hw:0,0

    Using POSIX real-time scheduling, priority 98

    DarkIce: AlsaDspSource.cpp:195: can't set hardware parameters [0]

    • 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 ronlh1

    That one is not as clear-cut...

    I think the card isn't initialized properly.

    Have you run one of the Record_from... scripts first?

     

    Can you post your darkice.cfg? (change passwords first)

    Also try running

      darkice -v9

    to produce more verbose messages and post those.

    --

    Ragnar

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

    Ragnar,

     

    Thanks for replying,

    Yes, I ran script record from line in.

    Also,

     

    pi@raspberrypi ~ $ sudo darkice -v9

    DarkIce 1.0 live audio streamer, http://code.google.com/p/darkice/

    Copyright (c) 2000-2007, Tyrell Hungary, http://tyrell.hu/

    Copyright (c) 2008-2010, Akos Maroy and Rafael Diniz

    This is free software, and you are welcome to redistribute it

    under the terms of The GNU General Public License version 3 or

    any later version.

     

     

    Using config file: /etc/darkice.cfg

    30-Mar-2014 18:19:32 Using ALSA DSP input device: hw:0,0

    30-Mar-2014 18:19:32 encoding

    30-Mar-2014 18:19:32 scheduler high priority 99

    30-Mar-2014 18:19:32 Using POSIX real-time scheduling, priority 98

    DarkIce: AlsaDspSource.cpp:195: can't set hardware parameters [0]

     

     

    Im not sure how to post Darkice .cfg, but here goes:

     

    # sample DarkIce configuration file, edit for your needs before using

    # see the darkice.cfg man page for details

     

    # this section describes general aspects of the live streaming session

    [general]

    duration        = 0         # duration of encoding, in seconds. 0 means forever

    bufferSecs      = 5         # size of internal slip buffer, in seconds

    reconnect       = yes       # reconnect to the server(s) if disconnected

     

    # this section describes the audio input that will be streamed

    [input]

    device          = hw:0,0    # ALSA device

    sampleRate      = 22050     # sample rate in Hz. try 11025, 22050 or 44100

    bitsPerSample   = 16        # bits per sample. try 16

    channel         = 2         # channels. 1 = mono, 2 = stereo

     

    # this section describes a streaming connection to an IceCast2 server

    # there may be up to 8 of these sections, named [icecast2-0] ... [icecast2-7]

    # these can be mixed with [icecast-x] and [shoutcast-x] sections

    [icecast2-0]

    bitrateMode     = abr       # average bit rate

    format          = mp3       # format of the stream: MP3

    bitrate         = 96        # bitrate of the stream sent to the server

    server          = @localhost

                                # host name of the server

    port            = 8000      # port of the IceCast2 server, usually 8000

    password        = test    # source password to the IceCast2 server

    mountPoint      = sample96  # mount point of this stream on the IceCast2 server

    name            = DarkIce trial

                                # name of the stream

    description     = This is only a trial

                                # description of the stream

    url             = @localhost

                                # URL related to the stream

    genre           = my own    # genre of the stream

    public          = yes       # advertise this stream?

    localDumpFile    = dump.ogg  # local dump file

     

    # this section describes a streaming connection to an IceCast server

    # there may be up to 8 of these sections, named [icecast-0] ... [icecast-7]

    # these can be mixed with [icecast2-x] and [shoutcast-x] sections

    [icecast-0]

    bitrateMode     = cbr       # constant bit rate

    bitrate         = 96        # bitrate of the mp3 stream sent to the server

    format          = mp3       # format of the stream: mp3

    quality         = 0.8       # encoding quality

    server          = @localhost

                                # host name of the server

    port            = 8000      # port of the IceCast server, usually 8000

    password        = test    # source password to the IceCast server

    mountPoint      = sample96  # mount point of this stream on the IceCast server

    name            = DarkIce trial

                                # name of the stream

    description     = This is only a trial

                                # description of the stream

    url             = @localhost

                                # URL related to the stream

    genre           = my own    # genre of the stream

    public          = yes       # advertise this stream?

     

    # this section describes a streaming connection to a ShoutCast server

    # there may be up to 8 of these sections, named [shoutcast-0] ... [shoutcast-7]

    # these can be mixed with [icecast-x] and [icecast2-x] sections

    [shoutcast-0]

    bitrateMode     = vbr       # variable bit rate mode

    quality         = 0.5       # encoding quality

    server          = @localhost

                                # host name of the server

    port            = 8001      # source port of the ShoutCast server, usually 8001

    password        = test    # source password to the ShoutCast server

    name            = DarkIce trial

                                # name of the stream

    url             = @localhost

                                # URL related to the stream

    genre           = my own    # genre of the stream

    public          = yes       # advertise this stream?

    irc             = irc.yourserver.com

                                # IRC info related to the stream

    aim             = aim here  # AIM info related to the stream

    icq             = I see you too

                                # ICQ info related to the stream

    • 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 ronlh1

    It's the sampling rate in the [input] section - 22050.

    There is a bug in the drivers, no support for rates below 32000 Re: PJSIP/PJSUA with Wolfson audio card

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

     

    You have a lot of @localhost in there. That won't work, lose the @

     

    Beware of the localDumpFile = dump.ogg

    That will save everything you stream to a file and will fill your card pronto.

    If you look at my config a couple of posts above you'll notice I've commented it out with a hash mark.

     

    And are you really trying to stream to an Icecast2 server [icecast2-0], an Icecast1 server [icecast-0] and a Shoutcast server [shoutcast-0] at the same time?

     

    I'm streaming to an Icecast2 server, so I've just removed the  [icecast-0] and  [shoutcast-0] sections entirely

    --

    Ragnar.

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

    Ragnar,

     

    Thank you very much, works fine now.

    I just have to raise the volume some and I will be good to go.

     

    Thanks again!!image

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

    Hello all

     

    We have been using Pi's for streaming as part of a project to develop a live open microphone network from wild places.

     

    We have had pretty good results using USB soundcards, with some limitations.

     

    Now we are trying the Wolfson audio card.

     

    We have successfully installed the card following very useful instructions here - thank you.

     

    Now we have issues which we have also run into previously and always ended up working around rather than fully understanding or dealing with:

     

    Using the darkice.cfg configuration used successfully by Ragnar above, we get bursts of apparently good quality audio for about 4 second periods, followed by pops and dropouts. The log reports repeated Buffer overruns, which we assume are associated with the dropouts.

     

    We have found various inconclusive threads on this issue, but none that give us a solution or a clear understanding of the problem.

     

    We'd be grateful for your advice.

     

    Thanks

    Grant

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

    following this up:

     

    we have now duplicated Ragnar's settings in the darkice.cfg and done a clean install based on Ragnar's disk image - thank you!

     

    we have also set up a new icecast server and tried streaming to that locally

     

    however, we have the same issues: audio dropouts and darkice reports: Buffer overrun!

     

    Does anybody know what Buffer overrun! is telling us, or how we can address it?

     

    Thank you

     

    Best wishes

    Grant

    • 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 soundcamp

    Buffer overrun is when sound samples are coming in faster than Darkice can get them out.

    Something is slowing Darkice down. Do you have any other CPU-hungry processes running?

    --

    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