Would using a driver for Android to control a USB soundcard require root?

fuzzybabybunny

Moderator<br>Digital & Video Cameras
Moderator
Jan 2, 2006
10,455
35
91
I don't know anything about programming for Android / Linux but I just wanted to run this by Android developers to see if this is feasible.

I've got a USB sound card (DAC + amp) that I connect to my S5 via USB OTG. The sound card doesn't have any physical volume control buttons, but it has 64 levels of volume adjustments if you send it the right commands. I want to develop a widget that people can use to set the internal volume of their USB sound cards that don't have physical volume dials. Right now, when the sound card is attached a default hardware level is set after enumeration, say 20, and further volume adjustments are done through the Android software layer. There is no way to adjust the hardware volume further.

On Android, I can set the internal volume of the USB sound card by downloading AlsaMixer and issuing terminal commands. The problem is that AlsaMixer requires root to work, and I don't want people to root their phone in order to use this widget.

There's a program called USB Audio Player Pro that's basically a media player. They wrote their own audio driver and has full control of the sound card's hardware volume from within the app. It does *not* require root. The problem is that when UAPP activates their driver it completely overrides the Android sound system. Sounds will only play through the UAPP media player. There will be no system sounds, things like Spotify won't work, games don't play sounds, etc.

So.... how do Android drivers work? In Windows you can download and install a driver and the device will work system wide. Could I make a root-less driver for Android and USB sound cards that will enable hardware volume control and which will play sounds from all system wide Android sources?