'Keep headphone jack powered on android device, even without music playing

I recently installed a tablet in my car (370z) I love the thing but the only problem I have is that when music isn't playing I get a static noise buzz. After doing some research it seemed like its because in order to save power Android shuts off the power to the headphone jack. There's a launcher that comes with the setup I installed that eliminates this issue so I know it can be done. Unfortunately I don't like the launcher itself :). I want to build my own custom launcher for this but I don't know how to tackle this particular issue. I haven't not found any documentation on anything related to this anywhere. I'd appreciate if someone can point me in the right direction.

Tablet Used: Samsung Tab A 10.1 OS: Android 11, not rooted (yet)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source