Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UIImagePickerController throws ERROR: 185: Error creating aggregate audio device: 'what' when trying to select video

when i try to use UIImagePickerController to select a video from camera roll in the iOS-Simulator of XCode 5, i get the aforementioned error. this is the output:

2013-11-02 21:28:44.788 Imagepicker[89146:1403] 21:28:44.788 ERROR:     185: Error creating aggregate audio device: 'what'
2013-11-02 21:28:44.788 Imagepicker[89146:1403] 21:28:44.788 WARNING:   219: The input device is 0x32; 'AppleHDAEngineInput:1B,0,1,1:2'
2013-11-02 21:28:44.789 Imagepicker[89146:1403] 21:28:44.789 WARNING:   223: The output device is 0x28; 'AppleHDAEngineOutput:1B,0,1,2:0'
2013-11-02 21:28:44.790 Imagepicker[89146:1403] 21:28:44.790 ERROR:     398: error 'what'
2013-11-02 21:28:44.791 Imagepicker[89146:a0b] 21:28:44.791 ERROR:     398: error -66680
2013-11-02 21:28:44.791 Imagepicker[89146:a0b] 21:28:44.791 ERROR:     398: error -66680
2013-11-02 21:28:44.792 Imagepicker[89146:a0b] 21:28:44.792 ERROR:     398: error -66680
2013-11-02 21:28:44.792 Imagepicker[89146:a0b] 21:28:44.792 ERROR:     398: error -66680

my code is:

imagePicker = [[UIImagePickerController alloc] init];
imagePicker.mediaTypes =[[NSArray alloc] initWithObjects: (NSString *) kUTTypeMovie,kUTTypeVideo,kUTTypeImage, nil];
[imagePicker setSourceType:UIImagePickerControllerSourceTypePhotoLibrary];
[imagePicker setDelegate:self];
[self presentViewController:imagePicker animated:YES completion:nil];

the image picker shows up, shows a preview with cancel, play and choose button and a dialog that says "The operation could not be completed". after pressing "OK" (the only button), the preview freezes.

-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info

never gets called. it all works fine with images.

like image 403
Brett Schneider Avatar asked Nov 02 '13 20:11

Brett Schneider


2 Answers

I've had exactly the same problem with the latest toolchain, but the following fixed it for me;

  1. On the simulator Hardware menu, select TV Out->640x480.

  2. Attempt to launch your app from Xcode, it may fail with a springboard error.

  3. On the simulator Hardware menu, select TV Out->Disabled.

After that the ImagePickerController should now work as expected.

like image 146
Steve Monks Avatar answered Nov 08 '22 07:11

Steve Monks


"iOS simulator" -> "Reset content and settigs..." solved similar problem in my case.

like image 41
iuriimoz Avatar answered Nov 08 '22 07:11

iuriimoz