Audio issue with Orin AGX

So i have a Jetson Orin AGX 32GB developer kit emulated as the NX orin 8GB.
I have a deepstream pipeline that needs to be run from root, and the output stream should have audio in it. i have an hdmi monitor connected which is the audio output device in my case.

When i run the pipeline (with the root user) the audio doesn’t work. so in order to rule out the possibility that it’s an issue with my pipeline, I tried another simple pipeline gst-launch-1.0 -v uridecodebin uri=file:///path/to/audio_file.wav ! audioconvert ! autoaudiosink

It worked fine without sudo but again, it didn’t work with sudo. i tried running pulseaudio service systemwide and added the root user to pulse-access group but that didn’t work either.

FYI, the pipeline and the audio worked fine before on the Xavier NX with jetpack 4.5.

Also my pipeline has nvdrmvideosink so i have to stop the graphical interface to work with it, when i try to run the simple pipeline with the graphical interface off, without sudo, it doesn’t work anymore, and listing the audio sinks shows that it is no longer detecting the hdmi sink.

so in summary my questions are:

  1. How can i get the audio to work using sudo?
  2. How to get the audio to work without the graphical interface (a.k.a in mode)

Please try this method:
Can nvgstplayer play video without X11 environment? - #12 by DaneLLL

Please make sure you can play it in aplay command, and use alsasink in gstreamer command.

as mentioned before, audio works fine without sudo, but in root mode, it doesn’t.
That also applies to aplay command.
I believe the issue is that the hdmi audio sink is not detected in root.
for example, if i run the command pactl list sinks short , the HDMI output can be seen, but when using sudo, HDMI is not listed.

Here is a screenshot for your reference

So my question is why is the HDMI output sink not detected in root?

There are some discussion in:
debian - Sound doesn't work properly in root but does in normal user - Unix & Linux Stack Exchange

And some information in
The volume of sound cannot be reduced in root mode - #11 by DRAMESH

Please take a look and give it a try.

I looked through the resources you referred to.
The first one won’t work for me since i don’t login to the desktop as a root user, i use sudo su and run my pipeline, so a .desktop is not the solution for my case.

The second one recommends running pulseaudio system-wide which, as i mentioned in my post, i already do that and it still doesn’t work, my HDMI sink is still not detected.

@DaneLLL Any updates or anything else i can try?

it looks like the constraint is for system security in Ubuntu OS. Maybe it is better to keep it. Is there a reason to use root user?

Yes, unfortunately i have to use the root user. Is there any way i can workaround this to enable audio in root?

Ok so i tried using an audio sink other than the hdmi, i connected a speaker to a usb audio adapter. It worked in root so the issue is specific to the hdmi audio output in root. It never shows up in pactl list sinks short command in root unlike the usb adapter.

Any idea why only the hdmi audio doesn’t work in root?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.