40ms is way too much. To put it in perspective, at 60Hz, that's almost 3 frames of video. 10ms would start to be useful for music, but I wouldn't call it good until it was below 2ms, which is what I run my jackd setup (which requires linux-rt) at. I'm afraid we won't see good latency until Android moves away from Linux. The good news is that this is bound to happen, sooner or latter, as Fuchsia exists.
Speed of sound is one foot per millisecond. 40ms is 40 feet. Bands play with that kind of separation all the time.
Shortcutting this latency is one of many reasons musicians wear earplugs on stage.