The problem might be that your recording or playback volume is set to mute.
You can change it using this command alsamixer
, remember to choose the right sound card using F6. Channels can be muted (and un-muted) using M.
Do not forget to save the settings after you change anything,
$ sudo alsactl store 1
If you want to know the detail method to fix your problem then follow this solution,
First of all you do not need to use this command,
$ cat /proc/asound/cards
Simply use this command to see if the Sound card is detected,
$ lsusb
Secondly, There is an issue with the Pi’s USB port that meant it could become overwhelmed with data which causes popping and bubbling noises to be included in your recordings, and sometimes, no output whatsoever.
his can be fixed with an update of the Pi’s firmware:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install rpi-update
sudo rpi-update
After the update is complete, Reboot your Raspberry Pi,
$ sudo shutdown -r now
Now, Let's select the default sound card for Recording and Playback, so run this command to see the number of you USB audio card.
arecord --list-devices
You will get something like:
List of CAPTURE Hardware Devices
card 1: U0x41e0x30d3 [USB Device 0x41e:0x30d3], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
Observe the number of your card from previous output, in my case its 1 (card 1:
)
Now let's look into your Card's available option and what we can change,
$ amixer --card 1 contents
So I want to turn the Auto Gain Control off, and the recording volume to 14:
amixer -c 1 cset numid=7 0
amixer -c 1 cset numid=6 14
In this case,
numid = 7 , It is the id to control 'Auto Gain Control'
numid = 6 , It is the id to set the recording volume.
Store the settings so that they will be used again on a reboot:
$ sudo alsactl store 1
where 1 is the card number.
Remeber your Sound Card number, It will apparently be 1
Let's use this USB card to record the sound now,
arecord -D plughw:1 --duration=10 -f cd -vv ~/rectest.wav
the -vv option displays extra information on the screen as well as a volume meter, this should be peaking at around 95% on the loudest sounds, if it is at 100% all a lot of the time then you are probably recording distortion.
Playback the recording with aplay:
aplay ~/rectest.wav
the default settings will play the wav fie through the TV if it is connected by HDMI, To playback through the USB sound card set the device to the card number, like in arecord:
aplay -D plughw:1 ~/rectest.wav
Remember: plughw:1 , is your card number
This solution is working absolutely fine for me...I have tested it recently. :)
Good Luck