rrathi / adamICS

This is adam ICS port
33 stars 14 forks source link

Hardware acceleration not available for video playback - MX player #54

Closed Tomsgate closed 12 years ago

Tomsgate commented 12 years ago

Title says it all: no hardware acceleration for video playback via MX player (feature was working on Froyo for same videos).

Ozols commented 12 years ago

I'm using MX Player version 1.5. If I tap on the screen, it shows a small button at middle of left edge saying HW. Tap on that, and a dialog opens for 'Select Decoder' -- you can select the radio button for H/W Decoder.

Now MX plays (not always great, but acceptably) 720p and 1080p baseline -- which it didn't on Froyo.

Ozols commented 12 years ago

It is possible that MX player has difficulty with certain data formats. I've seen it refuse to play specific videos, while it has no trouble playing others. [I've noticed the error message "Unable to resync. Signalling end of stream" in logcat.] If that is what is happening, I would think it's an error in MX Player -- not in the Adam's ICS build. [I'm running the CM9 Beta-ICS build.]

Tomsgate commented 12 years ago

I am aware of how to select hardware acceleration in MX player. Yet I haven't been able to activate it a single time. I always get the 'not supported' message, for any video file. In Froyo, I was able to watch these same files with hardware acceleration. Software decoding works mostly, but quality is inferior.

Ozols commented 12 years ago

It surprises me that you say that in Froyo you watched video files with hardware acceleration. Was this on an Adam? As far as I know, for the Adam there has been only one "generally available" pre-ICS ROM that had a kernel which supported video hardware acceleration. [It was IC2.zip in Aug 2011, which did not have sound (it was Honeycomb, not Froyo).] Perhaps you meant "Froyo with an overclocked CPU" -- overclocking is as yet not available in Adam's ICS builds.

Ozols commented 12 years ago

FYI - for anyone who cares. Started MX, told it to play file 01.13.avi. MX (under the covers) gave up on that file and instead played (next) file 14.481.avi Stopped MX, and took logcat http://pastebin.com/KZXg9Vyi and dmesg http://pastebin.com/NdX3QTTr

MrGuy commented 12 years ago

It's possible that Tegra 2 can't handle the codecs used in the video. Are you sure it played properly in Froyo using HW acceleration?

Maybe use a tool to figure out what codecs the Video/Audio streams use in your file, then post back here.

Ozols commented 12 years ago

MX Video Player and MoBo Player "quit" when directed to play file 01.13.avi. Other video players (e.g., QQPlayer and DICE Player} will play that file correctly. [The native Adam-CM9 video player does NOT show up as one of the candidates available to play that file.] Mediainfo of 01.13.avi: http://pastebin.com/VP0e5nM0

eduarcor commented 12 years ago

It happens not only in mx video player, but in mobo too. Before, I could open .mov (hd 1080p files from apple trailers) with froyo (NI latest rom) with hardware acceleration, without any problems, I have the same trailers (pirates of the caribbean 4, planet 51, sucker punch, and conan) to do the same test and in froyo works and in ICS not, decoding by software, with really poor quality and weird scalling... Same with avi files and wmv files. So, for sure is not Tegra 2 issue, is the drivers, that doesn't work properly.

MrGuy commented 12 years ago

Hmm, Try DICE player from the market. I've just tried it myself and it seems to work better than MX. Our hands are somewhat tied on this given the drivers are not implemented by us. It's a matter of shoe-horning the closed source binaries onto the system. Since the binaries we're using are somewhat new, it's possible they have quirks that the software may need to code around.

MrGuy commented 12 years ago

D/StagefrightPlayer( 1033): StagefrightPlayer I/AwesomePlayer( 1033): setDataSource_l('/sdcard/The_Hobbit-An_Unexpected_Journey_Trailer_720p.mp4') I/OMXCodec( 1033): [OMX.Nvidia.h264.decode] AVC profile = 100 (High), level = 31 I/OMXCodec( 1033): [OMX.Nvidia.h264.decode] video dimensions are 1280 x 544 I/OMXCodec( 1033): [OMX.Nvidia.h264.decode] Crop rect is 1280 x 544 @ (0, 0) I/ActivityManager( 167): Displayed com.inisoft.mediaplayer.trial/com.inisoft.mediaplayer.PlayerActivity: +336ms V/MediaPlayer( 1033): MEDIA_SET_VIDEO_SIZE V/MediaPlayer( 1033): MEDIA_PREPARED D/NvOsDebugPrintf( 116): Allocating new output: 1280x544 (x 9) I/OMXCodec( 1033): [OMX.Nvidia.h264.decode] video dimensions are 1280 x 544 I/OMXCodec( 1033): [OMX.Nvidia.h264.decode] Crop rect is 1280 x 544 @ (0, 0) V/MediaPlayer( 1033): MEDIA_SET_VIDEO_SIZE D/dalvikvm( 167): GC_CONCURRENT freed 698K, 21% free 8874K/11207K, paused 2ms+4ms

I can see it's not exactly 720, but essentially close enough (How hard is it to find a true 720p trailer on the net these days?!) - but it plays smoothly on my end. It actually looked quite good!

eduarcor commented 12 years ago

This is 720p! but 2.35 aspect ratio. In froyo worked with mobo. This is dissapointing... By the way, in mobo, I am not able to configure in the settings any file type (mov, avi) from software to hardware decoding, maybe because write permissions in the config file? It doesn't store the config when you go out to the menu again. Maybe thar's the reason, how can I fix it?

MrGuy commented 12 years ago

I don't understand, did you try DICE player? What is disappointing? THe media above played smoothly for me using that player. As for the settings you are unable to store, which app is this? Most apps use their own database in android for settings storage...

eduarcor commented 12 years ago

Yeah, DICE player is not too bad, but doesn't work well with flv videos, and is slower than mobo for mkv. That I was saying is moboplayer worked good before with froyo and doesn't work with ICS, which is dissapointing. The application which, I can't save the settings is mobo player. If you press the 3 dots (...) in the bottom menu, and then "Setting", there is an option "Types of file need to scan". Inside you can choose how you can play the videos (auto, software decoding, hardware decoding, close) for each file type. That I am saying is, when I tried to change for example "mov" to "hardware decoding" it doesn't store the configuration, and maybe, that's why mobo player doesn't work. Do you understand now? If not, please, let me know, and I will try again. Thanks.

MrGuy commented 12 years ago

I think I understand what you mean now. It's unfortunate Mobo player doesn't work the way it used to - this is probably because we are using newer drivers. It's possible the player isn't 100% compatible with the new ones, that's not really in our hands... Also with the settings saving issue, it seems unlikely that the ROM is to blame because the other applications hold their settings fine. When I get some time I'll poke around in it, but when closed source external binaries come into play debugging is difficult.

Tomsgate commented 12 years ago

Thank you for looking into this guys, I really appreciate it! Dice player indeed works much better. Shame MX player does not cut it anymore, but considering the smooth playback I get when using Dice player, I think you are probably right MrGuy: it's the players fault, not the Rom's.