Skip to content
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

Make sceMpeg and sceAtrac basiclly workable for PC #997

Closed
wants to merge 58 commits into from

Conversation

@oioitff
Copy link
Contributor

commented Mar 15, 2013

I use ffmpeg for video decoding and dshow for at3+ audio. And I have tried my best not to break other platforms yet. In fact, the video part which using ffmpeg may also be possible for other platforms.
By the way, I haven't add the header file and lib for ffmpeg and dshow yet. I'm not sure how to do this and need some helps.

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 15, 2013

Here is a build I make just now, welcome for testing:
https://docs.google.com/file/d/0B1ftGc2t9-dZcGpBT0NCb3AwT3c/edit?usp=sharing
By the way, it need install SonicStage yet for at3+ audio.

@hrydgard

This comment has been minimized.

Copy link
Owner

commented Mar 15, 2013

Yes, of course. Thank you!

It looks like this branch needs to be rebased on master though (or merge from), it includes some changes that are already made there.

@unknownbrackets

This comment has been minimized.

Copy link
Collaborator

commented Mar 15, 2013

I've noticed some bugs but it generally works. Looks like some font changes are also included as well as control changes (at least in the binary)?

I think we had worked out how to link in a static build of ffmpeg instead of dlls, but code shouldn't really be affected. Sometimes audio is looping something fierce. Probably an HLE issue. It also doesn't seem to maybe speed up when hold tab (hard to tell..)?

Also, when video is supposed to be overlaid with graphics (such as subtitles), it seems like it's not happening properly. And in Crisis Core, it's immediately saying "end of video reached", so this appears to break Crisis Core. Also breaks Tales of Eternia. It also isn't working yet for psmf, which I'm sure is fine.

Tested with: Senjou no Valkyria 3 (works, audio loops), Crisis Core (broken?), Lunar (no video, some audio missing), Space Shooter for 2 Bucks (no video, works), Tales of Eternia (broken), Exit (broken, always shows black... game still runs and music works though...), Ys Seven (seems great), Zettai Hero Project (still no audio...), Final Fantasy 3 (audio cuts short), Final Fantasy 1 (black screen only...)

Overall, definitely interesting.

-[Unknown]

@Daniel-Griffiths

This comment has been minimized.

Copy link

commented Mar 15, 2013

It sucks that this can only work for the windows version but it will probably be a long time before we get a better alternative that works on all platforms. Its very cool to see music and video working though.

@hrydgard

This comment has been minimized.

Copy link
Owner

commented Mar 15, 2013

@BubblegumBalloon , the video decoding can be made to work on all platforms. It's just the audio... but that's bad enough :P

@Daniel-Griffiths

This comment has been minimized.

Copy link

commented Mar 15, 2013

Ah well thats good! Until audio is working I can just save game OST's to my device and play the music in the background. :P

@hrydgard

This comment has been minimized.

Copy link
Owner

commented Mar 15, 2013

Having read through this change a bit more now, it feels a little too high level for my taste - it's like it plays the video and audio "on top" of the emulation instead of within it. Timing is all off as the audio is played back by dshow instead of being decoded into RAM and then played back the regular way, and the video is just drawn on top, instead of ending up in VRAM where it can then be drawn as a texture by the game itself.

That said, it's definitely an approach that works in some cases.

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 16, 2013

Yeah, I think that way is easier to control and maybe faster than the normal way.

@livisor

This comment has been minimized.

Copy link
Collaborator

commented Mar 16, 2013

In diva extend when you get to title screen and wait a video should normally start up.but on ppsspp you get a white screen with a lower resolution than the device screen(nexus 7) but if you press O and get to title screen and wait a gain,the video actually plays,can anyone check if that means scempeg already works?

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

I have fixed for CG or audio can't play issue for most of games as well as bgm looping issue. It may work better now.
Download Link: https://docs.google.com/file/d/0B1ftGc2t9-dZT1RiNHF0Z0g4TUU/edit?usp=sharing
I will try to update my source code as soon as possible. If anyone finds some bugs, welcome for reporting!

