Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Android sound problem

Discussion in 'Android' started by Dr. Argento, Oct 5, 2015.

  1. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Folks, Android is open-source. Anyone can compile a custom version, but the number of developers who can make it actually work is very limited. We cannot be responsible for every bug introduced into a custom ROM - there are enough in stock ROMs.
     
    MrEsquire likes this.
  2. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @Yuqiyi - please submit a bug report with the project attached, and a list of devices you used. For each device, please include the Android version and build fingerprint.
     
  3. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    194
    We'll hope, sound problems has gone in Unity 5.3 ... or early
     
  4. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Nothing significant was changed in Android audio in 5.3.
     
  5. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    This issue has not been confirmed by our QA - basic sound checks were successful.
    Please submit a bug report with your project attached. Could be something else causing issues - but not related to OpenSL/fast path.
     
  6. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    194
    Why - ?
    I build my game on Unity 5.1 and .. sound is good on Meizu, then rebuild on 5.2 and instead sound I hear only a crunch. The same phone, same Android... guess where is a problem?
     
    MrEsquire and BartNT like this.
  7. RocketRanger

    RocketRanger

    Joined:
    Nov 27, 2015
    Posts:
    2
    How exactly does Unity3D determine if low-latency is supported on a device or not? What is the API function Unity3D uses to decide for corresponding runtime paths (low latency<>non-low latency)? I have an affected device with CyanogenMod12.1 and can try to trace the return value.
     
    BartNT likes this.
  8. Yuqiyi

    Yuqiyi

    Joined:
    Aug 29, 2015
    Posts:
    6
    I just post a bug report with files, 748299.And you just need is a device, not my project.
    An empty scene just with any soud can cause this problem.
    The devices is XiaoMi HongMi 2A, with Android version 4.4.4.
     
    yuliyF likes this.
  9. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    In 5.2, Audio Fast path support was introduced in Unity.
    Starting from that version, if your device declares fast path support, - we enable it automatically.
    5.3 works the same as 5.2 with regard to this feature.
     
  10. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    http://developer.android.com/refere...PackageManager.html#FEATURE_AUDIO_LOW_LATENCY

    According to Google, each and every device reporting this feature must support fast path (but not every capable device reports this feature).
     
  11. RocketRanger

    RocketRanger

    Joined:
    Nov 27, 2015
    Posts:
    2
    Bug confirmed in rom. Here's a fix for people who want to fix their roms:
    1) (optional) adb shell pm list features shows feature:android.hardware.audio.low_latency
    2) Rename/remove /system/etc/permissions/android.hardware.audio.low_latency.xml
    3) reboot

    Thanks, Yury.
     
    Last edited: Dec 4, 2015
    Yury-Habets likes this.
  12. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    194
    I am happy, now we use Audio Fast Path but.. customers of my game hear a terrible crunch instead a sounds. Where is decision?
    I ready use a SLOW path but sound must be, no noise
     
    BartNT likes this.
  13. TimGS

    TimGS

    Joined:
    Apr 24, 2014
    Posts:
    70
    I guess an option "disable audio fast path" in Player Settings would be the best solution.
     
    ZenTeapot and yuliyF like this.
  14. Vectrex

    Vectrex

    Joined:
    Oct 31, 2009
    Posts:
    267
    Trouble with that is, to be sure we'd have to always have it disabled, thereby making the option pointless.

    I vote for the "user tickable flag/check flag" on app restart option. So we can put the option in the apps settings and point the inevitable complaints to it.
    I'd also put a note in the description for cyan users.. in fact, is there a way to detect cyan mods? If WE did it we could set the flag ourselves. It'd be nice if Unity defaulted fast path to off for cyan though.
     
  15. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Thank you for the update!
     
  16. psk

    psk

    Joined:
    Jan 11, 2013
    Posts:
    10
    I'm seeing this issue from multiple cyanogen s3 devices, will try the hack from RocketRanger and report back...
     
    Last edited: Dec 16, 2015
  17. psk

    psk

    Joined:
    Jan 11, 2013
    Posts:
    10
    Can confirm the RocketRanger hack works. So we can safely say that cyanogen on s3 is incorrectly reporting fast path. i've tested cyanogen working correctly on other devices such as 1+1 , so its not a universal issue on cyanogen.
     
    Last edited: Dec 16, 2015
    Yury-Habets likes this.
  18. Dr. Argento

    Dr. Argento

    Joined:
    Jan 29, 2015
    Posts:
    23
    Can you tell me how can apply this fix please?
    @psk @RocketRanger
     
  19. ZenTeapot

    ZenTeapot

    Joined:
    Oct 19, 2014
    Posts:
    65
    I am seeing this issue on one of our test devices as well. It would be nice to allow a switch, either through player settings or API. Reality is custom roms are abundant and this fast path glitch is game-breaking. Is that not enough for some compromise from Unity? for the sake of giving developers an easier time. If Google kept a strict device environment like Apple I wouldn't be surprised if Unity does not support jailbreak features. But Android, as the game is played, is fragmented as hell. Does that not deserve some compromise for reality?
     
  20. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,624
    Do the Cyanogen devs know about this issue? Maybe they can fix it.
     
  21. psk

    psk

    Joined:
    Jan 11, 2013
    Posts:
    10
    Well its an interesting question. It would of certainly been the case that a user who had installed cyanogen would know how to rename a file on the device (you can use adb shell, or any 3rd party file manager), however it seems that it also effects some of the popular Chinese handsets which come with cyanogen pre installed - for these types of user there is no simple fix to give them, as installing adb is complicated as is using a 3rd party file manager.
     
  22. psk

    psk

    Joined:
    Jan 11, 2013
    Posts:
    10
    Ive registered on their bug track database - I just need to gather a little more info to post a decent bug report. On the case.
     
    Yury-Habets and AcidArrow like this.
  23. theboosted_1

    theboosted_1

    Joined:
    Aug 21, 2013
    Posts:
    21
    I'm having audio pops and random static on unity 5.3 android 5.1.1 on a stock note 5. This problem didn't exist until i updated the note 5 to 5.1.1.
     
  24. gemma123

    gemma123

    Joined:
    Dec 27, 2015
    Posts:
    2
     
  25. gemma123

    gemma123

    Joined:
    Dec 27, 2015
    Posts:
    2
    i used the Sound Doctor app from the play store - fixed my silent audio issue with one click
    https://play.google.com/store/apps/details?id=com.sounddoctor&hl=en
     
  26. Justin-Wasilenko

    Justin-Wasilenko

    Joined:
    Mar 10, 2015
    Posts:
    103
    Bump on this thread, I made a new thread here:
    http://forum.unity3d.com/threads/bluetooth-headphones-sound-problems.376842/

    but found this one afterwards. my game is a google cardboard game and users want to use bluetooth headphones with their headsets I'm sure. But I am getting reports of bad sound / stuttering sound when they use bluetooth headphones.

    I also found this thread here:
    http://forum.unity3d.com/threads/gear-vr-and-bluetooth-headphones-issue.357285/

    Is there a fix for this? I'll be porting my game to GearVR in the coming weeks but looking into how I can fix this now or if it's just a Unity issue that is being working on...
     
  27. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @Justin Wasilenko : I answered you in the new thread. Can you please submit a bug report? Thanks!
     
  28. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    @Yury Habets
    Why not provide a temp workaround for everybody to disable the fast path while you develop a proper way to handle the situation?
    Chinese devices alone are probably several million, add custom rom and you get a huge percentage of devices affected.
    Do you really expect Chinese vendors to comply with Google guidelines?!
    It will be several months before you decide on a proper way, developers shouldn't be forced to work with a not working
    solution just because it's supposed to be working and it's the device maker fault if it doesn't.

    Adding a checkbox in the player settings is a matter of minutes...
     
    Last edited: Jan 7, 2016
  29. Viesis

    Viesis

    Joined:
    Aug 3, 2015
    Posts:
    1
    I had exactly the same issue since unity 5.2. I renamed the file that RocketRanger mentioned and the issue was solved. I have CM 13.0 ROM..... but the problem is that you can't expect people to do that. BTW - i have no problems wiht the sound if i build something with even the latest UE4....
     
    BartNT likes this.
  30. MaksymN

    MaksymN

    Joined:
    Feb 19, 2015
    Posts:
    1
    Hello! I’ve solved this problem this way: Project Settings >Audio > DSP Buffer Size = Best performance

    I’ve got Meizu MX3 for tests.

    Hope this help you.
     
    yuliyF and Vitor_r like this.
  31. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    194
    thanks, I'll check
     
  32. Vitor_r

    Vitor_r

    Joined:
    May 23, 2013
    Posts:
    93
    I got an S3 with Cyanogen and this option solved my problem.
    I still got half second delay on the sound but the sound is playing like it should.

    Thanks @MaksymN
     
  33. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    194
    yes, yes, my problem has been fixed too, thanks MaksymN.
     
  34. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
  35. yuliyF

    yuliyF

    Joined:
    Nov 15, 2012
    Posts:
    194
    Yury-Habets likes this.
  36. iivo_k

    iivo_k

    Joined:
    Jan 28, 2013
    Posts:
    314
    Galaxy S3 with Slimkat 4.4.

    Screenshot_2016-02-14-13-04-40.png
     
    Yury-Habets likes this.
  37. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Oh my god... :eek:

    Thank you for running the test, the results are very helpful.
     
    yuliyF likes this.
  38. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    65
    I don't have issues with the Galaxy S6 but when I start to use a bluetooth headset with GearVR or after casting with Chromecast with GearVR.

    Screenshot_2016-02-18-14-30-31[1].png
    Haven't tried without GearVR yet, but I guess it's the same issue (according to Google documentation on Chromecast that never mention GearVR).
     
    Last edited: Feb 18, 2016
  39. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    65
    Ok..
    <<Deleted>>

    But I tried it, managed to install the apk, the game works, but changing the string didn't help, the result was the same :(

    So.. I don't think my issue comes from this.. you must have 2 different issues..

    I'm using Samsung s6 + Gear VR + Chromecast.
     
    Last edited: Feb 19, 2016
  40. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Don't do that.
     
  41. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    Right. GearVR uses another detection mechanism. If you make a simple non-VR app and try it on S6 - I think it should work fine even through Bluetooth/chromecast.
     
  42. Sylafrs

    Sylafrs

    Joined:
    Jun 25, 2013
    Posts:
    65
    I will try it :)
    Edit: Yup, it works fine when/after casting without a GearVR.

    I'm waiting for your fix :p
    Do you know how much time it can take (approximatively)?
     
    Last edited: Feb 19, 2016
  43. Aram-Azhari

    Aram-Azhari

    Joined:
    Nov 18, 2009
    Posts:
    142
    We have a lot of users with Samaung Galaxy Tab 2 (both 7" and 10") complaining about a screechin sound / loud noise / hissing sound on their device.

    I doubt that all of them have custom roms. If you happen to have this device, could you check if it is repro?

    We've also asked our external QA to see whether they can observe this. If they are able to, we're confident they don't use custom roms.

    I will post an update after they give us feedback.
     
    Last edited: Feb 25, 2016
  44. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @Aram Azhari : I do have a Galaxy Tab 2 10" at home, and I'm pretty sure it works fine with the original ROM.
     
    Aram-Azhari likes this.
  45. 00christian00

    00christian00

    Joined:
    Jul 22, 2012
    Posts:
    1,035
    Yuri, still no plans to let users disable the fast path?
     
  46. Aram-Azhari

    Aram-Azhari

    Joined:
    Nov 18, 2009
    Posts:
    142
    I also have the news back from our external QA. They didn't see this issue either.

    We'll contact the end users explaining the reason. The only downside of this is some customers who used to have a problem free experience until we updated Unity and they're arguing that they're left out.

    Thanks.
     
  47. Yury-Habets

    Yury-Habets

    Unity Technologies

    Joined:
    Nov 18, 2013
    Posts:
    1,167
    @00christian00 : not yet, but a fix is coming that will hopefully address sound issues on custom ROMs/broken devices. (not for bluetooth output yet).
     
    00christian00 likes this.
  48. rainabba

    rainabba

    Joined:
    Dec 10, 2014
    Posts:
    5
    I wanted to confirm the issue and add that we've gone through numerous builds, complete re-architecture of our app and from Unity 4.x to 5.x and this has been a consistent issue not only in our app, but nearly every one that uses Unity audio in GearVR (Note4). I also see it on my stock Nexus 6P.

    Our app is primarily a movie player when all is said and done and we use Android Media Player to that end. Our movies do not suffer this issue, only sounds from the Unity engine.
     
  49. Aram-Azhari

    Aram-Azhari

    Joined:
    Nov 18, 2009
    Posts:
    142
    Hi again,

    We received more info from our end users with screenshots of their OS. They all seem to be on Galaxy versions of Android 4.x and they haven't touched the operating system. I think this needs to be addressed a bit more in detail. There are 4 variations of Galaxy Tab 2. The GT-P5110 is definitely one of the problematic ones. The other one is the codename espressowifi.
     
  50. Aram-Azhari

    Aram-Azhari

    Joined:
    Nov 18, 2009
    Posts:
    142