Re: [Alsa-user] arecord format-conversion

2019-11-06 Thread Alex Vazquez
Hi Clemens!
Yes, arecord use my "default" device. In fact, with the S32_LE format
the recording is recorded correctly.

arecord -v -r 16000 -f S32_LE -c 1 -d 3 rec.wav
Recording WAVE 'rec.wav' : Signed 32 bit Little Endian, Rate 16000 Hz, Mono
Plug PCM: Hardware PCM card 0 ' ' device 4 subdevice 0

El jue., 7 nov. 2019 a las 8:04, Clemens Ladisch via Alsa-user
() escribió:
>
> Alex Vazquez wrote:
> > pcm.!default {
> > ...
> >
> > arecord -r 16000 -f S16_LE -c 1 -d 3 rec.wav
> > Recording WAVE 'rec.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
> > arecord: set_params:1361: Unable to install hw params:
>
> Please check with the -v option whether it actually uses your "default" 
> device.
>
>
> Regards,
> Clemens
>
>
> ___
> Alsa-user mailing list
> Alsa-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user


___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] arecord format-conversion

2019-11-06 Thread Alex Vazquez
Hi, Chris.

arecord -D plughw:0,4 --dump-hw-params
Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
HW Params of device "plughw:0,4":

ACCESS:  MMAP_INTERLEAVED MMAP_NONINTERLEAVED MMAP_COMPLEX RW_INTERLEAVED RW_NON
INTERLEAVED
FORMAT:  S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE U24_LE U24_BE S32_LE S3
2_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_BE MU_LAW A_LAW IMA_ADPC
M S24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3B
E U18_3LE U18_3BE
SUBFORMAT:  STD
SAMPLE_BITS: [4 64]
FRAME_BITS: [4 64]
CHANNELS: [1 1]
RATE: [4000 4294967295)
PERIOD_TIME: (31 64000]
PERIOD_SIZE: (0 274877907)
PERIOD_BYTES: (0 4294967295)
PERIODS: (0 4294967295]
BUFFER_TIME: [1 4294967295]
BUFFER_SIZE: [1 1649267441]
BUFFER_BYTES: [1 4294967295]
TICK_TIME: ALL

arecord: set_params:1361: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  U8
SUBFORMAT:  STD
SAMPLE_BITS: 8
FRAME_BITS: 8
CHANNELS: 1
RATE: 8000
PERIOD_TIME: 64000
PERIOD_SIZE: 512
PERIOD_BYTES: 512
PERIODS: 6
BUFFER_TIME: 384000
BUFFER_SIZE: 3072
BUFFER_BYTES: 3072
TICK_TIME: 0

A similar error occurs in this case, fails with the U8 format.



El jue., 7 nov. 2019 a las 2:20, chris hermansen
() escribió:
>
> Alex and list;
>
> On Wed, Nov 6, 2019 at 1:26 PM Alex Vazquez  wrote:
>>
>> Hi all.
>> I'm using ALSA to configure a dmic. My dmic only support format S32_LE
>> but I also need support format S16_LE.
>>
>> arecord -D hw:0,4 --dump-hw-params
>> Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
>> HW Params of device "hw:0,4":
>> 
>> ACCESS:  RW_INTERLEAVED
>> FORMAT:  S32_LE
>> ..
>> Available formats:
>> - S32_LE
>
>
> What about trying
>
> arecord -D plughw:0,4 --dump-hw-params
>>
>>
>> If I understood correctly, If I use "plug" plugin, it create an
>> automatic format-conversion. To do so, I create a custom asounf.conf
>> using the "plug" plugin.
>>
>> pcm.!default {
>> type asym
>> playback.pcm {
>> type plug
>> slave.pcm "hw:0,0"
>> }
>> capture.pcm {
>> type plug
>> slave.pcm "hw:0,4"
>> }
>>
>> For a quick example, I used the arecord command. First I use S32_LE
>> and it works.
>> arecord -r 16000 -f S32_LE -c 1 -d 3 rec.wav
>> Recording WAVE 'rec.wav' : Signed 32 bit Little Endian, Rate 16000 Hz
>>
>> But when I try rec a audio with format S16_LE, It fails.
>>
>> arecord -r 16000 -f S16_LE -c 1 -d 3 rec.wav
>> Recording WAVE 'rec.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
>> arecord: set_params:1361: Unable to install hw params:
>> ACCESS:  RW_INTERLEAVED
>> FORMAT:  S16_LE
>> SUBFORMAT:  STD
>> SAMPLE_BITS: 16
>> FRAME_BITS: 16
>> CHANNELS: 1
>> RATE: 16000
>> PERIOD_TIME: 32000
>> PERIOD_SIZE: 512
>> PERIOD_BYTES: 1024
>> PERIODS: 6
>> BUFFER_TIME: 192000
>> BUFFER_SIZE: 3072
>> BUFFER_BYTES: 6144
>>
>> Is it possible to make an automatic format conversion?
>> Is there any way to solve this problem?
>>
>>
>> ___
>> Alsa-user mailing list
>> Alsa-user@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/alsa-user
>
>
>
> --
> Chris Hermansen · clhermansen "at" gmail "dot" com
>
> C'est ma façon de parler.


___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] arecord format-conversion

