[FFmpeg-user] No Audio from ALSA device on Raspberry Pi

Adam Nielsen a.nielsen at shikadi.net
Mon Jan 31 06:01:12 EET 2022


> Using 'arecord' I am able to record audio. I have a .asoundrc file in my
> home dir and reference the device by the name in there ("-D dmic_sv").

Where is the ffmpeg output from where you tried using this "dmic_sv"
device that works with arecord?

> But, when I try to record with ffmpeg, nothing.
> 
> If I use the device "hw:0" it fails

Does this work with arecord?  If it works with arecord it should work
with ffmpeg.

> pi at cam-08:~/scripts $ ffmpeg -hide_banner -f alsa -channels 1 -sample_rate
> 44100 -i hw:0 -t 30 out.wav
> [alsa @ 0x1997210] cannot open audio device hw:0 (No such file or directory)
> hw:0: Input/output error

hw:0 means card #0, but your device list shows you don't have a card at
index 0 that supports recording:

> pi at cam-08:~/scripts $ arecord -l
> **** List of CAPTURE Hardware Devices ****
> card 1: sndrpii2scard [snd_rpi_i2s_card], device 0: simple-card_codec_link

hw:1,0 looks like the only valid device based on that output (card 1,
device 0).  Since there is no card 0 in the list, anything with hw:0
will return "no such file" (which really means "no such audio device").

> Again, I get a file, but when I play it it seems to have no audio.

It looks like you're passing different device names to arecord and
ffmpeg.  It's probably best to stick to using the same devices for both
otherwise it's difficult to know where the problem is.

Cheers,
Adam.


More information about the ffmpeg-user mailing list