This gives me what I expect, I don't know about the fancy stuff. I can call it from a cron job and get auto-named files every half hour, at 44100 sample rate. ------------ #!/bin/bash # record 15 seconds under 30 minutes # get the date for the file name adate=`date +"%Y-%m-%d_%H-%M"` /usr/bin/arecord -d 1785 -c 2 -D hw:1,0 -f cd -t wav au_$adate.wav # -f cd is a shortcut for format cd (16 bit little endian, 44100, stereo) # [-f S16_LE -c2 -r44100] # -d is duration, -D is device # -D hw:1,0 gets the 2nd soundcard, first device. USB on a Zero -------------- amixer is a useful tool to be familiar with, look at an amixer contents listing for each sound card, and the man page. You don't need pcm.myplugdev here. On 6/3/21, yvonne_cyh <1992184780@xxxxxx> wrote: > Hi All > Could any one tell me how does the data flow like for arecord with alsa > plugin? > I found the description on alsa document, with a plugin definition in > asound.conf > > > pcm.myplugdev { > type plug > slave { > pcm default > rate 48000 > } > } > > the data flow for aplay :aplay -D myplugdev foobar.wav as follows > aplay--> myplugdev (plugin named "plug" converts rate) --> default > --> hw:0,0 > > > > How about the data flow for arecord:aplay -D myplugdev -c 2 -r 48000 > save.wav > should be like this? No matter what sample rate for input source , the > save.wav should always be 48000? > arecord--> hw:0,0->default->myplugdev (plugin named "plug" converts > rate) --> save.wav? > > > It is wired it does not work when I am using a dummy codec to capture > I2S audio data to a file, the sample rate is always the same with the > source, it seems the converts rate plugin does not work. > Who can kindly give me an explanation for it? I am new to alsa. > > > Thanks -- ------------- Education is contagious. _______________________________________________ Alsa-user mailing list Alsa-user@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/alsa-user