Record Audio without Pulseaudio/Pipewire

Hi!

I’m trying to convince ALSA (or, to be precise, arecord, and later down the line maybe Audacity) to record audio on my MNT Reform, without having pulseaudio or pipewire running, but up to now I didn’t manage to.

Best I could get is either arecord or ALSA itself complaining about being unable to set hardware parameters.

$ arecord -D hw:0,3 -f cd
arecord: set_params:1456: Fehler beim Setzen der Hardware-Parameter:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (124988 124989)
PERIOD_SIZE: 5512
PERIOD_BYTES: 22048
PERIODS: (4 5)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: 0

My asound.rc is still rather barebone, for now, but in the long run I’m planning to set asym up so the default device can record:

$ cat /etc/asound.conf
pcm.dsp0{
	type plug
	slave.pcm "dmix:0"
	hint {
		show on
		description "My dmix dsp0"
	}
}

ctl.mixer0 {
	type hw
	card 0
}

pcm.!default dsp0

I have tried multiple different parameters for arecord, but since I am unsure about the capabilities of the hardware, those were just shots in the dark, and all failed with errors similar to those shown above…

So, I wonder which set of parameters might be expected to work, and also if I might need to set something in alsamixer first?

Help would be appreciated, but if the only answer is “install pipewire”, then, well, I will do that…

Also, related question: Did I get this right, that the reform’s headphone jack only supports mono input, or is there some way to get stereo input too?

To answer my own question about mono input: I just checked the schematics, and the headset plug is indeed connected as stereo out and mono in. The respective input is LINPUT1.

The audio chip does support stereo input though, and the connections on the mainboard go to the (internal) connector right below the headset connector, labelled “Line In” or “J16”. Those are connected to LINPUT2 and RINPUT2.

This brings me a bit closer to understanding how to get audio-input working, but there’s still the question what to set in alsamixer to actually get it working…

I’m planning to skim through the audio chip datasheet, to find out which flags need to be set in order to have working input from either a microphone on LINPUT1, or a stereo line-in signal on LINPUT2/RINPUT2.

1 Like

It does work without PA/PW, but you have to have the right switches and knobs set in alsamixer first. I don’t have my Reform in front of me but I think the relevant stuff is “Left Input Boost Mixer”

Try using plughw:0,3 instead of hw:0,3. Maybe you’re trying to use a non-native sampling rate with -f cd. I think the codec runs at 48000.

1 Like