garbear / xbmc

XBMC Main Repository
http://xbmc.org
Other
134 stars 53 forks source link

[rbp] [retroplayer] Add zero copy mmal support to retroplayer #62

Closed popcornmix closed 8 years ago

popcornmix commented 8 years ago

Probably not working, but it does compile. I'm not currently able to build the emulator add-ons - getting "bnes needs RPi build command in CMakeLists.txt!"

garbear commented 8 years ago

I'm not sure why this worked before but not now, you can see the error msg is here and results from the "rbpi" platform not having a build command. If it worked before, it was probably because it was using the "linux" core system name. Which of these is it set to currently?

popcornmix commented 8 years ago

I'm not 100% sure if I used the emulators I built last time, or the ones from LE repo. However if I ignore the add-ons that report "needs RPi build command", it still fails with:

CMake Error at /usr/local/lib/kodi/addon-helpers.cmake:131 (message): CMAKE_INSTALL_PREFIX /opt/xbmc-retro/arm-linux-gnueabihf differs from Kodi prefix /usr/local. Please pass -DOVERRIDE_PATHS=1 to skip this check

garbear commented 8 years ago

Hm, I've encountered this problem before. I applied adfc09fee6be669a9a38d64d9975ac405d0fa896, but I can't remember if this fixed the problem or not.

garbear commented 8 years ago

Is it fine if I merge this now? I'll keep the commits separate and if there's any changes you can just send another PR to this branch.

popcornmix commented 8 years ago

A mmal commit has just gone into master which has a minor conflict with this. You can merge this now, but you will likely hit the conflict when you next rebase.

If you update retroplayer-17alpha2 branch I can rebase this commit now, or you can give me a ping in future if you get a conflict.

garbear commented 8 years ago

which PR? I'll cherry pick it and you can rebase on that, then next time I rebase on a release (alpha 3) this will apply cleanly

popcornmix commented 8 years ago

https://github.com/xbmc/xbmc/pull/10120

popcornmix commented 8 years ago

(although you might need https://github.com/xbmc/xbmc/pull/10144 to apply that one...)

garbear commented 8 years ago

I cherry-picked that PR (and 4 others it required), but this PR still applies cleanly. Are these PRs needed?

popcornmix commented 8 years ago

I had a conflict here: https://github.com/garbear/xbmc/pull/62/commits/4828fc29a5ae8bdc2501ccd4e84c01c4428892cd#diff-c7916b114ea763a60c3ab748710a75d7R279 on my own tree as that line is no longer present on master...

I am in the process of building with https://github.com/garbear/xbmc/commit/adfc09fee6be669a9a38d64d9975ac405d0fa896 present to see if that fixes my issue.

With https://github.com/xbmc/xbmc/pull/10120 in place https://github.com/garbear/xbmc/pull/62/commits/18028ae9428285e6e592dbf45237cab71e7d351a can be dropped (although the next commit will need fixing up).

garbear commented 8 years ago

I plan to rebase on 17 alpha 3 when it's released (around 1 August), do you just want to wait until then?

popcornmix commented 8 years ago

I've rebased. Hit a build error:

xbmc/tools/depends/target/binary-addons/arm-linux-gnueabihf/build/peripheral.joystick/src/addon.cpp:288:31: error: 'class JOYSTICK::CJoystick' has no member named 'SupportsPowerOff'
   if (!joystick || !joystick->SupportsPowerOff())

Any ideas?

garbear commented 8 years ago

9663 adds power off support to the Peripheral API. My alpha 2 branch is applied on top of this PR. it looks like you're trying to build against master's headers, try building against RetroPlayer's peripheral API.

popcornmix commented 8 years ago

Are you just saying a need to do a clean build from this branch?

I think the new commit have also broken something:

RetroPlayerAudio.cpp: In member function 'virtual bool GAME::CRetroPlayerAudio::OpenEncodedStream(AVCodecID, unsigned int, const CAEChannelInfo&)':
RetroPlayerAudio.cpp:121:69: error: no matching function for call to 'CDVDFactoryCodec::CreateAudioCodec(CDVDStreamInfo&, bool)'
   m_pAudioCodec.reset(CDVDFactoryCodec::CreateAudioCodec(hint, false));
garbear commented 8 years ago

This looks correct, it references [CDVDFactoryCodec::CreateAudioCodec()](https://github.com/garbear/xbmc/blob/retroplayer-17alpha2/xbmc/cores/VideoPlayer/DVDCodecs/DVDFactoryCodec.h#L44]. The third parameter (bool) is optional, so calling with a CDVDStreamInfo& and a bool should compile.

popcornmix commented 8 years ago

I've rebased, but I'm struggling to run anything. Previously I was using this repo: https://retroplayer.freestylephenoms.com/8.0/RPi2/arm/addons.xml

I get as far as my code;

16:20:45 T:1661989904    INFO: RetroPlayerVideo: Creating video stream with pixel format: 44, 320x240
16:20:45 T:1661989904   DEBUG: CPixelConverter::Open: pixfmt:44(rgb565le) targetfmt:44(rgb565le) 320x240

but get a segfault from the game itself (e.g. 2048 or MAME 2010). Is that repo up to date with this branch's API?

popcornmix commented 8 years ago

Finally got retroplayer working again on Pi. I've updated this PR to include the upstream MMAL render commits plus updated support for MMAL rendering from retroplayer

I did find the second game I ran always crashes. Looks to be a bug here: https://github.com/kodi-game/game.libretro/commit/68d63518111466b979a5130a5947aeda089bf600#commitcomment-18360022 (possibly combined with something adding but not removing input ports).

But this PR should be okay for merging.

garbear commented 8 years ago

Cheers. I'll fix the game.libretro issue

garbear commented 8 years ago

The crash should be fixed now. I'm uploading builds for the new branch based on 17alpha3