No input device selectable for wired headset plugged into TRRS port

Hej!

I have an issue with a wired headset using the TRRS input of the Reform2 not showing any input device. While I can change the output from “speaker” to “headset” in pavucontrol and hear the output as expected, there is no option for input whatsoever. It only says “no input devices available” when I select “show all except monitors”. I am running the A311D and have not messed with the system image in a meaningful way I believe (only recently reinstalled the system).

I can change the profile in the Configuration tab of pavucontrol from “Stereo” to “Audio Pro” which creates a bunch of output and input devices (3 each iirc) but that didn’t yield any success either. I didn’t try this config in detail though as I didn’t quite understand what this profile was supposed to do and how it reflected the available HW.

The headset does work with my Android phone and another soundcard, so the headset and connector should be fine. This is the first time I am trying a wired headset on the Reform, so I was worried it might be a hardware issue.

Does any one have any suggestion as to how to configure the input for a wired headset? Could this be a bug in the system image?

It could be an issue with the device tree on the A311D Reform. I have a iMX8MQ machine and the Built-in Audio Stereo input shows up in pavucontrol.

The “Pro Audio” profile just exposes more options for complex sound devices that PipeWire typically hides for normal PC used, but are useful to people doing stuff with music production/sound engineering.

1 Like

One could also add that the microphone did not always work on imx8mq but required a small change to the device tree contributed by @AbortRetryFail: Change SAI to synchronous mode to fix recording from the onboard mic jack and line-in header. (95c972a3) · Commits · Reform / reform-debian-packages · GitLab

Now you might say, oh lets just remove fsl,sai-asynchronous from the dts. But when I tried replacing the imx8mq dts with a patch to the upstream dts which also removed fsl,sai-asynchronous, that broke the microphone input. See linux: patch upstream imx8mq-mnt-reform2.dts instead of overwriting (!84) · Merge requests · Reform / reform-debian-packages · GitLab And secondly the fsl patch is specific to imx8mq and the a311d dts has no such entry… :frowning:

Mic input on the iMX8 was a different issue. The input device showed up, but couldn’t record anything because its sample clock wasn’t running.

This sounds like PipeWire the A311 doesn’t think there is an input device at all.

If your hunch is right @AbortRetryFail how would one go about adding the missing entries? What information would be needed?

I’d be happy to post anything related to the configuration of my system here – just don’t quite know where to start looking :thinking:

Honestly, no clue. The Device Tree stuff is still largely a mystery to me even after working on it to fix recording on the imx8mq Reform.

You could start with the docs.

That’s what I did and it was helpful to understand that the “sound card” as Linux sees it has actually (at least) 2 parts. One that’s the codec chip on the motherboard (WM8960), and the other that’s part of the SoC, connected via I2S(?).

My guess is, your problem is on the SoC side, but it’s just a largely unfounded hunch and I don’t have a A311D machine here to play with.

1 Like

Actually, something worth checking is arecord -l and see if ALSA thinks there are any capture devices. If it does, but PipeWire doesn’t see them, then maybe there’s just a software problem.

Good point! arecord brings back memories, though very faded ones :laughing:

$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: MNTREFORM2BPICM [MNT-REFORM2-BPI-CM4], device 3: fe.dai-link-3 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: MNTREFORM2BPICM [MNT-REFORM2-BPI-CM4], device 4: fe.dai-link-4 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: MNTREFORM2BPICM [MNT-REFORM2-BPI-CM4], device 5: fe.dai-link-5 (*) []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Those might be the three input devices I see in the Audio Pro profile setting..? But no idea what those map to – what is the difference between them? :thinking:

Thank you so much for those pointers! That does sound like a fun deep-dive, but also a bit intimidating :laughing:

Let’s see whether I find the time to dig that deep before the RK3588 upgrade arrives at the door :winking_face:

You might be in the realm of software land where stuff (should be) easier to fix.

Probably one is for the unpopulated JST plug on the motherboard for the stereo line input. Or maybe two of them if the channels got separated at birth.

Try recording from each of those and see if any of them contain your mic input.

If that works, then the only thing you have to figure out is how to convince Pipewire to see it for what it is.

1 Like

Ok, I have been messing with trying to record directly from the Alsa input devices for some time now, but do not get anywhere: basically, arecord fails with the message Sample format non available whatever I do.

This would look like this:

$ arecord --verbose -D "hw:CARD=MNTREFORM2BPICM,DEV=3" mon.wav
Warning: Some sources (like microphones) may produce inaudible results
         with 8-bit sampling. Use '-f' argument to increase resolution
         e.g. '-f S16_LE'.
arecord: set_params:1387: Sample format non available
Available formats:
- S8
- S16_LE
- S24_LE
- S32_LE
- IEC958_SUBFRAME_LE
- S20_LE


$ arecord --verbose -f S16_LE -D "hw:CARD=MNTREFORM2BPICM,DEV=3" mon.wav
arecord: set_params:1456: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 8000
PERIOD_TIME: 125000
PERIOD_SIZE: 1000
PERIOD_BYTES: 2000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 4000
BUFFER_BYTES: 8000
TICK_TIME: 0

I have tried different devices (among others hw:0,3, plughw:0,3 as well as 4 or 5 instead for 3), different formats and different rates. I have stopped pipewire-socket, pipewire, pipewire-pulse.socket and pipewire-pulse services, to make sure they don’t interfere. And I have tried to use the info in Record Audio without Pulseaudio/Pipewire - #2 by soulsource but am not sure it is really relevant (though the error seems to be the same). I have even tried sudo in case this is some weird permission problem.

I could not find anything online with respect to this error message that sounded relevant to my problem, either.

If I omit the device, then PipeWire PCM I/O Plugin is used, and a completely silent waveform is recorded.

Maybe (that is to say probably) I am doing something stupid and that is why it is failing… but right now, I don’t quite know where to continue investigating so ideas, hunches and advice are all very much welcome!

If anyone with an A311D (on a Reform2) could confirm that there is no input device visible in pavucontrol, that would also ease my mind that it is not something I messed up when installing some package..

1 Like

You probably need to set the sampling rate as well. The IMX8 Reform requires that too. Try -r 48000

Older sound cards and their drivers like the SB Audigy museum piece in my desktop PC have no trouble recording or playing whatever you ask of them, but newer stuff, particularly embedded, are very picky about it. I think the drivers are written with the assumption that there will be a userspace sound server doing all of that work so why bother trying.

Thanks for the tip! I finally got the time to mess with this again and tried all permutations I could think of. However:

arecord --verbose -f S8 -r 48000 -D plughw:CARD=MNTREFORM2BPICM,DEV=3 mon.wav
arecord: set_params:1456: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S8
SUBFORMAT:  STD
SAMPLE_BITS: 8
FRAME_BITS: 8
CHANNELS: 1
RATE: 48000
PERIOD_TIME: 125000
PERIOD_SIZE: 6000
PERIOD_BYTES: 6000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 24000
BUFFER_BYTES: 24000
TICK_TIME: 0

I tried different DEV values and different formats (just for the sake of trying), but I always get the same error message and no output file is written.

Is there some introspection in the system, i.e. a way to find out what the HW supports similar to how arecord would suggest supported formats?

Not that I’m aware of.

I used pw-top to figure out what sample format PipeWire was using.

1 Like