@raven02 I fix it in ResizeDisplay() in WndMainWindow.cpp , keeps PSP_CoreParameter's renderWidth and renderHeight unchanged. I haven't merge it into my source code yet.

@livisor

This comment has been minimized.

Copy link
Collaborator

commented Mar 17, 2013

I mentioned a few posts ago about video already working in diva extend,take a look:
https://www.youtube.com/watch?v=VsKBBX6UJzI&feature=youtube_gdata_player

@hrydgard

This comment has been minimized.

Copy link
Owner

commented Mar 17, 2013

That's not a video, it just uses the game engine to display Hatsune Miku singing a song.

@livisor

This comment has been minimized.

Copy link
Collaborator

commented Mar 17, 2013

Ohh,what about the first white flickering screen?that might actually be a video?

@hrydgard

This comment has been minimized.

Copy link
Owner

commented Mar 17, 2013

Yeah. The title screen alternates between playing a video and playing a "game engine" demo.

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

@raven02 Yes, that's it.

@raven02

This comment has been minimized.

Copy link
Contributor

commented Mar 17, 2013

I tried the propose fix but looks like not working in latest build now

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

Hmm, that's strange. Have you tried to delete that two lines?

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

Hmm, I also tried in the newest version, and it works yet. Have you changed the window size to x1 before loading a game?

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

Maybe the change is in Framebuffer.cpp. However, I only change DrawPixels() and BeginFrame() functions in that files...

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

Yeah, so the change should be PSP_DISPLAY_PIXEL_FORMAT_8888 in DrawPixels() functions.

@Daniel-Griffiths

This comment has been minimized.

Copy link

commented Mar 17, 2013

Whats left to change? Its looking good at the moment.

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

@BubblegumBalloon Some videos and audios are still broken yet...

@raven02 Maybe I need to test that game and find out what fixes it.

@amihi

This comment has been minimized.

Copy link

commented Mar 17, 2013

@oioitff
Maybe i can help with some tesing work,please see Tieba where your post,if yes,do like i said,i have to go to sleep :( already the time is 0:08 AM 3/18 in China.

Edit:My id named マオ·リーシャ in Tieba

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

@raven02 Hmm, I have tested that game and find out the fixes actually is in my mpeg fix. Try to delete ctx->mediaengine->writeVideoImage(buffer, frameWidth, ctx->videoPixelMode);
in sceMpegAvcDecode() of scempeg.cpp, that function is no use for now. My build fixes it because I don't use that function yet.

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

@amihi Thank you very much! Welcome for your testing!

@livisor

This comment has been minimized.

Copy link
Collaborator

commented Mar 17, 2013

I would like to test aswell the video decoder as I assume it will fix a lot of games that depend on it and don't work atm.does this build also fix the avcdecodeflush error in some games?

@unknownbrackets

This comment has been minimized.

Copy link
Collaborator

commented Mar 17, 2013

@oioitff how how would it be to make the rendering happen inside of writeVideoImage?

-[Unknown]

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2013

@unknownbrackets Just send the image to the buffer, and it may send to the display framebuffer. However, display framebuffer is closed in default.

@livisor Maybe you can use this: https://docs.google.com/file/d/0B1ftGc2t9-dZelZRWE91M0FHUEU/edit?usp=sharing
it based on the lastest git version.

@Abelus

This comment has been minimized.

Copy link

commented Mar 18, 2013

You say that the loop problem was fixed, but I'm having the same music loop problem with the latest version :( Tested on legend of heroes TITS, FF type 0, Crisis core, Ys 7

@oioitff

This comment has been minimized.

Copy link
Contributor Author

commented Mar 18, 2013

Hmm, maybe that is not the loop issue. Is that audio only partly playing?

@Ritori

This comment has been minimized.

Copy link

commented May 30, 2013

@talesfan you maybe need report on forum :)

@talesfan

This comment has been minimized.

Copy link

commented May 30, 2013

@Ritori I already did sir.. But no reply until now.. I guess I will keep waiting until it fixed by dev team :)

Anyway, good job for the new decoder and good luck for the next build, dev team :D

@7331Squall

This comment has been minimized.

Copy link

commented May 31, 2013

Curious... Death Jr. is treated as Playable, even though no video works, even using the Video-Enabled version...

