You are not logged in.

#1 2023-03-29 07:50:49

Neven
Member
Registered: 2014-05-02
Posts: 75

[SOLVED] Pipewire audio: find properties for a device (microphone)

I will be taking some audio recordings, probably with pw-cat, and I want to avoid resampling. How to find out:

1. The list of sample rates supported by the microphone

2. The sample rate at which Pipewire is currently driving the microphone

Apart from sample rate, I'm also interested in:

1. channel map

2. audio sample format

The microphone is behind a cheap USB-C analog-digital converter (ADC), as part of some earphones.

Last edited by Neven (2023-03-29 09:23:36)

Offline

#2 2023-03-29 09:14:50

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,743

Re: [SOLVED] Pipewire audio: find properties for a device (microphone)

For question 1 while not actively using the device you should be able to

arecord -Dhw:x --dump-hw-params
#alternatively/additionally since it's an usb device
lsusb -vd$vid:$pid

where hw:x is the card number as given by arecord -l and $vid and $pid the vids and pids as a plain lsusb would show

For question 2 subquestion 1 subquestion 2 during an active recording you can check

pactl list sources
pactl list source-outputs

(there are likely some pipewire specific commands for these as well but I don't have them from the top of my head (other than pw-top which should show this in directly, might wanna check that) and checking the logical pulse sources will give you that info as well anyway as well) which will show how the device is currently opened with which sample rate and which format and the source-outputs which sample rate and format the source has and whether it has to be resampled.

Spoiler alert, you'll  most likely be limited to mono for a single standard mic and probably something like 441kHz if not lower.

Last edited by V1del (2023-03-29 09:18:54)

Offline

#3 2023-03-29 09:18:34

Neven
Member
Registered: 2014-05-02
Posts: 75

Re: [SOLVED] Pipewire audio: find properties for a device (microphone)

Just found out an answer:

This does it:

cat /proc/asound/"$AUDIO_CARD"/pcm0c/sub0/hw_params

This too:

cat /proc/asound/"$AUDIO_CARD"/stream0

Offline

Board footer

Powered by FluxBB