I require your assistance in configuring my USB speaker as the default output device at system boot. My objective is to control its mute and unmute states via remotely command. While I have successfully managed this using PulseAudio, it is limited to user sessions, which is not suitable for my setup.
I have also attempted using ALSA, which allows me to mute and unmute the speaker via commands. However, I still need to manually navigate to Settings > Sound and select the speaker as the output device each time the system starts.
Since my application requires a system-level solution, I would appreciate your guidance on configuring the USB speaker to be automatically selected as the default output device at boot, eliminating the need for manual intervention. Despite multiple attempts, I have not yet found a complete solution that meets my requirements.
Your support in resolving this issue would be greatly appreciated.
I won’t be able to answer, but this is more about Linux and Ubuntu and isn’t especially linked to Jetsons. One of the problems that you will see is that multimedia devices are normally bound to whoever is logged in to the GUI. This, in turn, depends on your desktop manager.
I use KDE on my desktop Ubuntu (KUbuntu), so I can’t really test for that, but I’ve run into exactly the situation you’re in with my USB headphones. I had to keep resetting this under any number of circumstances, and sometimes the circumstances were as simple as the USB headphones enumerating slightly later than usual during boot. I ended up using the KDE setup for HDMI and audio to disable the monitor completely; after that there was no trouble because whether or not my headphones enumerated early or later they were the only device.
Any documentation you find for Ubuntu, or for the window manager (I think Gnome), would do the job. I suspect that if you find documentation for setting or blocking HDMI (or DisplayPort) sound devices, then your USB device will work correctly for that user login. If you need audio without the GUI login, then everything changes.
Setting up audio without the GUI login would be something “Ubuntu”, and would be no different on a Jetson than it would be on a desktop PC. There are ways to run dedicated GUIs which do not use login, and which have only one program they run. Basically, you’d need to learn how to manually launch an X session without the login manager.
If you are in a pure console, and not in any kind of GUI (e.g., you’ve switched via CTRL+ALT+F3 or some key binding leading to a non-GUI console), then a particular user can start their own independent X session with something like the wrapper script “startx”. That would make a child process to the text console, and would be a GUI run by the person who typed in “startx”. There is a huge learning curve involved, but you can start an X session without a desktop manager, and running only a particular application. You could leave the original GUI alone, and just switch to a text console, then test on command line without permanently installing anything. Basically, that startx script could be copied somewhere, and then edited. Instead of starting shells or window managers, it could be used to start a specific GUI program. Exiting that program would lead back to the text console.