I mean... It's constantly Black-Screening me, a game like that should be listed as "in-game". not "Playable"...

Ahhh... Anyway. Damn, that turbo tip really work! (except for Death Jr, god knows why...) Thanks a lot!

P.S.: Anyway knows how to fix Shadow Distortion on Crisis Core? Besides, that effect of rendering a part of the screen in 1/4 of it in Dissidia is also affecting this one sometimes.

@cyclonmaster

This comment has been minimized.

Copy link

commented May 31, 2013

Where is android version for this video support? I remember there is somewhere last time.

@Nightmesh

This comment has been minimized.

Copy link

commented May 31, 2013

@7331Squall As long as you can get in game and their aren't any crashes or significant bugs then it's playable. Video support isn't necessary to finish any (that I know of) psp game.

@asbel123

This comment has been minimized.

Copy link

commented May 31, 2013

kingdom hearts birth by sleep new version ppsspp it crashed on cideralla world on terra when he fight unversed after that custence doesnt load at all give white screen

@Ritori

This comment has been minimized.

Copy link

commented May 31, 2013

@asbel123 post on forum or create new issue with log etc.. that will help dev team to fix it :)

@haidareater

This comment has been minimized.

Copy link

commented May 31, 2013

i'm play God eater Burst in this lastest Build https://docs.google.com/file/d/0B1ftGc2t9-dZbjdnRnhnaUtZalk/edit?usp=sharing
my problem why when i do first mission is crash .. please help me :(

@Ritori

This comment has been minimized.

Copy link

commented May 31, 2013

@haidareater that version dont be merge with official build yet if u want play that game then use official one :)
that version is outdate :) oioitff busy doing other thing so you need to wait 8.0 come out :)

@asbel123

This comment has been minimized.

Copy link

commented May 31, 2013

what with final fantasy 4 text its doesnt come up with new version anymore i turn it off bufferd rendering on older version it come up perfect now new version doesnt workanymore

@Ritori

This comment has been minimized.

Copy link

commented May 31, 2013

@asbel123 i don't know why u report here at oioitff video build pull request please report here
http://forums.ppsspp.org/forumdisplay.php?fid=5 on that game thread :)

@CPkmn

This comment has been minimized.

Copy link
Contributor

commented Jun 1, 2013

In these past few days I've learnt a lot.

Fairy Tail Zelef Kakusei and Shining Ark taught me how to play MPEGs very slickly without ending early. Fairy Tail Zelef Kakusei also taught me an error in sceAtrac which prevented the titlescreen BGM and (some) sound effects from being played. Additionally fixing that in Fairy Tail also fixed Burnout Dominator's audio (I fixed it a while back, but I believe Fairy Tail taught me how to do it better).

Burnout Dominator taught me I need to improve YCbCr videos (I haven't touched some parts of those) because its videos end early in my build (since parts of it use YCbCr, which I haven't modified, and parts use other methods I did modify so there were issues).

And I did a test with throttling with my video timing improvements (not yet done in YCbCr). The opening videos in God Eater Burst and Shining Ark both played fluidly and ended on time even when I had throttling on throughout the entire videos (although God Eater Burst still doesn't seem to actually end the video...I guess it waits for a certain value PPSSPP isn't setting/isn't setting right in the ram or something to end the video, but I did get it to detect "End of video reached").

@Ritori

This comment has been minimized.

Copy link

commented Jun 1, 2013

That nice, maybe u can give henrik and other test u build :D? btw found another method to fix god eater burst sky?

@haidareater

This comment has been minimized.

Copy link

commented Jun 1, 2013

but i want play god eater with BGM :(

@Squall-Leonhart

This comment has been minimized.

Copy link

commented Jun 1, 2013

buy a psp!

@Ritori

This comment has been minimized.

Copy link

commented Jun 1, 2013

@haidareater God Eater burst alredy has BGM and sound effect on official latest build
download here
http://buildbot.orphis.net/ppsspp/

Download this a put in ppsspp folder
http://www.mediafire.com/download/0zhabr0snqisdx9/at3plusdecoder.dll

except cutscene if u want build it yourself :)
I got bgm and sound fx nicely :)

