vanilla-music / vanilla

Vanilla Music Player for Android
GNU General Public License v3.0
1.18k stars 295 forks source link

Micro-stutter with usb-c audio dongle (digital/external soundcard with integrated DAC) - can I increase buffer size? #890

Closed ghost closed 5 years ago

ghost commented 5 years ago

Description

I recently got the Razer Usb-C audio soundcard (it's an active usb to 3.5 inch jack dongle with integrated digital-to-analog converter, not one of the simpler analog-only ones that expect the DAC to be in the phone). It works almost perfectly, except that as long as the phone is unlocked & screen enabled, I get micro-stutters: every few seconds the sound just hangs for a tiny moment leading to a not-very-loud but audible click & delay. As soon as I lock the screen and it goes black, it works fine.

Of course this might be mostly a system / driver issue, but my guess is that the latency of the usb connection is just a tad higher than the system expects, so if it's not super super idle, it sometimes just comes in a little too late supplying the audio (hence the stutter).

Therefore I'm wondering: is there some way in vanilla to just request a larger audio buffer? I haven't found any such option, but I suspect that it might get rid of my micro stuttering if something like that was possible

Steps to reproduce the issue

  1. Attach Razer USB-C to jack adapter / soundcard - use the left-hand USB-C socket (the Gemini PDA has two)
  2. Attach any headphones
  3. Open Vanilla Music and play a song. Keep the interface open, don't lock the screen

-> occasional noticeable small stutter

refi64 commented 5 years ago

Outside of Enable Readahead, Vanilla relies on Android itself to play audio, and there's not much you can do about it.

ghost commented 5 years ago

neat! I hadn't actually readahead enabled, maybe that will help a little.

I was aware of that, I just assumed maybe Android has some options for tweaking this vanilla could use - if not, feel free to just close the ticket

adrian-bl commented 5 years ago

As kirbyfan64 said: there isn't anything we could do about the buffer size as we use the native framework for playback: Enabling readahead (which just helps with slow storage) is the best we could offer.