iOS app erratically freezing up when loading audio files

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

iOS app erratically freezing up when loading audio files

Ralph DiMola via use-livecode
Hi folks,

I really need your help now. I’m developing a simple app for a client, to be run on iPads in an exhibition starting 8th Oct. It consists of two cards:
a gallery card, with 16 photos
a profile card which you go to by clicking a photo on the gallery card

On the profile card this is loaded:
the photo again, larger
a short text in a field
an audio file (mp3), which starts playing

All resources are included in file folders with the app, no internet needed. The audio files are central to the app. They are recordings of people on Guernsey speaking Guernesiais, and sizes range from 1.6Mb to 2.6Mb.

In iOS a player is created with mobileControlCreate, and the audio controller is visible, so the user can pause, fast fwd etc.

The app design and coding is done and it works perfectly in the IDE, as Mac standalone (with standard player) and in the iOS simulator (iOS 13.3).

It works on the client’s iPads too (iOS 13.6), but irregularly freezes (rarely crashes), preventing further interaction until the app is killed and restarted. The freeze occurs at (or during)  
”mobileControlSet "voicePlayer", "filename", sAudioPath”

In the simulator I get a crash (app quits) if I don’t put ”wait 20 ticks with messages” after setting the file path, but never a freeze. I’ve tried to give the audio loading a full second wait, in case iPads are slower than simulator, and it prevents crash but not the random freezing.

The iPad user can sometimes load the same profile (or different ones, we see no pattern) 30-40 times before freeze occurs, sometimes just 3. So it doesn’t seem to have anything to do with cache build-up or so.

So, has anyone experienced similar problems with playing mp3 files on iOS?
Any obvious pitfalls?

The frustrating thing is that I cannot reproduce the problem in simulator (it works perfectly there), and have no iPad myself to hook up for Remote debugging. So I have to try various solutions, then upload a new build to TestFlight and wait for the client’s ”Sorry, it’s still freezing randomly”…

Help!

Hopeful greetings,
Andreas
WhenInSpace

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: iOS app erratically freezing up when loading audio files

Ralph DiMola via use-livecode
Some video problems can be solved by setting the filename of the player to
empty, waiting a few milliseconds, and then setting the new filename. I'm
not sure it will work in this case but it's worth a try.

Also, if you aren't using the latest version of LC, try that.

--
Jacqueline Landman Gay | [hidden email]
HyperActive Software | http://www.hyperactivesw.com
On September 29, 2020 3:48:55 PM Andreas Bergendal via use-livecode
<[hidden email]> wrote:

> Hi folks,
>
> I really need your help now. I’m developing a simple app for a client, to
> be run on iPads in an exhibition starting 8th Oct. It consists of two cards:
> a gallery card, with 16 photos
> a profile card which you go to by clicking a photo on the gallery card
>
> On the profile card this is loaded:
> the photo again, larger
> a short text in a field
> an audio file (mp3), which starts playing
>
> All resources are included in file folders with the app, no internet
> needed. The audio files are central to the app. They are recordings of
> people on Guernsey speaking Guernesiais, and sizes range from 1.6Mb to 2.6Mb.
>
> In iOS a player is created with mobileControlCreate, and the audio
> controller is visible, so the user can pause, fast fwd etc.
>
> The app design and coding is done and it works perfectly in the IDE, as Mac
> standalone (with standard player) and in the iOS simulator (iOS 13.3).
>
> It works on the client’s iPads too (iOS 13.6), but irregularly freezes
> (rarely crashes), preventing further interaction until the app is killed
> and restarted. The freeze occurs at (or during)
> ”mobileControlSet "voicePlayer", "filename", sAudioPath”
>
> In the simulator I get a crash (app quits) if I don’t put ”wait 20 ticks
> with messages” after setting the file path, but never a freeze. I’ve tried
> to give the audio loading a full second wait, in case iPads are slower than
> simulator, and it prevents crash but not the random freezing.
>
> The iPad user can sometimes load the same profile (or different ones, we
> see no pattern) 30-40 times before freeze occurs, sometimes just 3. So it
> doesn’t seem to have anything to do with cache build-up or so.
>
> So, has anyone experienced similar problems with playing mp3 files on iOS?
> Any obvious pitfalls?
>
> The frustrating thing is that I cannot reproduce the problem in simulator
> (it works perfectly there), and have no iPad myself to hook up for Remote
> debugging. So I have to try various solutions, then upload a new build to
> TestFlight and wait for the client’s ”Sorry, it’s still freezing randomly”…
>
> Help!
>
> Hopeful greetings,
> Andreas
> WhenInSpace
>
> _______________________________________________
> use-livecode mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: iOS app erratically freezing up when loading audio files

Ralph DiMola via use-livecode
In reply to this post by Ralph DiMola via use-livecode
Thanks Jacqueline, I’ll try that!

I use LC business 9.6.1 stable, Xcode 11.3.1

————————————
J. Landman Gay via use-livecode <https://www.mail-archive.com/search?l=use-livecode@...&q=from:%22J.+Landman+Gay+via+use%5C-livecode%22> Tue, 29 Sep 2020 22:17:57 -0700 <https://www.mail-archive.com/search?l=use-livecode@...&q=date:20200929>
Some video problems can be solved by setting the filename of the player to empty, waiting a few milliseconds, and then setting the new filename. I'm not sure it will work in this case but it's worth a try.
Also, if you aren't using the latest version of LC, try that.
_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: iOS app erratically freezing up when loading audio files

Ralph DiMola via use-livecode
In reply to this post by Ralph DiMola via use-livecode
Unfortunately, it didn’t work. It actually crashes the app in Simulator after doing it twice(!).

On the first go, it's loading the audio file, by first setting the path to empty, then to the actual path. All is fine.
Going back to gallery card, the player is stopped and deleted (as intended, mobileControlDelete).
Repeating the procedure a second time (go to profile card (same or other), create new player, load the audio file) now crashes the app every time, at the stage of loading the real path.

This is another flavour of strange, but a step backwards.

I think we’ll try with other audio formats than mp3, to see if it makes any difference...

If anyone has time, an iPad and interest in taking part in testing, I can invite you via TestFlight (my client approves).
————————————
J. Landman Gay via use-livecode
Some video problems can be solved by setting the filename of the player to
empty, waiting a few milliseconds, and then setting the new filename.


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode