Exult on iOS has frequent distortions with current MUNT

Developer's Forum for discussion of bugs, code, and other developmental aspects of the Munt Project.

Exult on iOS has frequent distortions with current MUNT

Postby Dominus » 2016-11-16 @ 09:52

We recently streamlined Exult's mt32emu with current MUNT again (after a decade or so). Unfortunately the iOS port exhibits frequent distortions. Probably needs some ARM optimizations or there is another problem.
The exult-ios port and the changed mt32emu code https://github.com/litchie/exult-ios/co ... b11c84833e
Main Exult (same commit) https://github.com/exult/exult/commit/c ... 106e468b5e

I've also added a bug report to SF https://sourceforge.net/p/munt/bugs/25/
You do not have the required permissions to view the files attached to this post.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Exult on iOS has frequent distortions with current MUNT

Postby sergm » 2016-12-01 @ 16:32

Hi, Dominus!

I'll take a look at the code yet but from a glance it seems an easier solution would be to make munt render asynchronously.
sergm
Oldbie
 
Posts: 732
Joined: 2011-2-23 @ 16:37

Re: Exult on iOS has frequent distortions with current MUNT

Postby Dominus » 2016-12-01 @ 16:40

you can hit me up with anything to try :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Exult on iOS has frequent distortions with current MUNT

Postby sergm » 2016-12-02 @ 16:24

So, Exult now only plays music through the emulator, right? We don't need to hunt for the minimum latency or does this apply to the iOS port?
sergm
Oldbie
 
Posts: 732
Joined: 2011-2-23 @ 16:37

Re: Exult on iOS has frequent distortions with current MUNT

Postby Dominus » 2016-12-02 @ 16:33

It's only a problem when using the iOS port (with latest munt integrated). Xcode debug shows that it's not maxing out the CPU, if that helps.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Exult on iOS has frequent distortions with current MUNT

Postby sergm » 2016-12-02 @ 17:29

I wondered if we can increase the rendering buffer size (the easiest solution but it will impact the latency). Also, please check if the rendering is performed on iOS in the same thread as the other processing.
sergm
Oldbie
 
Posts: 732
Joined: 2011-2-23 @ 16:37

Re: Exult on iOS has frequent distortions with current MUNT

Postby sergm » 2016-12-04 @ 21:00

Well, I don't think that speed can be an issue. After some hours I managed to build mt32emu-qt and tested on iPhone 6 playing the intro from Monkey Island II -> perfect sound.
sergm
Oldbie
 
Posts: 732
Joined: 2011-2-23 @ 16:37

Re: Exult on iOS has frequent distortions with current MUNT

Postby Dominus » 2016-12-04 @ 21:12

Wow, mt32emu-qt on the iphone? Wow...
Sorry for not responding but weekend was busy... couldn't get to it ;(
So, getting Exult for iOS to run is much easier ;) you can just grab and compile it with xcode https://github.com/litchie/exult-ios (project file is in /ios). You only need one of the games which can be synced via itunes share
Apart from some include (config.h) Marzo changed Exult to easily accept your upstream changes.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Exult on iOS has frequent distortions with current MUNT

Postby sergm » 2016-12-04 @ 21:18

Don't panic. mt32emu-qt needs a lot of work to become a usable iOS app (and to be fair, android as well). You can look at whatamess it is now :)
I planned to get hands on Exult itself but first wanted to ensure that CPU is powerful enough to at least do the synthesis.
You do not have the required permissions to view the files attached to this post.
sergm
Oldbie
 
Posts: 732
Joined: 2011-2-23 @ 16:37

Re: Exult on iOS has frequent distortions with current MUNT

Postby Dominus » 2016-12-04 @ 21:34

Still... awesome ;)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Exult on iOS has frequent distortions with current MUNT

Postby sergm » 2016-12-05 @ 07:18

Yeah... Cmake appeared to be not quite that tool one needs to build mobile Qt apps :(
Even one (at least) Qt class is missing (!) when building for iOS.
But at least CoreAudio and CoreMIDI all works fine. Btw, the app creates a MIDI destination as usual. I wonder if that CoreMIDI destination can be used to accept connections from other devices via RTP MIDI.
Though, the most disappointing thing is that the app cannot work in the background, so connecting it to other apps seems to have no sense :(
sergm
Oldbie
 
Posts: 732
Joined: 2011-2-23 @ 16:37

Re: Exult on iOS has frequent distortions with current MUNT

Postby Dominus » 2016-12-05 @ 07:24

Yes, it would be great if you could use it in the background for other apps. I don't know if you can use CoreMidi to receive connections but you can use it to send Midi out. I've done that with my MT32, MIDI-USB adapter, Apple camera connection adapter and my iPhone through Exult :)
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Exult on iOS has frequent distortions with current MUNT

Postby sergm » 2016-12-10 @ 18:59

This is really weird. Even a single CPU core is capable enough to do the synthesis. However, if I open the "Credits" (or "Quotes") scroller, CPU load rises to over 140% but there are no more dropouts of the sound.
sergm
Oldbie
 
Posts: 732
Joined: 2011-2-23 @ 16:37

Re: Exult on iOS has frequent distortions with current MUNT

Postby Dominus » 2016-12-10 @ 19:51

Odd, never noticed that the credits and quotes run the CPU so high. And yes, no dropouts in that.
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna

Re: Exult on iOS has frequent distortions with current MUNT

Postby sergm » 2016-12-10 @ 20:46

BTW, I cannot see the way Exult resample the output of MT32Emu to the sample_rate required by the mixer. Previously, it was configured in the emu properties but now I can't see any reference...

Anyway, I checked the rendering thread to be the audio unit high-priority thread. Perhaps, we should organise yet another thread to pre-render samples and convert to the output rate, so more buffering to add.
sergm
Oldbie
 
Posts: 732
Joined: 2011-2-23 @ 16:37

Re: Exult on iOS has frequent distortions with current MUNT

Postby sergm » 2016-12-10 @ 20:49

Actually, it starts to sound funny when I change audio sample rate :)
sergm
Oldbie
 
Posts: 732
Joined: 2011-2-23 @ 16:37

Re: Exult on iOS has frequent distortions with current MUNT

Postby Dominus » 2016-12-10 @ 21:03

Yes, I noticed that as well that only 22k seems to sound like anything. For fun set it to mono ... crash...
User avatar
Dominus
DOSBox Moderator
 
Posts: 7283
Joined: 2002-10-03 @ 09:54
Location: Vienna


Return to MT-32 Development

Who is online

Users browsing this forum: No registered users and 1 guest