Re: alsa plugin data flow for capture

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 {
> &nbsp; &nbsp; type plug
> &nbsp; &nbsp; slave {&nbsp;
> &nbsp; &nbsp; &nbsp; &nbsp; pcm default&nbsp;
> &nbsp; &nbsp; &nbsp; &nbsp; rate 48000
> &nbsp; &nbsp; }
> }
>
> the data flow for aplay :aplay -D myplugdev foobar.wav&nbsp;as follows
> aplay--&gt; myplugdev (plugin named "plug" converts rate) --&gt; default
> --&gt; 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?&nbsp;
> arecord--&gt; hw:0,0-&gt;default-&gt;myplugdev (plugin named "plug" converts
> rate) --&gt; save.wav?
>
>
> It is wired it does not work when I am using a dummy codec to capture&nbsp;
> 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




[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux