Skip to content

Instantly share code, notes, and snippets.

@youmukonpaku1337
Created December 26, 2022 13:24
Show Gist options
  • Save youmukonpaku1337/1577014ab716fa14894cc393c39eb3d7 to your computer and use it in GitHub Desktop.
Save youmukonpaku1337/1577014ab716fa14894cc393c39eb3d7 to your computer and use it in GitHub Desktop.
Fixing USB DAC volume on Android.

The issue

Some USB DACs on Android phones have a quite low volume compared to when used on a Windows or Apple device.
This is because Android has a set power limit on external DACs by default and the most common DAC to have this issue is the Apple USB-C to 3.5mm jack dongle.

Solving it

It's quite easy to solve this on a rooted device with some alsamixer commands.

Requirements

A rooted Android device and a USB DAC.

Installing alsamixer and checking the limits of the DAC

Steps

  1. Install this Magisk module to add the alsamixer binaries.
  2. Install Termux from F-Droid.
  3. Open Termux and run su.
  4. After running su run alsa_amixer -c 1 with the DAC connected (with an audio device plugged into it).
  5. The output should show a Limits line for the Headphone or Headset mixer, see the maximum value (on the Apple dongle it's usually 120).
  6. Run alsa_amixer -c 1 sset Headphone 120 but change 120 to the limit of your DAC and change Headphone to Headset if needed.
  7. Test to see if the volume is alright now.

Automating the fix

Steps

  1. Install Easer from F-Droid.
  2. Open Easer and grant the necessary permissions, and also grant root permission in its settings.
  3. Open the Data tab in the sidebar, then open the Events tab in the top bar.
  4. Create an event named "DAC plugged in", select the event as Headset and set action as Plugged in, then save.
  5. Move to the Profiles tab in the top bar.
  6. Create a profile named "Apply volume fix" set to Run commands with the command set to alsa_amixer -c 1 sset Headphone 120 with 120 changed to the maximum limit of your DAC and Headphone changed to Headset if needed, then press save.
  7. Move to the Script tab and create a script named "Apply volume fix on DAC plug in", with the profile set to the one you created in step 6 and the event set to the one you created in step 4, then save.
  8. Move to the Outline tab in the sidebar and click on the red cross, and you're done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment