1

When I try to record from a hw ALSA device that does not support the expected parameters, it shows me which formats are available:

arecord -D hw:0,0 [...] Available formats: - S16_LE - S24_LE 

Then I set the correct format, but afterwards it complains about wrong channels and so on. I know, I could easliy work around this by using plughw:0,0 instead. However, I want to apply the correct settings, without trial and error.

Searching the internet I found an article that mentions aplay -v, but it only works when actually playing back. Also, to me it seems to only display the current configuration, not the available configurations.

How do I view the available hardware parameters of an ALSA sound card?

1 Answer 1

1

Use the option --dump-hw-params:

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

I found the crucial hint on stackoverflow (might get closed, let's document it here). You can use aplay as well. Catch is, aplay only prints the config when you provide an existing file. It does not need to be an audio file, I used a random text file as an example. So arecord is the better choice.

$ aplay --dump-hw-params -D hw:0,0 test.txt Playing raw data 'test.txt' : Unsigned 8 bit, Rate 8000 Hz, Mono HW Params of device "hw:0,0": -------------------- ACCESS: MMAP_INTERLEAVED RW_INTERLEAVED FORMAT: S16_LE S24_LE SUBFORMAT: STD SAMPLE_BITS: [16 32] FRAME_BITS: [32 64] CHANNELS: 2 RATE: 48000 PERIOD_TIME: [500 85334) PERIOD_SIZE: [24 4096] PERIOD_BYTES: [192 16384] PERIODS: [2 16] BUFFER_TIME: [1000 341334) BUFFER_SIZE: [48 16384] BUFFER_BYTES: [192 65536] TICK_TIME: ALL 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.