• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: MusicSequenceFileLoad Crash on iOS10 (AudioToolbox/MusicPlayer)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MusicSequenceFileLoad Crash on iOS10 (AudioToolbox/MusicPlayer)


  • Subject: Re: MusicSequenceFileLoad Crash on iOS10 (AudioToolbox/MusicPlayer)
  • From: down to this <email@hidden>
  • Date: Fri, 23 Sep 2016 07:41:32 +0900

Sven - 

Thanks for the followup on this! Sounds like we may be experiencing a slightly different issue. I haven't had any problems loading MIDI files on iOS9 (or 8 or 7 actually). 


Douglas - 

Some additional information that I've confirmed: 

- MusicSequenceFileLoad() is simply returning a -1 (not crashing). 
- I was able to test myself on an iPad Mini 4th Gen and iPhone 6+ and was not able to reproduce the issue on these devices. 
- I asked a friend to try on his iPad Pro (Cellular) and he was _not_ able to reproduce it. 
- Seems that this is only happening on my iPad Pro (Wifi) model - but I haven't been able to find anyone else with an iPad Pro Wifi to confirm it happens on other devices as well. 
- I tried making the object that calls these MIDI functions static just to rule out the possibility of memory issues and the problem was still able to be recreated. 

I opened Radar #28425770 and have attached a sample project which is actually my actual app with pretty much everything except this issue cut out of it. This includes all MIDI files as well. This issue happens regardless of which MIDI file is used. 

Thanks for your support Douglas!

Best,

Derek


On Sat, Sep 17, 2016 at 4:00 AM, <email@hidden> wrote:
Send Coreaudio-api mailing list submissions to
        email@hidden

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.apple.com/mailman/listinfo/coreaudio-api
or, via email, send a message with subject or body 'help' to
        coreaudio-api-request@lists.apple.com

You can reach the person managing the list at
        coreaudio-api-owner@lists.apple.com

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Coreaudio-api digest..."


Today's Topics:

   1. Re: MusicSequenceFileLoad Crash on iOS10
      (AudioToolbox/MusicPlayer) (Sven Thoennissen)
   2. Re: MusicSequenceFileLoad Crash on iOS10
      (AudioToolbox/MusicPlayer) (Douglas Scott)
   3. Re: MusicSequenceFileLoad Crash on iOS10
      (AudioToolbox/MusicPlayer) (Douglas Scott)
   4. Re: How to correctly allocating CFStrings in an
      AudioFileRegionList? (Charles Constant)


----------------------------------------------------------------------

Message: 1
Date: Thu, 15 Sep 2016 23:49:06 +0200
From: Sven Thoennissen <email@hidden>
To: email@hidden
Subject: Re: MusicSequenceFileLoad Crash on iOS10
        (AudioToolbox/MusicPlayer)
Message-ID: <email@hidden">F838C1CD-B74A-42EF-A2AC-email@hidden>
Content-Type: text/plain; charset=us-ascii

Hi Douglas, Derek,

I have filed bug report #28327056 that describes the issue, with a small sample project including a MIDI file attached.

I have noticed that result code -1 happens 1-2 out of 10 times when calling MusicSequenceFileLoad() in the background dispatch queue.
On the main queue the function always returns 0.

Btw if you add a breakpoint "All Exceptions" Xcode will break there.

For me it happens even with iOS 9 (where it did work for Derek though).

Sven

>
> Can you zip up the MIDI file and attach it to a reply here?
>
> In addition, if you would please file a radar (and attach the MIDI file there as well) and include the ID of that radar in your reply here, it would really help move this issue along.
>
> Thanks!!
>
> -DS
>
>> On Sep 11, 2016, at 7:25 AM, down to this <email@hidden> wrote:
>>
>> I've encountered a crash when invoking the AudioToolbox / MusicPlayer API method "MusicSequenceFileLoad()" to load the contents of a MIDI file (from the given URL) into a music sequence on an iOS10 device and would greatly appreciate some assistance from the community.
>>
>> Observations I've been able to make thus far:
>>
>> * The first time the VC is displayed which uses this MIDI file all processing runs without any issues. It's only the second time that the VC is loaded where the app crashes. (Which makes me believe that this may be related to memory management.) The issue can be recreated consistently.
>>
>> * This code has been working without issue in production on iOS7, 8, and 9 for 2+ years and also runs without issue on the iOS 10 Simulator but crashes silently on a iOS 10 device (iPad Pro). Device is running iOS 10.0.1.
>>
>> * No crash report is created on the device when this issue is encountered. No exception information or call stack is available when debugging within Xcode.
>>
>> * Checking the OSStatus result code from calling this function simply returns a value of -1 and does not indicate the reason for the failure.
>>
>> * Profiling for memory management issues (allocations, leaks, zombies), has not shown any information related to the crash.
>>
>> * Turning on the Zombie Objects option did not reveal any Zombie Objects.
>>
>> * Analyzing the application did not reveal any areas where memory was not being released.




------------------------------

Message: 2
Date: Thu, 15 Sep 2016 15:37:23 -0700
From: Douglas Scott <email@hidden>
To: Sven Thoennissen <email@hidden>
Cc: email@hidden
Subject: Re: MusicSequenceFileLoad Crash on iOS10
        (AudioToolbox/MusicPlayer)
Message-ID: <email@hidden">B59C2EBC-7C3B-44DE-B309-email@hidden>
Content-Type: text/plain; charset=utf-8

Looks like some kind of sandbox issue with the OS X operating system (which is running the Simulator).  The issue is not actually in the iOS code.  On my workstation running the Simulator, the access function is returning -50 (access denied) for your MIDI file URL — but only for the *first* time it tries to access it.  All subsequent attempts succeed for me.

The -50 error status is getting lost so you only see -1 — this is a separate issue that should be fixed in a subsequent OS release.

-DS

> On Sep 15, 2016, at 2:49 PM, Sven Thoennissen <email@hidden> wrote:
>
> Hi Douglas, Derek,
>
> I have filed bug report #28327056 that describes the issue, with a small sample project including a MIDI file attached.
>
> I have noticed that result code -1 happens 1-2 out of 10 times when calling MusicSequenceFileLoad() in the background dispatch queue.
> On the main queue the function always returns 0.
>
> Btw if you add a breakpoint "All Exceptions" Xcode will break there.
>
> For me it happens even with iOS 9 (where it did work for Derek though).
>
> Sven
>
>>
>> Can you zip up the MIDI file and attach it to a reply here?
>>
>> In addition, if you would please file a radar (and attach the MIDI file there as well) and include the ID of that radar in your reply here, it would really help move this issue along.
>>
>> Thanks!!
>>
>> -DS
>>
>>> On Sep 11, 2016, at 7:25 AM, down to this <email@hidden> wrote:
>>>
>>> I've encountered a crash when invoking the AudioToolbox / MusicPlayer API method "MusicSequenceFileLoad()" to load the contents of a MIDI file (from the given URL) into a music sequence on an iOS10 device and would greatly appreciate some assistance from the community.
>>>
>>> Observations I've been able to make thus far:
>>>
>>> * The first time the VC is displayed which uses this MIDI file all processing runs without any issues. It's only the second time that the VC is loaded where the app crashes. (Which makes me believe that this may be related to memory management.) The issue can be recreated consistently.
>>>
>>> * This code has been working without issue in production on iOS7, 8, and 9 for 2+ years and also runs without issue on the iOS 10 Simulator but crashes silently on a iOS 10 device (iPad Pro). Device is running iOS 10.0.1.
>>>
>>> * No crash report is created on the device when this issue is encountered. No exception information or call stack is available when debugging within Xcode.
>>>
>>> * Checking the OSStatus result code from calling this function simply returns a value of -1 and does not indicate the reason for the failure.
>>>
>>> * Profiling for memory management issues (allocations, leaks, zombies), has not shown any information related to the crash.
>>>
>>> * Turning on the Zombie Objects option did not reveal any Zombie Objects.
>>>
>>> * Analyzing the application did not reveal any areas where memory was not being released.
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden




------------------------------

Message: 3
Date: Thu, 15 Sep 2016 16:00:05 -0700
From: Douglas Scott <email@hidden>
To: Sven Thoennissen <email@hidden>
Cc: email@hidden
Subject: Re: MusicSequenceFileLoad Crash on iOS10
        (AudioToolbox/MusicPlayer)
Message-ID: <email@hidden">FF8FE82E-82C4-401E-B423-email@hidden>
Content-Type: text/plain; charset=utf-8

Sorry, that’s -54, not -50.

-DS

> On Sep 15, 2016, at 3:37 PM, Douglas Scott <email@hidden> wrote:
>
> Looks like some kind of sandbox issue with the OS X operating system (which is running the Simulator).  The issue is not actually in the iOS code.  On my workstation running the Simulator, the access function is returning -50 (access denied) for your MIDI file URL — but only for the *first* time it tries to access it.  All subsequent attempts succeed for me.
>
> The -50 error status is getting lost so you only see -1 — this is a separate issue that should be fixed in a subsequent OS release.
>
> -DS
>
>> On Sep 15, 2016, at 2:49 PM, Sven Thoennissen <email@hidden> wrote:
>>
>> Hi Douglas, Derek,
>>
>> I have filed bug report #28327056 that describes the issue, with a small sample project including a MIDI file attached.
>>
>> I have noticed that result code -1 happens 1-2 out of 10 times when calling MusicSequenceFileLoad() in the background dispatch queue.
>> On the main queue the function always returns 0.
>>
>> Btw if you add a breakpoint "All Exceptions" Xcode will break there.
>>
>> For me it happens even with iOS 9 (where it did work for Derek though).
>>
>> Sven
>>
>>>
>>> Can you zip up the MIDI file and attach it to a reply here?
>>>
>>> In addition, if you would please file a radar (and attach the MIDI file there as well) and include the ID of that radar in your reply here, it would really help move this issue along.
>>>
>>> Thanks!!
>>>
>>> -DS
>>>
>>>> On Sep 11, 2016, at 7:25 AM, down to this <email@hidden> wrote:
>>>>
>>>> I've encountered a crash when invoking the AudioToolbox / MusicPlayer API method "MusicSequenceFileLoad()" to load the contents of a MIDI file (from the given URL) into a music sequence on an iOS10 device and would greatly appreciate some assistance from the community.
>>>>
>>>> Observations I've been able to make thus far:
>>>>
>>>> * The first time the VC is displayed which uses this MIDI file all processing runs without any issues. It's only the second time that the VC is loaded where the app crashes. (Which makes me believe that this may be related to memory management.) The issue can be recreated consistently.
>>>>
>>>> * This code has been working without issue in production on iOS7, 8, and 9 for 2+ years and also runs without issue on the iOS 10 Simulator but crashes silently on a iOS 10 device (iPad Pro). Device is running iOS 10.0.1.
>>>>
>>>> * No crash report is created on the device when this issue is encountered. No exception information or call stack is available when debugging within Xcode.
>>>>
>>>> * Checking the OSStatus result code from calling this function simply returns a value of -1 and does not indicate the reason for the failure.
>>>>
>>>> * Profiling for memory management issues (allocations, leaks, zombies), has not shown any information related to the crash.
>>>>
>>>> * Turning on the Zombie Objects option did not reveal any Zombie Objects.
>>>>
>>>> * Analyzing the application did not reveal any areas where memory was not being released.
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Coreaudio-api mailing list      (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Coreaudio-api mailing list      (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden




------------------------------

Message: 4
Date: Fri, 16 Sep 2016 01:17:59 -0700
From: Charles Constant <email@hidden>
To: CoreAudio API <email@hidden>
Subject: Re: How to correctly allocating CFStrings in an
        AudioFileRegionList?
Message-ID:
        <CAB5C60uUyUQ6npXKUVUty1=V+TGWHdkmGq5pohu=Gvy8egfRFw@mail.gmail.com>
Content-Type: text/plain; charset="utf-8"

Judging by the lack of mentions anywhere on the internet, I don't think
many people use AudioFileRegionLists. I have found one mention from 3 years
ago, where the developer had similar results reading, as to what I am
seeing with writing - in so far as only the first marker of the first
region is reliably accessible.

https://devforums.apple.com/message/759692#759692

So I'm leaning toward a new theory, that it's not my CSStrings, but that
this feature is broken. Can anyone confirm this?

Thanks

Charles

PS: I also see a layer down, this might be possible using a CAFRegionChunk.
Anyone had any luck with this?



On Wed, Sep 14, 2016 at 8:53 PM, Charles Constant <email@hidden>
wrote:

>
> I'm having a rather bad time getting *AudioFileSetProperty* to write an
> *AudioFileRegionList* to a CAF file. I suspect the problem is the way
> that I'm allocating *CFString*s.
>
> Is this an appropriate way to allocate *CFStrings* when setting a
> marker.mName or region.mName?
>
>     rgn->mName = CFStringCreateWithFormat( kCFAllocatorDefault, NULL,
> CFSTR("Region-%d"), r );
>
>
>
> My problem is that if I try to create a List that contains more than one
> Region, as soon as I call *AudioFileSetProperty*, I get "EXC_BAD_ACCESS."
> This happens unless I use a very small quantity of regions and markers. The
> debugger shows the exact place where AudioFileSetProperty falls over as
> either "CFStringGetLength" or "CAFRegion_NtoB(CAFRegion*)".
>
>
>
> If I create only a single Region, and then use afinfo to view my file, I
> get this type of thing:
>
> MacBook-Pro:~ username$ afinfo /Users/username/UnitTest_CAF_ANSI_C.caf
>
> File:           /Users/username/UnitTest_CAF_ANSI_C.caf
>
> File type ID:   caff
>
> Num Tracks:     1
>
> ----
>
> Data format:     1 ch,  44100 Hz, 'lpcm' (0x0000000E) 16-bit big-endian
> signed integer
>
>                 no channel layout.
>
> estimated duration: 5.001315 sec
>
> audio bytes: 441116
>
> audio packets: 220558
>
> bit rate: 705600 bits per second
>
> packet size upper bound: 2
>
> maximum packet size: 2
>
> audio data file offset: 4096
>
> optimized
>
> audio 220558 valid frames + 0 priming + 0 remainder = 220558
>
> source bit depth: I16
>
> 1 regions; SMPTE time type 0 (none)
>
>   region 1, "Region-0", flags 00000000
>
> marker 990, "Marker-990": frame       100   SMPTE time 0:00:00:00/0 type
> 1935828327 ('sbeg') channel 0
>
> marker 991, "<unnnamed>": frame       200   SMPTE time 0:00:00:00/0 type
> 1936027236 ('send') channel 0
>
> marker 992, "<unnnamed>": frame       300   SMPTE time 0:00:00:00/0 type
> 1935828327 ('sbeg') channel 0
>
>
> The names should be "Marker-990" "Marker-991" "Marker-992" and so on.
>
>
> Anyone have any ideas? I'm stumped, and after three days working on this,
> I can't find much outside information.
>
> Thanks,
>
> Charles
>
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.apple.com/mailman/private/coreaudio-api/attachments/20160916/432af98a/attachment.html>

------------------------------

_______________________________________________
Coreaudio-api mailing list
email@hidden
https://lists.apple.com/mailman/listinfo/coreaudio-api

End of Coreaudio-api Digest, Vol 13, Issue 125
**********************************************

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: Need help resolving auval failure : ERROR: -4 IN CALL MusicDeviceSendMIDI
  • Next by Date: Re: Need help resolving auval failure : ERROR: -4 IN CALL MusicDeviceSendMIDI
  • Previous by thread: Re: MusicSequenceFileLoad Crash on iOS10 (AudioToolbox/MusicPlayer)
  • Next by thread: Re: Coreaudio-api Digest, Vol 13, Issue 121
  • Index(es):
    • Date
    • Thread