I just began to learn about raspberry pi. Now I can record from shell instruction using arecord, but I want record by using C code, can you tell me how to do that ?
Well, that is a big and complex subject...
I would suggest you start out by checking out these links:
Study the source code of arecord/aplay and the other ALSA utilities. https://gitorious.org/alsa/alsa-utils
And, of course the API reference: ALSA project - the C library reference: Index Preamble and License
Thanks a lot!
You are so cool!
It has been a couple more months, any progress? For me the board is more or less useless if it can not be used with the standard up to date kernel. This just run a froozen kernel is a trap I cannot afford to fall into again. I appreciate the work Ragnar has done here and he is to be commended, but for this to be usable their needs to be a deb with the drivers for the current release available.
Hi Andy (or other Colleagues at E14)
Any news on the Wolfson Drivers deb package? I fully endorse Richard's post of 25th May and cannot understand why there hasn't even been a response to it during the three weeks since his posting. Surely the deb packages should have arrived shortly after your posting on March 24, not that we should be waiting for a further 3 months. Is it even still being worked on by Wolfson/E14? please advise us of the current expected timing for these to be added to the Raspbian repository?
Thanks & regards
I tried the Wolfson provided Raspian image with success. The audio output was excellent. But I couldn't expand the file system from 6GB to 16GB, which was disappointing.
I also tried your patched image but didn't get any sound. For example, VLC player claims the audio output for wolfson is already occupied and busy. (I can give verbatim error messages if needed) And I changed the VLC output settings too. And Music Player won't give me any audio either. I understand a reboot is required for the drivers to start working. Is this where I could've gone wrong? Because I updated and installed apps before rebooting. Any advice? Thanks.
You say you 'updated'. If you mean you updated Raspian that might not be a good idea, as the Wolfson drivers are not yet included in the standard Raspian distribution, so updating the OS might produce unexpected results.
You don't say what output you are trying to use (line-out, SPDIF etc). It might be an idea to connect to the Pi from your main computer via SSH, and run the 'alsamixer' command (if you are running 'headless'). Maybe your outputs are currently 'muted'?
For example, VLC player claims the audio output for wolfson is already occupied and busy. (I can give verbatim error messages if needed)
Yes, please do that.
And I changed the VLC output settings too.
From what to what?
And Music Player won't give me any audio either. I understand a reboot is required for the drivers to start working. Is this where I could've gone wrong? Because I updated and installed apps before rebooting.
A reboot is only needed once to get the drivers going. That you installed apps before the reboot shouldn't matter..
But, as tyres2 notes, what did you "update"? Which commands did you issue?
Please post the output of these commands:
- cat /proc/version
- uname -a
- aplay -l
- cat ~/.asoundrc
VLC says "the audio device "default" could not be used: Device or resource busy"
I also tried ALSA snd_rpi_wsp and bcm2835. Neither options worked.
i rebooted once because I needed to do so after raspi-config. After that I did apt-get update and rebooted once more. It would not let me install anything until I did. Which I don't have verbatim error messages of. Something about E/: and permissions issues,
cat /proc/version: Linux version 3.10.25_Wolfson+ (ragnar@kernel) (gcc version 4.7.1 20120402 (prerelease) (cross tool -NG 1.15.2) #1 PREEMPT Fri Feb 21 00:03:14 CET 2014
uname -a: Linux raspberrypi 3.10.25_Wolfson+ #1 PREEMPT Fri Feb 21 00:03:14 CET 2014 armv6l GNU/Linux
aplay -l: **** List of PLAYBACK Hardware Devices ****
card 0: sndrpiwsp [snd_rpi_wsp], device 0: WM5102 AiFi wm5102-aif1-0 
Subdevice #0: subdevice #0
card 1: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
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
root@raspberrypi:~# cat ¬/.asoundrc
cat: ¬/.asoundrc: No such file or directory
(oh no, I thought I used a tilde on that last one. My keyboard profile has not been set. and my screen is all aliased so I can't tell. Disable over scanning doesnt fix the size either)
You have my kernel installed OK and the Wolfson card is visible as card 0.
snd_rpi_wsp is the Wolfson and bcm2835 is the Raspberry's built-in audio.
So far, so good.
But the message "the audio device "default" could not be used: Device or resource busy" indicates that some other audio player is occupying the Wolfson card.
Which audio applications have you installed? Some install a server daemon that starts automatically at boot and claims the sound card for itself.
To find out which app that is using the sound card run this command:
fuser -v /dev/snd/*
And I'm still interested in your ~/.asoundrc
Ive installed two other programs other than the ones you suggested in the desktop text file, VLC and Audacity.
And I found the tilde:
pi@raspberrypi ~ $ cat ~/.asoundrc
# Wolfson Audio Card for Raspberry Pi
oddly I don't see snd in VLC anymore. And I still can't get anything from the 3.5 jack. Any advice? Thanks.
Your ~/.asoundrc looks OK.
And I still can't get anything from the 3.5 jack.
Which jack is that? A RPi with Wolfson has four 3.5 jacks.
You did remember to run the "Playback_to...sh" script to put sound on the output you want?
Try playing something from the command line with aplay:
aplay -vv some_file.wav aplay -vv -Dhw:1 some_file.wav # This will try to play on the RPi's built-in audio
and post the output.
And the output from
fuser -v /dev/snd/*
when no audio applications are running.
bash: ./Playback_to_Headset.sh: No such file or directory
and when I typed "fuser -v /dev/snd/*" into terminal I get nothing
The use case scripts reside in the folder use_case_scripts.
cd ~/use_case_scripts ./Playback_to_Headset.sh
- cd ~/use_case_scripts
all I got was this as a result:
amixer: Cannot find the given element from control hw:0 (but the same thing for 11 lines)
I deleted my original zip download and the img of the above file. I have downloaded it again, but all the unzip programs I try will not unzip it, ( say no unzip sig).
I have painfully downloaded it again and still no joy with unzipping.
Have you changed the file recently?
Please, please publish the md5 sum for this file! (so I can eliminate download errors)