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 now working with pulseaudio
  • 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
  • Replies 7 replies
  • Subscribers 673 subscribers
  • Views 1016 views
  • Users 0 members are here
  • raspberry_pi
  • raspeberry_pi_accessories
Related

Wolfson now working with pulseaudio

Former Member
Former Member over 11 years ago

I was able to get pulseaudio to finally work with Wolfson card.

 

The persistent problem was that when using either the wolfson distro, or ragnar's pulseaudio insisted on having the on-board bcm2835 as the default sound. I tried various ways, modifying pulse's configs to either remove the bcm2835 or elevate the wolfson to default status, but to no avail. Nor could I simply unload the bcm2835 like a kernel module, since it was compiled into the kernel. Funny thing is, no sound came out of the onboard sound, even though pulse had it as default. Strange...

 

I just recompiled the 3.10.25 kernel and made bcm2835 into a kernel module, and then commented it out in /etc/modules. Rebooted and now pulseaudio was forced to make the wolfson the default. The 16/44k flacs played fine. But pulse regularly chokes with hi-res files because it tries to resample down to 44k, so to play the sampler provided by wolfson, you should set the alternate-sampling-rate to 96000 in /etc/pulse/daemon.conf, and now everything plays fine. I don't know if I have to up that to 192000 for 192k files, but I don't have any such music to test.

 

