Using pipewire causes APE to malfunction

Hello Nvidia team,

I have confirmed the APE sound card works find with pulsaudio.service. However, the pipewire doesn’t.

I do these steps to disable the pulseaudio and then enable the pipewire.

systemctl --user --now disable pulseaudio.service pulseaudio.socket
systemctl --user --now stop pulseaudio.service pulseaudio.socket

systemctl --user --now enable pipewire pipewire-pulse wireplumber
systemctl --user --now start pipewire pipewire-pulse wireplumber

Working:
Video of sound works

Not working:
Video of sound doesn’t work

You can see the sound bar always freeze when using pipewire. However, I can use arecord to capture my voice.

arecord -D hw:APE,0 -c 2 -r 48000 -f S16_LE -d 5 out.wav

I’m using the Jetpack 6.2 and the codec is rt5640 on our custom board. I also got some failure message from debug port.

[ 219.849458] tegra-asoc: sound: ASoC: PRE_PMU: rt5640-playback-playback event failed: -22
[ 219.874519] rt5640 0-001c: ASoC: error at snd_soc_dai_hw_params on rt5640-aif1: -22
[ 219.874535] tegra-asoc: sound: ASoC: PRE_PMU: rt5640-playback-capture event failed: -22
[ 220.554117] rt5640 0-001c: ASoC: error at snd_soc_dai_hw_params on rt5640-aif1: -22
[ 220.554133] tegra-asoc: sound: ASoC: PRE_PMU: rt5640-playback-capture event failed: -22
[ 220.769787] rt5640 0-001c: ASoC: error at snd_soc_dai_hw_params on rt5640-aif1: -22
[ 220.769804] tegra-asoc: sound: ASoC: PRE_PMU: rt5640-playback-playback event failed: -22
[ 220.790248] rt5640 0-001c: ASoC: error at snd_soc_dai_hw_params on rt5640-aif1: -22
[ 220.790258] tegra-asoc: sound: ASoC: PRE_PMU: rt5640-playback-capture event failed: -22

Do you have any idea on this problem?

Addition information…when I use the pipewire, there is no application can record my voice., such as Audacity, gnome-sound-record or guvcview. Only the arecord command works.

Hi Chang,

Apologies for the delay.

JetPack 6.2 ships PulseAudio as the default(Ubuntu 22.04 base). PipeWire is not part of the validated JP 6.2 audio stack on APE — switching to it is opt-in on your side and isn’t a configuration we officially test/support.

On the error: -EINVAL (-22) from rt5640_hw_params is most commonly hit when the negotiated bit format reaches the codec as S32_LE — the rt5640 driver only accepts 8/16/20/24-bit widths and returns -EINVAL for anything else. Your arecord uses S16_LE, which is supported, so the manual capture works as expected.
PipeWire/WirePlumber can briefly print these messages at startup while the graph re-probes formats.
To narrow this down, could you share:

  1. Whether the-22errors appear only at PipeWire start/restart, or also during active playback / capture (while the sound bar is frozen).

  2. amixer -c APE contents(oralsactl -f ape-before.state storeand... ape-after.state store) from two states:

    • while it’s still working under PulseAudio, and

    • right after switching to PipeWire (when it stops working).

The diff between the two mixer dumps will show whether WirePlumber is touching a routing/mux on the APE graph that breaks the path. Until we have that, the recommendation is to stay on the default PulseAudio stack for APE on JP 6.2.

Thank you for this reply.