2019-11-06 Thread Clemens Ladisch via Alsa-user
Alex Vazquez wrote:
> pcm.!default {
> ...
>
> arecord -r 16000 -f S16_LE -c 1 -d 3 rec.wav
> Recording WAVE 'rec.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
> arecord: set_params:1361: Unable to install hw params:

Please check with the -v option whether it actually uses your "default" device.


Regards,
Clemens


___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] arecord format-conversion

2019-11-06 Thread chris hermansen
Alex and list;

On Wed, Nov 6, 2019 at 1:26 PM Alex Vazquez  wrote:

> Hi all.
> I'm using ALSA to configure a dmic. My dmic only support format S32_LE
> but I also need support format S16_LE.
>
> arecord -D hw:0,4 --dump-hw-params
> Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Mono
> HW Params of device "hw:0,4":
> 
> ACCESS:  RW_INTERLEAVED
> FORMAT:  S32_LE
> ..
> Available formats:
> - S32_LE
>

What about trying

arecord -D plughw:0,4 --dump-hw-params

>
> If I understood correctly, If I use "plug" plugin, it create an
> automatic format-conversion. To do so, I create a custom asounf.conf
> using the "plug" plugin.
>
> pcm.!default {
> type asym
> playback.pcm {
> type plug
> slave.pcm "hw:0,0"
> }
> capture.pcm {
> type plug
> slave.pcm "hw:0,4"
> }
>
> For a quick example, I used the arecord command. First I use S32_LE
> and it works.
> arecord -r 16000 -f S32_LE -c 1 -d 3 rec.wav
> Recording WAVE 'rec.wav' : Signed 32 bit Little Endian, Rate 16000 Hz
>
> But when I try rec a audio with format S16_LE, It fails.
>
> arecord -r 16000 -f S16_LE -c 1 -d 3 rec.wav
> Recording WAVE 'rec.wav' : Signed 16 bit Little Endian, Rate 16000 Hz, Mono
> arecord: set_params:1361: Unable to install hw params:
> ACCESS:  RW_INTERLEAVED
> FORMAT:  S16_LE
> SUBFORMAT:  STD
> SAMPLE_BITS: 16
> FRAME_BITS: 16
> CHANNELS: 1
> RATE: 16000
> PERIOD_TIME: 32000
> PERIOD_SIZE: 512
> PERIOD_BYTES: 1024
> PERIODS: 6
> BUFFER_TIME: 192000
> BUFFER_SIZE: 3072
> BUFFER_BYTES: 6144
>
> Is it possible to make an automatic format conversion?
> Is there any way to solve this problem?
>
>
> ___
> Alsa-user mailing list
> Alsa-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/alsa-user
>


-- 
Chris Hermansen · clhermansen "at" gmail "dot" com

C'est ma façon de parler.
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user