I should have gone this route long ago, but didn't have the patience to compile the kernel on the Pi. Can those of you who compile the kernel a lot tell me what the best way to cross compile it on my Mac would be? I tried a few methods outlined on some blogs, and they didn't work. It would be great if I can speed up the compiling process, so that I could then look into optimizing the kernel and all of Raspbian for working with the wolfson card.

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

    I find it really strange that you couldn't get pulseaudio to work with wolfson. Here it worked pretty much out of the box once I told it to use it.

     

    On ragnar's image, you can instruct pa to use the wolfson by adding this line to /etc/pulseaudio/default.pa if running per user session, or to /etc/pulseaudio/system.pa if running as system daemon:

     

    set-default-sink 1

     

    Where "1" is the index of the wolfson that you get from

    $ pacmd list-cards

    or

    $ pactl list.

    if you are running it as system daemon (pacmd seems to be incapable of finding the running daemon).

     

    I haven't tried the HD files (are they even in ragnar's image? I couldn't find them) and don't have any other lying around, but I've playing around with it playing from different sources, and it works flawlessly.

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

    There are no HD audio files included in my image, since it's just a patched standard Raspbian from the Foundation.

    You can find a bunch of HD files here: http://www.2l.no/hires/

    --

    Ragnar

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

    God, I feel like such an idiot.

     

    Yep, Jose, I did try setting:

     

    set-default-sink 1

     

    in the /etc/pulse/default.pa. It was one of the first things I tried. However, I couldn't hear anything, because I was only playing around with the samples from Wolfson, and they refused to play.

     

    So, I revisited this problem again after imaging Ragnar's version, and this time I had some 16/44.1k files and they played perfectly fine. Turns out, it's pulseaudio's fault for not being able to play 24/96k files, not the provided kernel or the wolfson card.

     

    My logic got screwed up somewhere image. Well, at least now I have a shiny kernel that's optimized for music. Thanks.

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

    Oh, I know that stupid feeling when dealing with pulseaudio. It is a wonderful piece of software, but it isn't exactly friendly with non-standard desktop setups, so sorry for the pedantic comment above: you never know what people may or may not have found when dealing with PA.


    Totally off-topic, but I can't think of a better place to ask: Has anybody gotten pacmd to work with the system daemon? I get "No pulseaudio daemon" every time I try to use it. pactl works, though.

     

    Also off topic: any experience getting RTP to work? I spent all of yesterday trying to get it to work; I had a linux machine broadcasting RTP to the LAN, with the pi connected through ethernet and wifi, and no sound, no matter how I tweaked PA's settings and modules. Then, after a couple of hours after giving up on it, I unplugged the ethernet cable on the Pi, and ANOTHER machine that I had forgotten was configured to receive RTP audio started blasting the linux machine's stream. Any pointers on where to start trying to figure out what is going on with RTP in the LAN?

     

    I'll try the HD files linked by ragnar when I get home, just to make sure the audio stack part works.

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

    Jose,

     

    I did get it to work one time in system mode. I'll try to see if I could recreate it. I remember I had to enable a few X11 stuff, export a couple ENV vars, and execute pacmd as the 'pulse' user. Yes, it was ugly, but that seemed to be the only way to get to execute and overcome the so-called security measures built into PA.

     

    I'm curious, though, is there a specific reason why you need to run it in system mode? I personally like funneling everything to PA using 'per-user' mode, as it simplifies configuring, testing, and ultimately using all over the home. You probably know, but both pactl and pacmd works in per-user mode.

     

    The link Ragnar posted points to a different place than where I got my sample files. I got mine off this very site, on the main Wolfson Audio card product page. On the rightmost tab there's a link to download the whole sampler set. Ragnar's link has samples of DSD files (which, sad to say, the wolfson card can't play), as well as some 24/192k files.

     

    I downloaded some of these to test, and found yet another problem with pulseaudio. My PA config thus far played both 16/44.1 and 24/96k files fine, but wouldn't play the 24/192k files. Fine, I thought. I just upped the alternate-sample-rate to 192000 in /etc/pulse/daemon.conf, which then played these files fine, but would choke on the lesser files. Reverting back to alternate-sample-rate = 96000 would play the lesser files fine, but would choke on the 192k. Each time, I see in the logs (produced by pulseaudio -vvvvv), messages of rewinding over and over again, AND complaints about wolfson's arizona(?) something or rather before segfaulting.

     

    Needless to say, you seem way ahead of me in having figured out the card with PA, since I'm still tinkering with bitrates while you're already testing out RTP over the network (I hope to get there soon), but have you been able to play 44.1k, 96k, AND 192k with the same PA config?

     

    Also, if I may ask: what version of PA are you using? The stock 2.0 version from the official repo, or later version from the PA site? I may try compiling one of the newer version and see how that works before I drop it. Yes, it's very nice piece of software, but very confusing and unwieldy. I'm wondering if something like jack can be a replacement...

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

    Well, maybe I'm too old fashioned, but I am very attached to the idea that a hardware management service like audio should not be user confined... Specially in a headless machine, where there are no real "users". I guess it makes no sense fighting with PA on this... I was just trying to replicate the setup I had in my old x86 music server (which is what I am trying to replace with the pi as music player), but that was a less ambitious setup.

     

    If I were to run PA as per-user sessions, would I be able to grant access to the daemons that require audio, or would they have to run as the "pi" user?

     

    Everything related to PA is with official binaries from debian repos. I have only compiled some client apps locally (ie, an mpd fork, gmedia-renderer, that kind of stuff).

     

    If I'm ahead of you, it is only because I have not tried to do any fancy stuff, just getting the advertised PA features to work. HD files do play fine if you specify the proper alternate-sampling-rate, but having it hardcoded in the conf file is clearly unacceptable. I guess PA is just not designed for this kind of stuff. For the record: the RTP issues I'm having seem to be outside PA, because tcpdump does not show any RTP traffic at all on the Pi... I blame the wifi dongle I had attached, but I have not tested extensively.

     

    Bottomline: I have actually thought a lot about not using PA at all. It seems to be too much "consuemr-oriented" for any non-standard (ie, headless, X-less) setup. The obvios alternative would be JACK, but the last time I tried it, I was completely incapable of getting it to do anything, but that was years ago and I didn't try that hard. Do you have any experience with JACK?

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

    I make every audio request run as the 'pi' user. Although I guess you can fudge it to allow access via group that pi belongs in. Or in an entirely different group like 'pa-audio' or something and put 'pi' in there along with other users.

     

    PA is a PITA, in that it always tries to resample and the parameters are hardcoded. But it's gotten better, as previous versions was only limited to 44.1k. At least now it allows for a couple of different rates. I also see how it has to resample things, since one of its core features is to distribute the music to other devices that probably require it.

     

    I don't have any experience with Jack. From what I can tell, it doesn't have as many features as PA and seems geared more toward music creation rather than consumption. I'm going to try hand compiling a more updated version of PA before I start on Jack, though.

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