-
Notifications
You must be signed in to change notification settings - Fork 278
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Visualization does not work on the new Galaxy devices #5
Comments
Hello. I'm developing and publishing "Music Visualizer" app on Google Play store. My app also have the similar issues, so I know some causes of them. First, visualizer not working issue is not a single issue. There are several reasons that makes visualizer not working. 1. Galaxy devices (except for S4) and HTC RezoundSorry, I don't know about this issue on these phones. I have Galaxy S2 (SC-02C, JP model), but visualizer works well on it. But I got some feedback from Galaxy S3 users that my app doesn't work on it. 2. Galaxy S3, S4, Note 3 and derived models (Snapdragon model only)Snapdragon based Galaxy S4 have visualizer not working issue. My Galaxy S4 (SC-0E, JP model) corresponds to this case. I investigated this issue and found the reason. It uses hardware acceleration playback mechanism called "Tunnel Player (Tunnel Playback)" when playing music files. If the tunnel player is used, audio capturing process is bypassed. As a result, visualizer does not work at all. There are several conditions for the tunnel player to be used.
So, workarounds are the follows;
NOTE 1) This issue is already reported on Samsung's developer forum. (But it seems not fixed yet...) NOTE 2) Originally, the tunnel player seems to have been introduced by Code Aurora Forum's developer. 3. Nexus 4, Nexus 5 and Nexus 7 (2013) (maybe Snapdragon based Nexus only)Nexus series devices are Google's reference model Android devices. So sometimes they support new features earlier than vendor customized models. The Google has introduced low-latency audio playback feature since Android 4.1. But it has a side-effect, visualizer doesn't work while music playing by Open SL APIs. However this issue only occurs on certain Nexus devices. Nexus 10 also supports low-latency playback, but it doesn't have the issue. I think the difference came from base platform difference, Nexus 4 and 7 (2013) are using Qualcomm's Snapdragon SOC, on the other hand Nexus 10 uses Samsung's Exynos SOC. (I don't know that Galaxy Nexus has this issue, but it's interesting because the phone using OMAP SOC.) Workaround is the follow;
ref.) http://source.android.com/devices/latency_design.html 4. Some custom ROMs (Old LiquidSmooth, RootBox and VanirAOSP)Some custom ROMs have bugs on visualizer implementation. I fixed it on LiquidSmooth, RootBox and VanirAOSP ROM, but I'm afraid that there are other custom ROMs still have this bug.
5. CyanogenMod 10.2 (ADDED on November 18, 2013)On CyanogenMod 10.2, Visualizer class doesn't work if it created with audio session 0 (= system mixed output). This issue seems to occur on certain devices only. [Affected]
[Not affected]
6. Recent Motorola's phones (Moto X, DROID Mini, ...) (ADDED on November 23, 2013)Maybe this issue is only occur on JellyBean. After upgrading to KitKat, it seems to be fixed. (A my app user confirmed this, he is using a Moto X phone.) (*1) MediaPlayer class based player apps: Music Visualizer built-in player, Google Play Music, PlayerPro (without DSP pack), Rocker Player Free, doubleTwist, n7player, Apollo (*2) Open SL based player apps: Poweramp, jetAudio, WinAmp, PlayerPro + DSP pack, Rocket Player Premium, GoneMad, Neutron Thanks, |
It seems like there can be no definite solution to this problem until a new software update is released from Samsung. Music visualization always works on the new iOS devices without any issues. Music visualization should work on all the new Android devices according to the specification, but it does not work on a lot of the new high profile devices, like Samsung's S4. This gives Android a bad reputation and makes people want to buy iPhone instead. |
I agree that this is vendor issue. Have you tried contacting Samsung directly and seeing if they have a process for reporting such issues, or even a bug tracker (I know Apple has something like that, for example). I'm not in a position to test myself, as I don't have the device in question. I'm afraid that I'm not that hopeful here, when a manufacturer ships a device that has a bug in its API, there's only so much you can do. Given how long it takes to get a bug fix from reporting stage to actually being pushed out to devices, sadly I don't think this will be fixed soon. Still worth a try though... :( |
My Samsung Galaxy S4, Model SPH-L720, with Android version 4.3, suffers from this problem. Using MediaPlayer to play an MP3 causes the Visualizer to send a steady stream of 0's in the case of onFftDataCapture(), and a steady stream of -128's in the case of onWaveFormDataCapture() I've tried one of h6ah4i's suggested work arounds: to play a quiet dummy MP3 before playing the actual music MP3. However, I did not see success. I used the 30second and 60second quiet MP3's found here: http://www.xamuel.com/blank-mp3s/ Maybe those MP3's aren't suitable because there wasn't enough data to enage the tunnel player ? |
Hello abiemann. I downloaded the 1 min length MP3 from your suggested URL, and tried the workaround with using it. The result was good, it seemed to work on my S4 (SC-04E). Have you tried Poweramp player already? It's the most easy way to identify the cause is a tunnel player's side effect. |
Hi h6ah4i - I did try PowerAmp and with the Visualizer getting data from the mixer i.e. "audioSession=0" does indeed return real amplitude data instead of 0's. However, my app uses the MediaPlayer and no amplitude data was returned by the Visualizer API on my S4. On other devices like the Nexus 7, and Nexus 4 there's no problem. When I attempted the work-around with the quiet MP3, I simply created two MediaPlayer objects: one played the quiet MP3 first (looping was enabled), the second MediaPlayer then played the real music - but again I received no amplitude data from the mixer :-( |
@abiemann I made a sample code that shows how to avoid tunnel player. Can you try this? |
I want to test your sample app, to see if it fixes the problem. I only need the APK file to test, I don't need the source and the other files. Can you upload the APK file? abiemann, have you tested the file? I think that this bug is devastating for the music visualizer business. There is no point in making music visualizers if they can't work on the most popular devices. I am not going to make any more music visualizers until this is fixed. It simply results in too many refunds and complaints from users. This bug also makes people want to buy iPhone instead, since music visualizing works without problems there. |
Maybe we should contact the Code Aurora project, since they are responsible for this bug? |
Sorry about that long delay - and thank you h6ah4i for your effort ! |
@abiemann, great to hear you've found a workaround for the tunnel player. Do you think you could perhaps integrate the same workaround into this project and submit it as a Pull Request, so others can benefit? Thanks |
I have tested on my S4 Mini. The visualization works the first time the project is installed from Eclipse. I test with the music players "Sound picker" and "Choose music track". I close "Tunnel player workaround" and then start it by clicking on the app icon. The visualization also works now for both of the music players. I restart the S4 Mini and open "Tunnel player workaround". The visualization does not work now, it only shows a flatline. abiemann, do you get the same problem when you restart your S4? h6ah4i, is it possible to make the visualization work then the device is restarted? It seems like the restart messes up something. |
@mobilevisuals I think it's impossible to make the workaround more reliable. No way to obtain whether the MediaPlayer instance backend is a tunnel player... |
h6ah4i; Do you get the same problem when you restart your S4? |
Felix: Have you tested this on your mobile? Do you get the same problem when you restart it? I want to know if this only happens on the S4 Mini, which is a very compact device. This makes it limited in some ways, it doesn't have the full capacity as the S4. |
@mobilevisuals The demo app works properly on my S4 after rebooting. |
That is really good to hear! Have you deployed this code fix in your Visualizer app? It is a big improvement, since S4 is the most popular device now. Mobiroo tested some of my company's visualizer apps and they found that visualization does not work on the Vanilla build on the Galaxy Note, HTC Evo 3D, Samsung Galaxy S3, and Samsung Galaxy S2.“ It is called Vanilla when not customized from its original form. They found the same problem on the integrated build of Galaxy note, Galaxy S2, and HTC Evo 3D. Is Galaxy Note derived from S4? I assume that the code fix won't solve the problem on the Nexus devices, HTC Evo 3D, S3 and S2,since these are not derived from S4. Which part of the code in the project can be used to fix the problem? I can add it to one of my visualizer apps and then send it to Mobiroo for testing. Then we'll know on which devices it works. |
I got a response from Samsung today and they want a description of the problem. Isn't this also caused by a bug in the Digital Signal Processors? If so, how should I describe the DSP connection? This is what I plan to write, can you tell me if this is OK or if should add or remove something? Music visualization should work on all the new Galaxy devices according to the specification, but it does not work on a lot of the new high profile devices, like the S4. We have investigated the problem and we came to these conclusions: Galaxy S4 and derived models These devices use a hardware acceleration playback mechanism called "Tunnel Player (Tunnel Playback)" when playing music files. If the tunnel player is used, audio capturing process is bypassed. As a result, visualizer does not works at all. This issue is already reported on Samsung's developer forum, but it seems not fixed yet. Other Galaxy devices It has been showed by tests conducted by Mobiroo that music visualization do not work on Galaxy Note and S3. Snapdragon based S3 uses LPAPlayer for MediaPlayer class backend. The "LPA" means Low Power Audio, and the LPAPlayer seems very similar to tunnel player, so this is probably causing the problem here. We do not know the reason why music visualization does not work on Galaxy Note. |
I've already introduced this workaround method in my Music Visualizer app since v1.5.0 (about five months ago). But sometimes the workaround fails, because another player app has already gained the tunnel player instance before my app launched. So, even now, some users report me that my app sometimes does not work, or suddenly stopped to work. I don't know about Galaxy Note, S2, S3 and HTC Evo 3D's issues. At least my app works on my Galaxy S2 (SC-02C with stock Android 4.0.3 ROM) and HTC Evo 3D (ISW12HT with stock Android 4.0.3 ROM). And I know a bit about S3. Snapdragon based S3 uses LPAPlayer for MediaPlayer class backend. The "LPA" means Low Power Audio, and the LPAPlayer seems very similar to tunnel player. Yet, I'm NOT sure the LPAPlayer is the evil.
Sorry, I don't know WHY visualizer doesn't work when tunnel player is used. I haven't read the TunnelPlayer class, ALSA and lower drivers implementations completely. So I can't describe about DSP : ( Are you going to write about THIS issue ticket? I think it provides very useful information for Samsung's developer. And... I'm not good at English, so please correct my sentences more preferable. |
I have reported to Samsung now and I referred to this thread. Thanks for the S4 code fix! I am going to add it to one of visualizer apps. I hope that it solve this issue for S4, but there are a lot of other devices with problems It would be good if we could list all the devices, which don't support music visualization. These could then be excluded from the compatibility list on Google play. This would decrease refunds and bad reviews. Do you know any more new devices,which don't support music visualization? |
There's one additional technical detail that I just discovered on my Galaxy S4... This will happen even with the tunnel workaround implemented, and for any audio session ID, and even with the Visualizer scaling mode explicitly set to SCALING_MODE_NORMALIZED. If the media volume is increased just slightly then the Visualizer data will start coming through again. |
h6ah4i: I try to add your S4 code fix to my app "Astral 3D visualizer", but I can not get it to work. I put the call mSilentPlayer = createSilentMediaPlayer(); right before I create my own Mediaplayer in onCreate() of the main activity. The silent media player doesn't get started , which makes the tunnel player start. This makes the music visualization not work. I test on my S4 mini, but also on S4 on Samsung Remote labs (or should music visualization not be tested here?). It is the same result on both of these. I debug the code and I see that mp.setDataSource causes an IOException. The values for the arguments are: FileDescriptor 45 I then debug tunnel_player_workaround and it is the same values and the same IOException here. I only see a flatline on tunnel_player_workaround now. I uninstall the app and install again, but it is the same thing. I test on S4 on Samsung Remote labs, but it is the same thing here. I haven't changed any code in tunnel_player_workaround. Do you know how I can proceed here? |
@mobilevisuals It seems strange. On my S4, ParcelFileDescripter is like the flollowing;
FileDescriptor value is different, but it's OK, this value is determined on runtime. However len parameter is different, it's a problem. Maybe your MP3 file is broken. |
The MP3 file that I use is 34 478 bytes and has MD5: 1D52337F55B07B6B823F5BFA9C4452FB. Do you have the same on your file? If so, how can the file be broken? |
I don't know why your MP3 file is different from mine... Please download it again from the repository. https://github.com/h6ah4i/tunnel_player_workaround/blob/master/assets/workaround_1min.mp3
|
Thanks, I got it to work on the S4 now! I tested on Samsung remote labs. It is possible to test there, but you have to go to the settings and turn up the media volume, because it is set to 0 as default. You will always get a flatline if you don't do that. Have you tested your app on Samsung remote labs? Maybe we should test the visualization on all the devices there? This would make it possible to exclude the incompatible devices, which would reduce the bad reviews and the refunds. I also tested on S4 Mini, but the music visualization still does not work on tunnel_player_workaround or Astral 3D Music Visualizer . S4 Mini is however a very compact device, with some limitations. |
I am listing the devices, which don't support music visualization. These can then be removed from the compatibility lists on Google Play, to avoid bad reviews and refunds. I checked all the reviews for my visualizer apps and found these incompatible devices: S4 mini,Nexus 5,Kyocera Rise,LG Spectrum 2,Nexus 4,Nexus 7,Galaxy Note Galaxy Note was incompatible according to Mobiroo's testing, so I added that one too. Mobiroo says that the integrated build of S3 is compatible, it is only the vanilla build, which is incompatible. Mobiroo also says that it doesn't work on neither the Vanilla build nor the integrated build of HTC Evo 3D and Galaxy S2. This is very strange, since my apps only have got reviews from these devices, where music visualization worked. These devices support music visualization according to the reviews of my apps: Galaxy Note2 |
Issue: "Visualization does not work on the new Galaxy devices" felixpalmer#5
Issue: "Visualization does not work on the new Galaxy devices" felixpalmer#5
@MikhailSakh Hi. I think this app (android-visualizer) works on Nexus 7 (2013, flo) with CM11. Do you use another visualizer app and player app? I tested the latest CM11 (cm-11-20140809-NIGHTLY-flo.zip) and self-built AOSP on my Nexus 7 (2013, flo). The result was as the following;
As you can see, the results are the same on CM11 and AOSP. Moreover, it's also the same on the Google's Official Factory Image. |
@h6ah4i It's just doesn't start after install... I can send startlog, if its help. |
Do the new Samsung devices still have this issue? I haven't got any complaints from customers for a long time about the music visualization, so it seems like the situation has improved. I have however not tested on the new devices, so I am not sure. |
Yeah, that's weird. I haven't had complaints from Samsung users in a long On Wed, Dec 24, 2014 at 7:27 AM, mobilevisuals notifications@github.com
|
Tried on my Nexus 4 after upgrading to Lollipop. And the visualizer only returns zeros on the output mix. If however you are able to get the specific audioSessionID It is possible to get data. I would guess it is some kind of privacy setting, but I havent been able to find anything in the release notes or on the phone itself.
|
Hi, I used the visualizer recently in my app. It works nicely in the Samsung Galaxy S5. I tried it on a Samsung Galaxy SIII and it won't work, plus it sometimes crashes the app (not always). I might just have to remove it from view if it's on that list of devices listed on here. Too bad. Looking forward if someone finds a working solution. Thanks. |
It might be a manifest permission problem. You may need to also provide microphone permissions with visualizer in Android 5+ I think because of the way it accesses the mixer ... No one has bothered posting any logcat info. This is the first thing to look at, esp during a major version OS smackdown like Lollipop. Lots of permissions have tightened up. |
noni-mizu : That is because Samsung released lots of garbage mobiles a few years ago, like S4 mini. Now they are finally releasing good mobiles again, like the S6. We have tested on S6 and it supports music visualization, but some music players don't work like Spotify. |
Does anyone know if this is the same reason the visualizer doesn't work on an Amazon Fire TV? |
It is obviously a cross platform issue with android's Visualizer class. This is an experimental CPU-bound FFT class with many restrictions stated in the very limited docs. Some devices restrict access to the linux driver streams (like audio). This is esp. true of hardware-secured "consumer appliance" type devices like Fire, Chromecast, etc. Even granting root permission may not resolve this. This thread mentions many of the devices that it does work on, so app devs can restrict playstore distribution to devices that are known to work. GPU-bound FFT would be a better solution for DSP, but still would encounter the permissions issues on some devices. |
I do suspect that audio session 0 is (should be) deprecated and Visualizer's documentation has failed to mention it, which is unsurprising given how sparse its documentation is. If you look at the AudioEffect documentation, it has listed audio session 0 as deprecated since three years ago. Here's the commit where it was deprecated. |
Session 0 is (was) an aggregate of all audio sessions, which represent(ed) a security issue. |
Hi, I'm having the same problem with S6 Edge+, where only operate the equalizer and visualization effects to the connected Bluetooth. Applications that did not work: Dub Music Player + Equalizador: https://play.google.com/store/apps/details?id=hr.palamida The effect of viewing only works when converted to MP3 music for another extension, for example OGG. The following illustration as an example: I'm downloading and testing various music applications with visual effects and equalizer and among them one that follows is working: https://play.google.com/store/apps/details?id=com.onkyo.jp.maidenaudio Why does it happen? Thanks Florencio Mello |
Please see the comment above about the session number. These apps are likely passing insecure sessions (session 0), that bluetooth is somehow allowing. You should contact the apps developers directly. I am sure they will appreciate your free QA (and awesome graphics). |
Thanks for the reply, which leaves me in doubt is that my wife has a Galaxy S6 Edge (not plus) and everything works. |
There are many factors than can cause this. |
On (at least) Samsung Note 5, tunnel.decode property returns empty but analysis through the java Visualizer class fails. So use the intro sound to see if we'll get any data in that class. TunnelPlayer Workaround not needed, which apparently we weren't even using (it has to be initialized), and even when used apparently doesn't work on all devices. The good reference I've been using: felixpalmer/android-visualizer#5
So, I have in last week built a test app (in real it is a Titanium module -- anyway) The visualizer works fine on Caterpillar S40 (Android5.1) and on OnePlus (Android4.4). It works with ID=0 and bind on special id. Further it works with Mediaplayer and with the module https://github.com/trevorf/ti-android-streamer which based on https://github.com/vbartacek/aacdecoder-android (Audiotrack) Additional I have tested with my NEXUS5 and NEXUS6P -- both devices works with Marshmellow. |
Hello All. I had stuck with this problem too. I develope application with VU-meters and need mixed audio volume including music. But I have got proper signal from microphone not from Visualizer(0). The "silent player" workaround by @h6ah4i probably won't help to me. I had downloaded and installed his Music Visualizer 1.6.6 - it shows vizs only when "player" and "microphone" modes. But in "snoop" mode vizs are not active. My device is not from Samsung or HTC - I test program on rather old Huawei MediaPad S7-301 with Android 4.0.3 (API 15). I got signal from Visualizer only when my device plays system sounds but not music. I tried different players including several rare progs. So strange cause Android on old Huawei devices is known as "native" - it wasn't redesigned, it was used "as Google made" instead. And what is MOST strange for me - once I saw output from Visualizer. I cannot yet tell what I did before cause it was first app start at morning. First 1024 bytes block of incoming data contained defenitely positive audio level values. I saw them in debug output. But all next data contained silence. |
Added. |
1 similar comment
Added. |
Added.
I have build project and first ensured that my tablet beeped while starting my VU-meter. Then I commented mP.start() then rebuild and run program again. The result surprised me a lot! I have got working VU-meter with FolderPlayer - but Visualizer 1.6.6 did not work with it in shoop mode. But what is most surprising - VU-meter does NOT work with stock Google Player. But Visualizer 1.6.6 DOES. I'm finally weird with these Android bugs... |
Things are going more strange. At next day I started my VU-meter and FolderPlayer right now after it. But... VU-meter did not work with FolderPlayer. Then I started Google Player - and VU-meter DID work with it. Before run Google Player I did not close FolderPlayer - just paused it. That means - FolderPlayer occupied MediaPlayer serivce and it forced Google Player play around tunnelling. But... I run MY VU-meters before it - it occupies MediaPlayer at first. I even added mP.start(); mP.pause(); to my code - to be sure MediaPlayer stays on pause. But this didn't help. What does this all mean? First - on my tablet players can occupy hardware music tunnel and force other players use software stream instead. Second - MediaPlayer "prepare" and even "strat/pause" trick does not work as needed. It does not occupy hardware tunnel. What is strange for me - even if I start sound without pause, then I always get debugging message in IDE: "MediaPlayer( 3748): start() mUri is null". Even "MediaPlayer( 3748): stop() mUri is null" appears when I turn off MediaPlayer mannually. |
Finally I completely removed code with silent MediaPlayer - behavior remained the same. First started player blocks hardware channel then second plays through software. And my VU-meter shows it's level. I returned to the beginning and will look how fix this again. |
@abiemann With SCALING_MODE_NORMALIZED set explicitly, I seem to get more unique values the higher I raise the volume. Do you know why this is? I am getting waveform data if that changes things. |
A visualizer can have an internal music player, which means that the app has its own built in player. It can also use the music from external music players( Winamp for instance). Visualization for external players does not work on the new Galaxy devices.
I have played music with external players, while debugging the visualizer apps. The bytes in the updateVisualizerFFT method are always 0 for external players, when a visualizer is created with 0 as an argument.
This results in no visualization, since there is no signal to use for visualization.
It still works for internal players. The bytes in the updateVisualizerFFT are not 0 then, so the app has something to use for visualization, even when the visualizer is created with 0 as an argument.
This is caused by an Android code bug in the Digital Signal Processors, which are included in the new Galaxy and some HTC devices.
Several visualizer apps have this warning message:
"NOTE: To Galaxy S/S2/S3/S4, Galaxy Note 1/2, Galaxy Nexus and HTC Rezound owners: The visualizer will sporadically show a flatline with many music players, due to an Android bug related to the built-in DSP in these phones. This is a problem for all music visualizer apps on these phones, as evidenced by user reviews of other apps. Still looking for a work-around, but we'll probably have to wait for a future version of Android to fix it. If you have this problem, I apologize! Please email me and I will refund you."
Almost all visualizer apps on the market have this problem and can’t visualize from external players on the new Galaxy and some HTC devices.
It seems like it is possible to solve this problem, because external visualization works on the Morphyre Music Visualizer. It is right now the only visualizer on the market, where this works.
The text was updated successfully, but these errors were encountered: