Dive into the technical aspects of audio on your device, including codecs, format support, and customization options.

Audio Documentation

Posts under Audio subtopic

Post

Replies

Boosts

Views

Activity

Focus Hunting when using 60fps for video camera
When setting the AVCaptureDeviceFormat to 1080p@60fps for the back video camera there is an issue with the camera constantly re-focusing even though the subject area barely changes. Anyone have any workarounds for this issue?This is repeatable by modifying the following Apple sample code to use 1080p@60fps:AVCamManual: Extending AVCam to Use Manual Capture API: https://developer.apple.com/library/archive/samplecode/AVCamManual/Introduction/Intro.html#//apple_ref/doc/uid/TP40014578Add the following method to AVCamManualCameraViewController.m:// test -- manually select a device format -(void)selectDesiredFormat:(AVCaptureDevice *)device { NSArray *theFormats = [device formats]; for ( AVCaptureDeviceFormat *format in theFormats ) { CMFormatDescriptionRef formatRef = format.formatDescription; CMVideoDimensions dimensions = CMVideoFormatDescriptionGetDimensions(formatRef); if (dimensions.height == 1080) { NSLog(@"got dimensions=1080"); for ( AVFrameRateRange *range in format.videoSupportedFrameRateRanges ) { if ( range.maxFrameRate >= 60 ) { NSLog(@"found frame rate >=60"); if ( YES == [device lockForConfiguration:NULL] ) { device.activeFormat = format; NSLog(@"format: %@",format); device.activeVideoMinFrameDuration = range.minFrameDuration; device.activeVideoMaxFrameDuration = range.minFrameDuration; [device unlockForConfiguration]; return; } } } } } }And then call this method from:- (IBAction)changeCaptureMode:(UISegmentedControl *)captureModeControl { ... else if ( captureModeControl.selectedSegmentIndex == AVCamManualCaptureModeMovie ) { ... // Insert call here [self selectDesiredFormat:self.videoDevice]; dispatch_async( dispatch_get_main_queue(), ^{ self.recordButton.enabled = YES; } ); }This should allow you to change the format to run 1080p@60fps.Now do the following steps:1) Build and run the updated project in Xcode (latest version, although this problem has been around for over a year)2) Change the camera mode to "Movie" by tapping the segment control in upper right3) Move the camera around slightly (becomes even more of an issue when closer to objects but happens when far away as well)4) From the debugger console notice all the "context == AdjustingFocusContext" printouts even though the camera is barely moving. (called by observing on "videoDevice.focusMode". May need to add this as I don't remember if this debug code was already in there)You can also observe this by viewing the preview and seeing the focus constantly adjusting even though the subject area barely changes... I call this problem "focus hunting" as the camera just can't seem to settle in on a focus.If you need a comparison to how it should work, comment out the added line: [self selectDesiredFormat:self.videoDevice], which will default the video camera to 1080p@30fps, and go through the steps above again. No focus hunting. Smooth focus even when you do change the subject area.In addition, if you use the builtin camera app and change the format to 1080p@60fps, this issue does not exist.I submitted a bug report (FB7390937) but have yet to get any response. I don't necessarily need it fixed but would like to know if anyone has any workarounds for this issue. I can't be the only one to run across this right??
4
1
2k
Nov ’22
AVCaptureMultiCamSession and RAW?
Hi,asking since I couldn't find any definitive information on this. When using AVCaptureMultiCamSession, is it possible to use RAW capture?My photo output's availableRawPhotoFileTypes is always empty, even if I've only got a single camera wired up. Am I doing something wrong or is this an undocumented limitation?
2
1
758
Aug ’21
Microphone permission change restarts running App
Could not find enough documentation on below behavior, appreciate if someone could direct to the documentation of below behavior:Running App would terminate/restart when permission is altered in settings.Scenario:If App, using microphone is running and say is in screen#3 and microphone permission is granted.Now if user revokes the microphone permission by invoking Settings->Privacy->Microphone->App -> off and opens already running App, it starts from screen #1 instead of #3.What is the best way to prevent this behavior as microphone permission is not mandatory but convenient option for application and could wait for next time launch to apply permission change. Thinking to store state before going to background and reapply when relaunched. But is there a possibility to not to reset the app when permission changes at first place automatically, like Bluetooth on/off
1
0
1.3k
Dec ’21
why AVPlayer sends range
Hi,I am writing my own HTTP web service server that supports iOS devices to view video files. On iOS I am using `AVPlayer` and on the server side it is simply `.mp4` files. But it seems like AVPlayer buffers for a long time (10+ seconds) before starting playing a video.After a bit debugging, it seems that AVPlayer send weird range values in its HTTP request for the video, for example:1st request headers send range 0-1: (this is OK)X-Playback-Session-Id: B1F3B5AE-B49A-40B1-8F2E-A501E1BC24AF Range: bytes=0-1 Accept: */* User-Agent: AppleCoreMedia/1.0.0.17A860 (iPhone; U; CPU OS 13_1_2 like Mac OS X; en_us) Accept-Language: en-us Accept-Encoding: identity Connection: keep-alive2nd request headers send range 0-37724087, which is full length of the video.This is weird, why doesn't AVPlayer take advantage of range header and ask for only a small range?X-Playback-Session-Id: B1F3B5AE-B49A-40B1-8F2E-A501E1BC24AF Range: bytes=0-37724087 Accept: */* User-Agent: AppleCoreMedia/1.0.0.17A860 (iPhone; U; CPU OS 13_1_2 like Mac OS X; en_us) Accept-Language: en-us Accept-Encoding: identity Connection: keep-alive3rd request headers send range of 37683200-37724087, which is the last chunk of the video.Again very weird, why does AVPlayer ask for the range that was already covered by the previous request?X-Playback-Session-Id: B1F3B5AE-B49A-40B1-8F2E-A501E1BC24AF Range: bytes=37683200-37724087 Accept: */* User-Agent: AppleCoreMedia/1.0.0.17A860 (iPhone; U; CPU OS 13_1_2 like Mac OS X; en_us) Accept-Language: en-us Accept-Encoding: identity Connection: keep-aliveAny ideas? Any comments or pointers are appreciated.
3
3
3.5k
Oct ’22
Black frames when rendering in the background
In the latest versions of iOS (at least since 13.1.3), background video rendering has been broken for our app. Sometimes the video is rendered with black frames, other times it crashes.It seems to be related to the following error we’re now seeing in the console:Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (IOAF code 6) GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=7 "Insufficient PermiOur current working theory is that some underlying framework has changed to use Metal under the hood, which does not have permission to run in the background (because it uses the GPU).Any ideas what we can do as a workaround, and in general what causes this issue?
1
0
1.1k
Jan ’23
Saving non-parameter based presets in AUv3 extensions
Hello!I'm trying to allow hosts to save presets for my AUv3 extension. Currently I save presets as files within the extension itself, but I'd like to support state saving within hosts. My problem is that I can't really reduce my preset format down to parameters in the parameter tree. Can anyone point me in the right direction? I'm happy to clarify anything further.
2
1
2.9k
Aug ’22
Volume of AVSpeechUtterance is too low when ducking other audio
I have a navigation app that uses iOS's text to speech engine (AVSpeechSynthesizer / AVSPEECHUTTERANCE) for the turn by turn voice instructions. I have noticed during testing and now am getting a lot of user feedback that the voice volume is too low if they are playing music. I duck other audio already but still the voice volume is too low. This is especially a problem when playing over Bluetooth it seems. I'm already setting the volume of the utterance to 1.0 and have tried default ausiosession category and the new voiceprompt category. Neither works. I did some further research and found that other apps using the text to speech engine have the same problem EXCEPT Apple's own Maps app. Maps has a setting in Settings > Maps > Driving & Navigation to make the voice louder. I'm guessing Apple Maps is using some kind of private api??? This seems like an IOS bug to me and/or Apple has yet to publicize some method or variable to further boost volume. Documentation on the new voiceprompt audiosession category is still very limited at the moment 😞 Anyone seeing similar behaviour and/or know of a way or workaround to boost the volume?
1
0
1.5k
Oct ’21
CoreMIDI The simplest MIDI output function
I am trying to implement what should be the simplest MIDI function of all for an iOS app but getting my head around the CoreMIDI framework is painful and I'm a bit of a newbie coder...I just want to send a MIDI note or simple sequence of notes out of my iPhone via a MIDI Interface (iRig2) to my old synthesizer.so for now a simple function that will run when I press a button and send the MIDI packet to a MIDI port of my choosing with the basic Note On Note Off.This is part of a more complex app I'm developing and now I'm at the MIDI implementation part I've hit a wall. Not much out there in tutorial form to explain MIDI in Swift. And most dont seem interested in sending MIDI data out to external hardwareHelp much appreciated!
1
0
1.1k
Apr ’22
MPMediaItem and AVPlayerItem playback sequence in background
I'm having an issue with playing sequences of different kinds of items in a background.In an app I'm working on we've introduced playlists which contain both content provided by the app and Apple Music content.For that use AVPlayer and MPMusicPlayerController respectively. We observe one player or the other (depending what content is now playing) and if the other kind of content comes next, we release the old player (if we can - MPMusicPlayerController is a singleton, so best we can do is stop it) and load item to another player.The problem starts when the app leaves foreground. Once MPMusicPlayerController takes over it doesn't want to give up control, so if any AVPlayer content comes after MPMusicPlayerController content, the music stops.One workaround that I've tried is playing with `.mixWithOthers` options when I set the category on AVAudioSession, however this creates new category of problems - I'm loosing lockscreen controls, therefore I'm also loosing airplay. One dirty trick that I've tried was setting `.mixWithOthers` 3 seconds before MPMediaItem ends, and then disabling it back once AVPlayer starts. Beside the fact that there're probably many different things that can go wrong here, MPMediaPlayerController still doesn't want to give me back the control over lockscreen controls.Is there any way this could ever work on iOS 13?
4
0
1.8k
May ’23
VTCompressionSessionEncodeFrame performance decrease
Our team use videotool box to do hardware-accelerated decoding and encoding. From iphone 6 to 7 plus, the performance of encoding increases, and it takes less time to transcode a video. However, the time spent on VTCompressionSessionEncodeFrame increases drastically on iphone 8 and newer models. For example, it takes about 650 us to encode a 720p frame on iphone 8 but 4100 us on iphone xs max. The other problem is, when i compare our app to a simple video recording app (both encode in 1080p), the time we spent on VTCompressionSessionEncodeFrame is almost 8 times as the recoding app. Is this normal?
2
0
1.1k
Oct ’21
Video preloading in AV Video Players
I am currently working on an app wich will preload 3 AVplayers wich are in an array. With preloading I mean, that the first 30 seconds of the video should get loaded before the video gets displayed on the screen. I decided to do the preloading by iterating through the array, playing all players until they are at 30 seconds. As the players are in an array, there is still a pointer wich references to the memory location on wich the video buffer and the already played video is saved. Is it true, that with that solution, the first 30 seconds won't be loaded when I start the players again at 0 seconds, because I already loaded the first 30 seconds.
2
0
2.1k
Apr ’23
CA::Render::Encoder::grow - iOS 13 - some app crashes reported in Organizer
We have an iOS app in the App Store. Recently, we see in Organizer / Crashes for that app a new type of crash that seems bound to iOS 13 devices (21 devices affected in the last few weeks, all with iOS 13.1, .2, or .3). Xcode reports that the crashes occurred in QuartzCore, on CA::Render::Encoder::grow(unsigned long).Any idea what can it be and how it could be fixed? It doesn't look related to our code. Can it be a recent Apple bug? (We didn't have these crash reports before iOS 13.) Thank you in advance.Here is an extract from the crash log:OS Version: iPhone OS 13.3 (17C54) Release Type: User Baseband Version: n/a Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 libsystem_kernel.dylib 0x0000000191d27ec4 __pthread_kill + 8 1 libsystem_pthread.dylib 0x0000000191c431d8 pthread_kill$VARIANT$mp + 136 (pthread.c:1458) 2 libsystem_c.dylib 0x0000000191b97844 abort + 100 (abort.c:110) 3 QuartzCore 0x00000001989af340 CA::Render::Encoder::grow(unsigned long) + 304 (render-coding.cpp:562) 4 QuartzCore 0x00000001989afa80 CA::Render::Encoder::encode_data_async(void const*, unsigned long, void (*)(void const*, void*), ... + 172 (render-coding.h:272) 5 QuartzCore 0x000000019886c358 CA::Render::Image::encode(CA::Render::Encoder*) const + 748 (render-image.cpp:401) 6 QuartzCore 0x000000019888510c CA::Render::Layer::encode(CA::Render::Encoder*) const + 112 (render-coding.h:388) 7 QuartzCore 0x00000001989b3c2c CA::Render::encode_set_object(CA::Render::Encoder*, unsigned long, unsigned int, CA::Render::Obje... + 192 (render-coding.cpp:2151) 8 QuartzCore 0x00000001988f78a4 invocation function for block in CA::Context::commit_transaction(CA::Transaction*, double) + 1568 (CAContextInternal.mm:1632) 9 QuartzCore 0x00000001989add88 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 364 (CALayer.mm:2647) 10 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 11 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 12 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 13 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 14 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 15 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 16 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 17 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 18 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 19 QuartzCore 0x00000001988f6924 CA::Context::commit_transaction(CA::Transaction*, double) + 2872 (CAContextInternal.mm:2288) 20 QuartzCore 0x000000019891fc08 CA::Transaction::commit() + 676 (CATransactionInternal.mm:438) 21 UIKitCore 0x0000000195769698 -[_UIContextBinder updateBindableOrderWithTest:force:] + 704 (_UIContextBinder.m:280) 22 UIKitCore 0x0000000195769214 -[_UIContextBinder createContextsWithTest:creationAction:] + 100 (_UIContextBinder.m:233) 23 UIKitCore 0x00000001961d2510 -[UIWindowScene _prepareForResume] + 84 (UIWindowScene.m:712) 24 UIKitCore 0x00000001955e364c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 860 (UIScene.m:1055) 25 UIKitCore 0x00000001955e45b8 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 220 (UIScene.m:1315) 26 UIKitCore 0x0000000195b57248 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 464 (UIApplicationSceneClientAgent.m:80) 27 FrontBoardServices 0x0000000197051248 -[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:] + 544 (FBSSceneImpl.m:551) 28 FrontBoardServices 0x0000000197075d28 __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_bloc... + 120 (FBSWorkspaceScenesClient.m:356) 29 FrontBoardServices 0x000000019705af04 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232 (FBSWorkspace.m:357) 30 FrontBoardServices 0x0000000197075c5c __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_bloc... + 184 (FBSWorkspaceScenesClient.m:355) 31 libdispatch.dylib 0x0000000191bfd184 _dispatch_client_callout + 16 (object.m:495) 32 libdispatch.dylib 0x0000000191ba5fd8 _dispatch_block_invoke_direct$VARIANT$mp + 224 (queue.c:466) 33 FrontBoardServices 0x000000019709a418 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40 (FBSSerialQueue.m:173) 34 FrontBoardServices 0x000000019709a0e4 -[FBSSerialQueue _queue_performNextIfPossible] + 404 (FBSSerialQueue.m:216) 35 FrontBoardServices 0x000000019709a60c -[FBSSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:247) 36 CoreFoundation 0x0000000191eaea00 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1922) 37 CoreFoundation 0x0000000191eae958 __CFRunLoopDoSource0 + 80 (CFRunLoop.c:1956) 38 CoreFoundation 0x0000000191eae0f0 __CFRunLoopDoSources0 + 180 (CFRunLoop.c:1992) 39 CoreFoundation 0x0000000191ea923c __CFRunLoopRun + 1080 (CFRunLoop.c:2882) 40 CoreFoundation 0x0000000191ea8adc CFRunLoopRunSpecific + 464 (CFRunLoop.c:3192) 41 GraphicsServices 0x000000019be2e328 GSEventRunModal + 104 (GSEvent.c:2246) 42 UIKitCore 0x0000000195fa3ae0 UIApplicationMain + 1936 (UIApplication.m:4773) 43 <Our app name> 0x0000000100d9d32c main + 88 (main.m:14) 44 libdyld.dylib 0x0000000191d32360 start + 4
4
1
3.2k
Sep ’23
Fairplay Offline playback error
I am using EZDRM provider for DRM protection and using Fairplay on Ipad application, the online video streaming works perfectly , we have also added offline support through the backend and i am downloading the video and the offline key and storing it on the device.If I download one video and switch the device to airplane mode, then the video plays properly in offline case but if I again download a new video then the newly downloaded video plays properly in offline case but the one that was downloaded before stops working, the avplayeritem responds with errror -Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-42803), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x2832ea2b0 {Error Domain=NSOSStatusErrorDomain Code=-42803 "(null)"}} .Basically only the last downloaded video plays in offline mode and all the other downloaded videos fail with the above error, any idea how to fix this issue ?I have also extracted the container and checked there are different key files downloaded for different videos and the proper key is accessed while playing the video, it is not over riding the previously downloaded key.What does the error code: 42803 indicate there is no documentation mentioning the significance of this error code. ?
9
0
4.3k
Feb ’22
AVAudioEngineImpl::IOUnitConfigurationChanged() Crash
I use AudioEngine. In crash reports I see some random EXC_BREAKPOINT crashes with this stacktrace Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x00000001896df0e4 Termination Signal: Trace/BPT trap: 5 Termination Reason: Namespace SIGNAL, Code 0x5 Terminating Process: exc handler [12467] Triggered by Thread: 15 Thread 15 Crashed: 0 libdispatch.dylib 0x00000001896df0e4 __DISPATCH_WAIT_FOR_QUEUE__ + 448 (queue.c:1619) 1 libdispatch.dylib 0x00000001896dec74 _dispatch_sync_f_slow + 140 (queue.c:1732) 2 libdispatch.dylib 0x00000001896dec74 _dispatch_sync_f_slow + 140 (queue.c:1732) 3 AVFAudio 0x00000001965b11a8 -[AVAudioEngine dealloc] + 308 (AVAudioEngine.mm:406) 4 Foundation 0x0000000189ce52ac -[NSConcreteNotification dealloc] + 68 (NSNotification.m:206) 5 AVFAudio 0x00000001965b7158 invocation function for block in AVAudioEngineImpl::IOUnitConfigurationChanged() + 292 (AVAudioEngine.mm:1215) 6 libdispatch.dylib 0x00000001896de998 _dispatch_block_async_invoke2 + 104 (queue.c:525) 7 libdispatch.dylib 0x00000001896fb184 _dispatch_client_callout + 16 (object.m:495) 8 libdispatch.dylib 0x00000001896d4e8c _dispatch_continuation_pop$VARIANT$armv81 + 404 (inline_internal.h:2484) 9 libdispatch.dylib 0x00000001896e502c _dispatch_source_invoke$VARIANT$armv81 + 1232 (source.c:568) 10 libdispatch.dylib 0x00000001896d85e0 _dispatch_lane_serial_drain$VARIANT$armv81 + 260 (inline_internal.h:2525) 11 libdispatch.dylib 0x00000001896d9128 _dispatch_lane_invoke$VARIANT$armv81 + 400 (queue.c:3863) 12 libdispatch.dylib 0x00000001896e243c _dispatch_workloop_worker_thread + 576 (queue.c:6445) 13 libsystem_pthread.dylib 0x000000018974ab88 _pthread_wqthread + 276 (pthread.c:2351) 14 libsystem_pthread.dylib 0x000000018974d760 start_wqthread + 8 I can't reproduce this crash and stacktrace doesn't point to my code. Does anyone know what is cause of this crash, how this can be fixed and if it's even possible to fix? Thanks
1
0
926
Sep ’21
AVAudioPlayerNode crash (no IO cycle)
We're getting the following crash when playing audio through AVAudioPlayerNode (via AudioKit AKPlayer):Fatal Exception: com.apple.coreaudio.avfaudio player did not see an IO cycle. Fatal Exception: com.apple.coreaudio.avfaudio 0 CoreFoundation 0x1a585c98c __exceptionPreprocess 1 libobjc.A.dylib 0x1a55850a4 objc_exception_throw 2 CoreFoundation 0x1a575ed1c +[_CFXNotificationTokenRegistration keyCallbacks] 3 AVFAudio 0x1b21d1e24 AVAE_RaiseException(NSString*, ...) 4 AVFAudio 0x1b227356c AVAudioPlayerNodeImpl::StartImpl(AVAudioTime*) 5 AVFAudio 0x1b2270910 -[AVAudioPlayerNode play] 6 OurApp 0x1049920f0 AKPlayer.play(from:to:at:hostTime:) 7 OurApp 0x1049af9fc AKPlayer.play(from:to:when:hostTime:) 8 OurApp 0x1049af840 AKPlayer.play(when:hostTime:)We're getting these crash logs through Crashlytics.We play with a 0.2s delay.I haven't been able to reliably reproduce the crash, nor find any documentation about what the error message means. We've seen another crash in the same area if the audio engine is not running, but according to our logs, the audio engine is running when this particular crash accurs.The code is not doing anything fancy, just downloading and playing a small (<1 minute) mp3 audio file. The only complicating factor is that the audio session is also configured for recording (that's the next step after picking and previewing the audio file).Any suggestions are welcome.
8
0
7.3k
Aug ’22
Qt application is not requesting microphone access
HiI have a Qt application written in C++ with Qt 5.14.1 on macOS Catalina. When I start the application from Qt Creator the application requests microphone access when recording is started. However, the installed application does not request. I have tried to reset permissions with'tcutil reset Microphone'but still I get the same behavior. The application bundle is signed with codesigncodesign --deep --strict --timestamp --force --verify --verbose \ --entitlements ./Entitlements.plist \ --sign "Developer ID Application: Emoshape Inc." \ --options runtime ./build/$APP_NAME.appand the Entitlements.plist is<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.device.camera</key><true/><key>com.apple.security.device.microphone</key><true/><key>com.apple.security.device.usb</key><true/></dict></plist>Also, Info.plist file has the following two entries<key>NSCameraUsageDescription</key><string>The application wants to access the camera.</string><key>NSMicrophoneUsageDescription</key><string>The application wants to access the microphone.</string>Can you tell me what I am missing ?thanksBogdan
8
0
3.6k
Apr ’22
AVAsset and HLS Streaming
I try to play a m3u8 file and a mp3 file simultaneously. but it is not working. NSURL *audioURL = [NSURL URLWithString:@"https://XXX.mp3"]; AVAsset *audioAsset = [AVAsset assetWithURL:audioURL]; NSURL *videoURL = [NSURL URLWithString:@"https://XXX.m3u8"]; AVAsset *videoAsset = [AVAsset assetWithURL:videoURL]; NSError *error; AVMutableComposition* mixAsset = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack* audioTrack = [mixAsset addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; [audioTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, audioAsset.duration) ofTrack:[[audioAsset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0] atTime:kCMTimeZero error: &error]; AVMutableCompositionTrack* videoTrack = [mixAsset addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; [videoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:[[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:kCMTimeZero error: &error]; AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:mixAsset]; movie = [AVPlayer playerWithPlayerItem:playerItem];i get the following error:*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty arrayanother mp4 video file is working but not with m3u8 file (hls streaming). How is the right way to work with such files in a AVMutableCompositionTrack?
1
0
1.8k
Aug ’21
Writing to disk from CoreAudio HAL Plugin
I'm writing an audio HAL plugin to send the audio over the network to a device. I can get audio and stream it over a socket just fine but wanted to log debug messages to a file rather than syslog. However, when I try to open a file from within the HAL plugin, I get "Operation not permitted".I tried writing to /tmp as well as to the temporary directory returned by NSTemporaryDirectory(). None of these worked. It seems that the HAL plugin is sandboxed without disk access and I don't know how to provide those permissions as the plugin is run under coreaudio process.Anyone have any experience with writing to disk from an Audio HAL Plugin?
3
0
2.4k
Sep ’21
AVPlayerViewController deallocated when entering full screen
On iPadOS 13 the AVPlayerViewController throws the following console message when tapping on the expand button in the AVPlayer control:Warning: <AVPlayerViewController: ...> was deallocated while its contents were being presented full screen. ***The VC is added by addChildViewController to its parent controller and everything else worked fine when it was built with the iOS 9 SDK. But now with the iPadOS SDK 13 it no longer works.As a current workarround I set showsPlaybackControls to NO and implemented the expand and collapse feature manually (which works). But I loose all the other features from the playback controls.Would be great if some can point me in the right solution direction.Many thanks...
1
0
1.5k
May ’22
Focus Hunting when using 60fps for video camera
When setting the AVCaptureDeviceFormat to 1080p@60fps for the back video camera there is an issue with the camera constantly re-focusing even though the subject area barely changes. Anyone have any workarounds for this issue?This is repeatable by modifying the following Apple sample code to use 1080p@60fps:AVCamManual: Extending AVCam to Use Manual Capture API: https://developer.apple.com/library/archive/samplecode/AVCamManual/Introduction/Intro.html#//apple_ref/doc/uid/TP40014578Add the following method to AVCamManualCameraViewController.m:// test -- manually select a device format -(void)selectDesiredFormat:(AVCaptureDevice *)device { NSArray *theFormats = [device formats]; for ( AVCaptureDeviceFormat *format in theFormats ) { CMFormatDescriptionRef formatRef = format.formatDescription; CMVideoDimensions dimensions = CMVideoFormatDescriptionGetDimensions(formatRef); if (dimensions.height == 1080) { NSLog(@"got dimensions=1080"); for ( AVFrameRateRange *range in format.videoSupportedFrameRateRanges ) { if ( range.maxFrameRate >= 60 ) { NSLog(@"found frame rate >=60"); if ( YES == [device lockForConfiguration:NULL] ) { device.activeFormat = format; NSLog(@"format: %@",format); device.activeVideoMinFrameDuration = range.minFrameDuration; device.activeVideoMaxFrameDuration = range.minFrameDuration; [device unlockForConfiguration]; return; } } } } } }And then call this method from:- (IBAction)changeCaptureMode:(UISegmentedControl *)captureModeControl { ... else if ( captureModeControl.selectedSegmentIndex == AVCamManualCaptureModeMovie ) { ... // Insert call here [self selectDesiredFormat:self.videoDevice]; dispatch_async( dispatch_get_main_queue(), ^{ self.recordButton.enabled = YES; } ); }This should allow you to change the format to run 1080p@60fps.Now do the following steps:1) Build and run the updated project in Xcode (latest version, although this problem has been around for over a year)2) Change the camera mode to "Movie" by tapping the segment control in upper right3) Move the camera around slightly (becomes even more of an issue when closer to objects but happens when far away as well)4) From the debugger console notice all the "context == AdjustingFocusContext" printouts even though the camera is barely moving. (called by observing on "videoDevice.focusMode". May need to add this as I don't remember if this debug code was already in there)You can also observe this by viewing the preview and seeing the focus constantly adjusting even though the subject area barely changes... I call this problem "focus hunting" as the camera just can't seem to settle in on a focus.If you need a comparison to how it should work, comment out the added line: [self selectDesiredFormat:self.videoDevice], which will default the video camera to 1080p@30fps, and go through the steps above again. No focus hunting. Smooth focus even when you do change the subject area.In addition, if you use the builtin camera app and change the format to 1080p@60fps, this issue does not exist.I submitted a bug report (FB7390937) but have yet to get any response. I don't necessarily need it fixed but would like to know if anyone has any workarounds for this issue. I can't be the only one to run across this right??
Replies
4
Boosts
1
Views
2k
Activity
Nov ’22
AVCaptureMultiCamSession and RAW?
Hi,asking since I couldn't find any definitive information on this. When using AVCaptureMultiCamSession, is it possible to use RAW capture?My photo output's availableRawPhotoFileTypes is always empty, even if I've only got a single camera wired up. Am I doing something wrong or is this an undocumented limitation?
Replies
2
Boosts
1
Views
758
Activity
Aug ’21
Microphone permission change restarts running App
Could not find enough documentation on below behavior, appreciate if someone could direct to the documentation of below behavior:Running App would terminate/restart when permission is altered in settings.Scenario:If App, using microphone is running and say is in screen#3 and microphone permission is granted.Now if user revokes the microphone permission by invoking Settings->Privacy->Microphone->App -> off and opens already running App, it starts from screen #1 instead of #3.What is the best way to prevent this behavior as microphone permission is not mandatory but convenient option for application and could wait for next time launch to apply permission change. Thinking to store state before going to background and reapply when relaunched. But is there a possibility to not to reset the app when permission changes at first place automatically, like Bluetooth on/off
Replies
1
Boosts
0
Views
1.3k
Activity
Dec ’21
why AVPlayer sends range
Hi,I am writing my own HTTP web service server that supports iOS devices to view video files. On iOS I am using `AVPlayer` and on the server side it is simply `.mp4` files. But it seems like AVPlayer buffers for a long time (10+ seconds) before starting playing a video.After a bit debugging, it seems that AVPlayer send weird range values in its HTTP request for the video, for example:1st request headers send range 0-1: (this is OK)X-Playback-Session-Id: B1F3B5AE-B49A-40B1-8F2E-A501E1BC24AF Range: bytes=0-1 Accept: */* User-Agent: AppleCoreMedia/1.0.0.17A860 (iPhone; U; CPU OS 13_1_2 like Mac OS X; en_us) Accept-Language: en-us Accept-Encoding: identity Connection: keep-alive2nd request headers send range 0-37724087, which is full length of the video.This is weird, why doesn't AVPlayer take advantage of range header and ask for only a small range?X-Playback-Session-Id: B1F3B5AE-B49A-40B1-8F2E-A501E1BC24AF Range: bytes=0-37724087 Accept: */* User-Agent: AppleCoreMedia/1.0.0.17A860 (iPhone; U; CPU OS 13_1_2 like Mac OS X; en_us) Accept-Language: en-us Accept-Encoding: identity Connection: keep-alive3rd request headers send range of 37683200-37724087, which is the last chunk of the video.Again very weird, why does AVPlayer ask for the range that was already covered by the previous request?X-Playback-Session-Id: B1F3B5AE-B49A-40B1-8F2E-A501E1BC24AF Range: bytes=37683200-37724087 Accept: */* User-Agent: AppleCoreMedia/1.0.0.17A860 (iPhone; U; CPU OS 13_1_2 like Mac OS X; en_us) Accept-Language: en-us Accept-Encoding: identity Connection: keep-aliveAny ideas? Any comments or pointers are appreciated.
Replies
3
Boosts
3
Views
3.5k
Activity
Oct ’22
Black frames when rendering in the background
In the latest versions of iOS (at least since 13.1.3), background video rendering has been broken for our app. Sometimes the video is rendered with black frames, other times it crashes.It seems to be related to the following error we’re now seeing in the console:Execution of the command buffer was aborted due to an error during execution. Insufficient Permission (to submit GPU work from background) (IOAF code 6) GLDRendererMetal command buffer completion error: Error Domain=MTLCommandBufferErrorDomain Code=7 "Insufficient PermiOur current working theory is that some underlying framework has changed to use Metal under the hood, which does not have permission to run in the background (because it uses the GPU).Any ideas what we can do as a workaround, and in general what causes this issue?
Replies
1
Boosts
0
Views
1.1k
Activity
Jan ’23
Saving non-parameter based presets in AUv3 extensions
Hello!I'm trying to allow hosts to save presets for my AUv3 extension. Currently I save presets as files within the extension itself, but I'd like to support state saving within hosts. My problem is that I can't really reduce my preset format down to parameters in the parameter tree. Can anyone point me in the right direction? I'm happy to clarify anything further.
Replies
2
Boosts
1
Views
2.9k
Activity
Aug ’22
Volume of AVSpeechUtterance is too low when ducking other audio
I have a navigation app that uses iOS's text to speech engine (AVSpeechSynthesizer / AVSPEECHUTTERANCE) for the turn by turn voice instructions. I have noticed during testing and now am getting a lot of user feedback that the voice volume is too low if they are playing music. I duck other audio already but still the voice volume is too low. This is especially a problem when playing over Bluetooth it seems. I'm already setting the volume of the utterance to 1.0 and have tried default ausiosession category and the new voiceprompt category. Neither works. I did some further research and found that other apps using the text to speech engine have the same problem EXCEPT Apple's own Maps app. Maps has a setting in Settings > Maps > Driving & Navigation to make the voice louder. I'm guessing Apple Maps is using some kind of private api??? This seems like an IOS bug to me and/or Apple has yet to publicize some method or variable to further boost volume. Documentation on the new voiceprompt audiosession category is still very limited at the moment 😞 Anyone seeing similar behaviour and/or know of a way or workaround to boost the volume?
Replies
1
Boosts
0
Views
1.5k
Activity
Oct ’21
CoreMIDI The simplest MIDI output function
I am trying to implement what should be the simplest MIDI function of all for an iOS app but getting my head around the CoreMIDI framework is painful and I'm a bit of a newbie coder...I just want to send a MIDI note or simple sequence of notes out of my iPhone via a MIDI Interface (iRig2) to my old synthesizer.so for now a simple function that will run when I press a button and send the MIDI packet to a MIDI port of my choosing with the basic Note On Note Off.This is part of a more complex app I'm developing and now I'm at the MIDI implementation part I've hit a wall. Not much out there in tutorial form to explain MIDI in Swift. And most dont seem interested in sending MIDI data out to external hardwareHelp much appreciated!
Replies
1
Boosts
0
Views
1.1k
Activity
Apr ’22
MPMediaItem and AVPlayerItem playback sequence in background
I'm having an issue with playing sequences of different kinds of items in a background.In an app I'm working on we've introduced playlists which contain both content provided by the app and Apple Music content.For that use AVPlayer and MPMusicPlayerController respectively. We observe one player or the other (depending what content is now playing) and if the other kind of content comes next, we release the old player (if we can - MPMusicPlayerController is a singleton, so best we can do is stop it) and load item to another player.The problem starts when the app leaves foreground. Once MPMusicPlayerController takes over it doesn't want to give up control, so if any AVPlayer content comes after MPMusicPlayerController content, the music stops.One workaround that I've tried is playing with `.mixWithOthers` options when I set the category on AVAudioSession, however this creates new category of problems - I'm loosing lockscreen controls, therefore I'm also loosing airplay. One dirty trick that I've tried was setting `.mixWithOthers` 3 seconds before MPMediaItem ends, and then disabling it back once AVPlayer starts. Beside the fact that there're probably many different things that can go wrong here, MPMediaPlayerController still doesn't want to give me back the control over lockscreen controls.Is there any way this could ever work on iOS 13?
Replies
4
Boosts
0
Views
1.8k
Activity
May ’23
VTCompressionSessionEncodeFrame performance decrease
Our team use videotool box to do hardware-accelerated decoding and encoding. From iphone 6 to 7 plus, the performance of encoding increases, and it takes less time to transcode a video. However, the time spent on VTCompressionSessionEncodeFrame increases drastically on iphone 8 and newer models. For example, it takes about 650 us to encode a 720p frame on iphone 8 but 4100 us on iphone xs max. The other problem is, when i compare our app to a simple video recording app (both encode in 1080p), the time we spent on VTCompressionSessionEncodeFrame is almost 8 times as the recoding app. Is this normal?
Replies
2
Boosts
0
Views
1.1k
Activity
Oct ’21
Video preloading in AV Video Players
I am currently working on an app wich will preload 3 AVplayers wich are in an array. With preloading I mean, that the first 30 seconds of the video should get loaded before the video gets displayed on the screen. I decided to do the preloading by iterating through the array, playing all players until they are at 30 seconds. As the players are in an array, there is still a pointer wich references to the memory location on wich the video buffer and the already played video is saved. Is it true, that with that solution, the first 30 seconds won't be loaded when I start the players again at 0 seconds, because I already loaded the first 30 seconds.
Replies
2
Boosts
0
Views
2.1k
Activity
Apr ’23
CA::Render::Encoder::grow - iOS 13 - some app crashes reported in Organizer
We have an iOS app in the App Store. Recently, we see in Organizer / Crashes for that app a new type of crash that seems bound to iOS 13 devices (21 devices affected in the last few weeks, all with iOS 13.1, .2, or .3). Xcode reports that the crashes occurred in QuartzCore, on CA::Render::Encoder::grow(unsigned long).Any idea what can it be and how it could be fixed? It doesn't look related to our code. Can it be a recent Apple bug? (We didn't have these crash reports before iOS 13.) Thank you in advance.Here is an extract from the crash log:OS Version: iPhone OS 13.3 (17C54) Release Type: User Baseband Version: n/a Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Triggered by Thread: 0 Thread 0 name: Thread 0 Crashed: 0 libsystem_kernel.dylib 0x0000000191d27ec4 __pthread_kill + 8 1 libsystem_pthread.dylib 0x0000000191c431d8 pthread_kill$VARIANT$mp + 136 (pthread.c:1458) 2 libsystem_c.dylib 0x0000000191b97844 abort + 100 (abort.c:110) 3 QuartzCore 0x00000001989af340 CA::Render::Encoder::grow(unsigned long) + 304 (render-coding.cpp:562) 4 QuartzCore 0x00000001989afa80 CA::Render::Encoder::encode_data_async(void const*, unsigned long, void (*)(void const*, void*), ... + 172 (render-coding.h:272) 5 QuartzCore 0x000000019886c358 CA::Render::Image::encode(CA::Render::Encoder*) const + 748 (render-image.cpp:401) 6 QuartzCore 0x000000019888510c CA::Render::Layer::encode(CA::Render::Encoder*) const + 112 (render-coding.h:388) 7 QuartzCore 0x00000001989b3c2c CA::Render::encode_set_object(CA::Render::Encoder*, unsigned long, unsigned int, CA::Render::Obje... + 192 (render-coding.cpp:2151) 8 QuartzCore 0x00000001988f78a4 invocation function for block in CA::Context::commit_transaction(CA::Transaction*, double) + 1568 (CAContextInternal.mm:1632) 9 QuartzCore 0x00000001989add88 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 364 (CALayer.mm:2647) 10 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 11 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 12 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 13 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 14 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 15 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 16 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 17 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 18 QuartzCore 0x00000001989add00 CA::Layer::commit_if_needed(CA::Transaction*, void (CA::Layer*, unsigned int, unsigned int) block... + 228 (CALayer.mm:2633) 19 QuartzCore 0x00000001988f6924 CA::Context::commit_transaction(CA::Transaction*, double) + 2872 (CAContextInternal.mm:2288) 20 QuartzCore 0x000000019891fc08 CA::Transaction::commit() + 676 (CATransactionInternal.mm:438) 21 UIKitCore 0x0000000195769698 -[_UIContextBinder updateBindableOrderWithTest:force:] + 704 (_UIContextBinder.m:280) 22 UIKitCore 0x0000000195769214 -[_UIContextBinder createContextsWithTest:creationAction:] + 100 (_UIContextBinder.m:233) 23 UIKitCore 0x00000001961d2510 -[UIWindowScene _prepareForResume] + 84 (UIWindowScene.m:712) 24 UIKitCore 0x00000001955e364c -[UIScene _emitSceneSettingsUpdateResponseForCompletion:afterSceneUpdateWork:] + 860 (UIScene.m:1055) 25 UIKitCore 0x00000001955e45b8 -[UIScene scene:didUpdateWithDiff:transitionContext:completion:] + 220 (UIScene.m:1315) 26 UIKitCore 0x0000000195b57248 -[UIApplicationSceneClientAgent scene:handleEvent:withCompletion:] + 464 (UIApplicationSceneClientAgent.m:80) 27 FrontBoardServices 0x0000000197051248 -[FBSSceneImpl updater:didUpdateSettings:withDiff:transitionContext:completion:] + 544 (FBSSceneImpl.m:551) 28 FrontBoardServices 0x0000000197075d28 __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_bloc... + 120 (FBSWorkspaceScenesClient.m:356) 29 FrontBoardServices 0x000000019705af04 -[FBSWorkspace _calloutQueue_executeCalloutFromSource:withBlock:] + 232 (FBSWorkspace.m:357) 30 FrontBoardServices 0x0000000197075c5c __88-[FBSWorkspaceScenesClient sceneID:updateWithSettingsDiff:transitionContext:completion:]_bloc... + 184 (FBSWorkspaceScenesClient.m:355) 31 libdispatch.dylib 0x0000000191bfd184 _dispatch_client_callout + 16 (object.m:495) 32 libdispatch.dylib 0x0000000191ba5fd8 _dispatch_block_invoke_direct$VARIANT$mp + 224 (queue.c:466) 33 FrontBoardServices 0x000000019709a418 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 40 (FBSSerialQueue.m:173) 34 FrontBoardServices 0x000000019709a0e4 -[FBSSerialQueue _queue_performNextIfPossible] + 404 (FBSSerialQueue.m:216) 35 FrontBoardServices 0x000000019709a60c -[FBSSerialQueue _performNextFromRunLoopSource] + 28 (FBSSerialQueue.m:247) 36 CoreFoundation 0x0000000191eaea00 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 24 (CFRunLoop.c:1922) 37 CoreFoundation 0x0000000191eae958 __CFRunLoopDoSource0 + 80 (CFRunLoop.c:1956) 38 CoreFoundation 0x0000000191eae0f0 __CFRunLoopDoSources0 + 180 (CFRunLoop.c:1992) 39 CoreFoundation 0x0000000191ea923c __CFRunLoopRun + 1080 (CFRunLoop.c:2882) 40 CoreFoundation 0x0000000191ea8adc CFRunLoopRunSpecific + 464 (CFRunLoop.c:3192) 41 GraphicsServices 0x000000019be2e328 GSEventRunModal + 104 (GSEvent.c:2246) 42 UIKitCore 0x0000000195fa3ae0 UIApplicationMain + 1936 (UIApplication.m:4773) 43 <Our app name> 0x0000000100d9d32c main + 88 (main.m:14) 44 libdyld.dylib 0x0000000191d32360 start + 4
Replies
4
Boosts
1
Views
3.2k
Activity
Sep ’23
Fairplay Offline playback error
I am using EZDRM provider for DRM protection and using Fairplay on Ipad application, the online video streaming works perfectly , we have also added offline support through the backend and i am downloading the video and the offline key and storing it on the device.If I download one video and switch the device to airplane mode, then the video plays properly in offline case but if I again download a new video then the newly downloaded video plays properly in offline case but the one that was downloaded before stops working, the avplayeritem responds with errror -Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo={NSLocalizedFailureReason=An unknown error occurred (-42803), NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x2832ea2b0 {Error Domain=NSOSStatusErrorDomain Code=-42803 "(null)"}} .Basically only the last downloaded video plays in offline mode and all the other downloaded videos fail with the above error, any idea how to fix this issue ?I have also extracted the container and checked there are different key files downloaded for different videos and the proper key is accessed while playing the video, it is not over riding the previously downloaded key.What does the error code: 42803 indicate there is no documentation mentioning the significance of this error code. ?
Replies
9
Boosts
0
Views
4.3k
Activity
Feb ’22
AVAudioEngineImpl::IOUnitConfigurationChanged() Crash
I use AudioEngine. In crash reports I see some random EXC_BREAKPOINT crashes with this stacktrace Exception Type: EXC_BREAKPOINT (SIGTRAP) Exception Codes: 0x0000000000000001, 0x00000001896df0e4 Termination Signal: Trace/BPT trap: 5 Termination Reason: Namespace SIGNAL, Code 0x5 Terminating Process: exc handler [12467] Triggered by Thread: 15 Thread 15 Crashed: 0 libdispatch.dylib 0x00000001896df0e4 __DISPATCH_WAIT_FOR_QUEUE__ + 448 (queue.c:1619) 1 libdispatch.dylib 0x00000001896dec74 _dispatch_sync_f_slow + 140 (queue.c:1732) 2 libdispatch.dylib 0x00000001896dec74 _dispatch_sync_f_slow + 140 (queue.c:1732) 3 AVFAudio 0x00000001965b11a8 -[AVAudioEngine dealloc] + 308 (AVAudioEngine.mm:406) 4 Foundation 0x0000000189ce52ac -[NSConcreteNotification dealloc] + 68 (NSNotification.m:206) 5 AVFAudio 0x00000001965b7158 invocation function for block in AVAudioEngineImpl::IOUnitConfigurationChanged() + 292 (AVAudioEngine.mm:1215) 6 libdispatch.dylib 0x00000001896de998 _dispatch_block_async_invoke2 + 104 (queue.c:525) 7 libdispatch.dylib 0x00000001896fb184 _dispatch_client_callout + 16 (object.m:495) 8 libdispatch.dylib 0x00000001896d4e8c _dispatch_continuation_pop$VARIANT$armv81 + 404 (inline_internal.h:2484) 9 libdispatch.dylib 0x00000001896e502c _dispatch_source_invoke$VARIANT$armv81 + 1232 (source.c:568) 10 libdispatch.dylib 0x00000001896d85e0 _dispatch_lane_serial_drain$VARIANT$armv81 + 260 (inline_internal.h:2525) 11 libdispatch.dylib 0x00000001896d9128 _dispatch_lane_invoke$VARIANT$armv81 + 400 (queue.c:3863) 12 libdispatch.dylib 0x00000001896e243c _dispatch_workloop_worker_thread + 576 (queue.c:6445) 13 libsystem_pthread.dylib 0x000000018974ab88 _pthread_wqthread + 276 (pthread.c:2351) 14 libsystem_pthread.dylib 0x000000018974d760 start_wqthread + 8 I can't reproduce this crash and stacktrace doesn't point to my code. Does anyone know what is cause of this crash, how this can be fixed and if it's even possible to fix? Thanks
Replies
1
Boosts
0
Views
926
Activity
Sep ’21
AVAudioPlayerNode crash (no IO cycle)
We're getting the following crash when playing audio through AVAudioPlayerNode (via AudioKit AKPlayer):Fatal Exception: com.apple.coreaudio.avfaudio player did not see an IO cycle. Fatal Exception: com.apple.coreaudio.avfaudio 0 CoreFoundation 0x1a585c98c __exceptionPreprocess 1 libobjc.A.dylib 0x1a55850a4 objc_exception_throw 2 CoreFoundation 0x1a575ed1c +[_CFXNotificationTokenRegistration keyCallbacks] 3 AVFAudio 0x1b21d1e24 AVAE_RaiseException(NSString*, ...) 4 AVFAudio 0x1b227356c AVAudioPlayerNodeImpl::StartImpl(AVAudioTime*) 5 AVFAudio 0x1b2270910 -[AVAudioPlayerNode play] 6 OurApp 0x1049920f0 AKPlayer.play(from:to:at:hostTime:) 7 OurApp 0x1049af9fc AKPlayer.play(from:to:when:hostTime:) 8 OurApp 0x1049af840 AKPlayer.play(when:hostTime:)We're getting these crash logs through Crashlytics.We play with a 0.2s delay.I haven't been able to reliably reproduce the crash, nor find any documentation about what the error message means. We've seen another crash in the same area if the audio engine is not running, but according to our logs, the audio engine is running when this particular crash accurs.The code is not doing anything fancy, just downloading and playing a small (<1 minute) mp3 audio file. The only complicating factor is that the audio session is also configured for recording (that's the next step after picking and previewing the audio file).Any suggestions are welcome.
Replies
8
Boosts
0
Views
7.3k
Activity
Aug ’22
Qt application is not requesting microphone access
HiI have a Qt application written in C++ with Qt 5.14.1 on macOS Catalina. When I start the application from Qt Creator the application requests microphone access when recording is started. However, the installed application does not request. I have tried to reset permissions with'tcutil reset Microphone'but still I get the same behavior. The application bundle is signed with codesigncodesign --deep --strict --timestamp --force --verify --verbose \ --entitlements ./Entitlements.plist \ --sign "Developer ID Application: Emoshape Inc." \ --options runtime ./build/$APP_NAME.appand the Entitlements.plist is<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"><plist version="1.0"><dict><key>com.apple.security.device.camera</key><true/><key>com.apple.security.device.microphone</key><true/><key>com.apple.security.device.usb</key><true/></dict></plist>Also, Info.plist file has the following two entries<key>NSCameraUsageDescription</key><string>The application wants to access the camera.</string><key>NSMicrophoneUsageDescription</key><string>The application wants to access the microphone.</string>Can you tell me what I am missing ?thanksBogdan
Replies
8
Boosts
0
Views
3.6k
Activity
Apr ’22
AVAsset and HLS Streaming
I try to play a m3u8 file and a mp3 file simultaneously. but it is not working. NSURL *audioURL = [NSURL URLWithString:@"https://XXX.mp3"]; AVAsset *audioAsset = [AVAsset assetWithURL:audioURL]; NSURL *videoURL = [NSURL URLWithString:@"https://XXX.m3u8"]; AVAsset *videoAsset = [AVAsset assetWithURL:videoURL]; NSError *error; AVMutableComposition* mixAsset = [[AVMutableComposition alloc] init]; AVMutableCompositionTrack* audioTrack = [mixAsset addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; [audioTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, audioAsset.duration) ofTrack:[[audioAsset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0] atTime:kCMTimeZero error: &error]; AVMutableCompositionTrack* videoTrack = [mixAsset addMutableTrackWithMediaType:AVMediaTypeVideo preferredTrackID:kCMPersistentTrackID_Invalid]; [videoTrack insertTimeRange:CMTimeRangeMake(kCMTimeZero, videoAsset.duration) ofTrack:[[videoAsset tracksWithMediaType:AVMediaTypeVideo] objectAtIndex:0] atTime:kCMTimeZero error: &error]; AVPlayerItem *playerItem = [AVPlayerItem playerItemWithAsset:mixAsset]; movie = [AVPlayer playerWithPlayerItem:playerItem];i get the following error:*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty arrayanother mp4 video file is working but not with m3u8 file (hls streaming). How is the right way to work with such files in a AVMutableCompositionTrack?
Replies
1
Boosts
0
Views
1.8k
Activity
Aug ’21
there is any way to use swift for the dsp part of an auv3?
by defect auv3 extensions use objective-c for the dsp part can i use swift instead?
Replies
2
Boosts
0
Views
2.6k
Activity
Aug ’23
Writing to disk from CoreAudio HAL Plugin
I'm writing an audio HAL plugin to send the audio over the network to a device. I can get audio and stream it over a socket just fine but wanted to log debug messages to a file rather than syslog. However, when I try to open a file from within the HAL plugin, I get "Operation not permitted".I tried writing to /tmp as well as to the temporary directory returned by NSTemporaryDirectory(). None of these worked. It seems that the HAL plugin is sandboxed without disk access and I don't know how to provide those permissions as the plugin is run under coreaudio process.Anyone have any experience with writing to disk from an Audio HAL Plugin?
Replies
3
Boosts
0
Views
2.4k
Activity
Sep ’21
AVPlayerViewController deallocated when entering full screen
On iPadOS 13 the AVPlayerViewController throws the following console message when tapping on the expand button in the AVPlayer control:Warning: <AVPlayerViewController: ...> was deallocated while its contents were being presented full screen. ***The VC is added by addChildViewController to its parent controller and everything else worked fine when it was built with the iOS 9 SDK. But now with the iPadOS SDK 13 it no longer works.As a current workarround I set showsPlaybackControls to NO and implemented the expand and collapse feature manually (which works). But I loose all the other features from the playback controls.Would be great if some can point me in the right solution direction.Many thanks...
Replies
1
Boosts
0
Views
1.5k
Activity
May ’22