@7331Squall

This comment has been minimized.

Copy link

commented Jun 2, 2013

@Nightmesh I'm sorry, but If a game makes me wait almost half an hour after finishing playing sounds, and turbo has no effect, then I can't classify it as playable...

Though I suppose you're right if the video's not a part of the game.

But you see... For me it IS a very important part of the game. Specially when it takes almost an hour and is unskippable.

@alzamer2

This comment has been minimized.

Copy link

commented Jun 2, 2013

when i play FF vii core the video & subtitle are synchronize (but the video & Audio was slower to synchronize with subtitle ) usually the subtitle is the one which synchronized with video & Audio by becoming faster

@HeartexceL

This comment has been minimized.

Copy link

commented Jun 2, 2013

Final Fantasy crisis core movies/videos is now working with a sound with the latest build. :) nice job.
best of luck.

@oioitff oioitff closed this Jun 2, 2013
@7331Squall

This comment has been minimized.

Copy link

commented Jun 3, 2013

WOW!!!! They're indeed synchronized, but lagging as hell!

I mean, the sound keeps lagging, stuttering...

Any Idea how do I fix this? And... is there a x86-64 version?

Anyway! Great Job, guys!

@MrVentus

This comment has been minimized.

Copy link

commented Jun 3, 2013

Does anyone know how to fix this in Kingdom Hearts Birth by Sleep?

capturar

@Squall-Leonhart

This comment has been minimized.

Copy link

commented Jun 3, 2013

stop using the builds provided here, the builds provided from the orphis buildbot have both movies and bgm and don't have that issue.

@7331Squall

This comment has been minimized.

Copy link

commented Jun 3, 2013

@Squall-Leonhart (...Nice nick, by the way...) Where can we find these builds, really? Here? http://buildbot.orphis.net/ppsspp/

I mean... That's the one I'm using and it's lagging a lot!

Besides, it doesn't work so well... It won't keep the resolution when I full-screen (what fixes texture alignment in here and is less performance consuming) like the last version provided here does.

I mean, I specify it to keep 1X rendering without texture scaling, the textures align perfectly.

However I end up playing at 2X rendering and 2X texture scaling... And it won't keep a 2X rendering resolution like the last version provided here does...

@Squall-Leonhart

This comment has been minimized.

Copy link

commented Jun 3, 2013

performance issue is probably coming from the use of an underoptimised version of the act3plusdecoder.

@7331Squall

This comment has been minimized.

Copy link

commented Jun 3, 2013

Well... It's even in the download section at official page... I'm ashamed...

Still, I've edited the comment above... Like I say in there, it's lagging and it won't keep the 2X rendering resolution when I fullscreen it (I was going to type "Xx rendering", but...) but at least everything is in synch.

Now my only issues are:

  • Some Texture Alignment issues when the rendering resolution is not 1X
  • Audio lagging in movies, while images are flowing apparently fine.
  • The Buffered Rendering overlay that occupies only 1/4th of the screen, like this:

overlay1
(I guess it's not a spoiler, sorry if it is)
overlay2

*And 1X rendering no longer keeps the resolution when I fullscreen.
ppssppwindows_normal 2013-06-03 16-44-11-74

Both are at a 1920x1080 fullscreen. The above from the latest version provided here, and the below from the latest in Orphis. Indeed the bottom looks better, but it impacts my performance and it makes a few places lag where it wasn't before (like finishing a battle in Dissidia).

I suppose the last one is not that much of an issue, but why not put an option to use Windows Resolution in fullscreen or keep the native one instead?

@hrydgard

This comment has been minimized.

Copy link
Owner

commented Jun 3, 2013

Please stop posting in this thread. It's way too big and is slow even in Chrome on an i7 ...

Issues should be posted as new issues, not here.

The End.

@7331Squall

This comment has been minimized.

Copy link

commented Jun 3, 2013

Sorry for asking for help.

@hrydgard

This comment has been minimized.

Copy link
Owner

commented Jun 3, 2013

You can ask for help, just not right here in this thread. Create new issues describing your troubles. I will delete any further posts in this thread.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.