Question

Currently I am developing an app that will stream a radio station from the internet. I watched this tutorial and implemented it step by step. It worked fine for a while but now I am getting the following error and the app wont stream anything

2013-07-20 10:22:40.653 ShqipCom[464:c07] [MPAVController] Autoplay: Enabling autoplay
2013-07-20 10:22:40.668 ShqipCom[464:c07] [MPCloudAssetDownloadController] Prioritization requested for media item ID: 0
2013-07-20 10:22:41.129 ShqipCom[464:c07] [MPAVController] Autoplay: Enabling autoplay
2013-07-20 10:22:41.572 ShqipCom[464:7103]  <com.apple.coremedia.networkbuffering> Error '!obj' trying to fetch default input device's sample rate
2013-07-20 10:22:41.574 ShqipCom[464:7103]  <com.apple.coremedia.networkbuffering> Error getting audio input device sample rate: '!obj'
2013-07-20 10:22:41.576 ShqipCom[464:7103]  <com.apple.coremedia.networkbuffering> AQMEIOManager::FindIOUnit: error '!dev'
2013-07-20 10:22:41.577 ShqipCom[464:5403]  <0xb0365000> AQMEIOManager::FindIOUnit: error '!dev'

(lldb)

my IBAction that triggers the player looks like this

-(IBAction)Play:(id)sender
{
 NSString *stream = @"http://www.volksmusiknet.ch/stream.m3u";
 NSURL *url = [NSURL URLWithString:stream];
 NSURLRequest *urlRequest = [NSUrlRequest requestWithUrl:url];
 [WebView loadRequest:urlRequest];
}

Maybe it is worth mentioning that in another tab i tried to stream TV streams with MPMoviePlayerController, could it be that the player is somehow conflicting?

Thank you very much!

Granit

Was it helpful?

Solution

I was trying the above code on a virtual machine and turned out that the VM had problems with the audio configuration. Tried the project on a macbook and it works fine.

OTHER TIPS

Alternative Potential Issue from AVAudioPlayer

A very similar issue can also be triggered on a Simulator not running in a virtual machine when a Bluetooth audio device is connected to the host Mac (OS X 10.9.1). In this case, I ran into the issue using AVAudioPlayer. I was running this from Xamarin.iOS, but it likely affects raw Obj-C dev in the same fashion.

If I have my Bluetooth headphones connected before running an app in the Simulator it will do nasty things as soon as prepareToPlay is called on an AVAudioPlayer instance.

iOS 6 Simulator: Crash

If I first connect my Bluetooth headphones and then try to run an app in the iOS 6 Simulator, I get a very similar error to the original question, with the same mention of sample rate and AQMEIOManager (note: some of the stack trace is Xamarin-specific but included to help people diagnose this issue):

<0xb0093000> Error '!obj' trying to fetch default input device's sample rate
<0xb0093000> Error getting audio input device sample rate: '!obj'
<0xb0093000> AQMEIOManager::FindIOUnit: error '!dev'

mono-rt: 
Native stacktrace:
2014-02-26 09:36:08.115 SmudgesiOS[689:a07]  <com.apple.main-thread> AQMEIOManager::FindIOUnit: error 'NoHW'
2014-02-26 09:36:08.115 SmudgesiOS[689:a07]  <com.apple.main-thread> Prime failed (-66680); will stop (11025/0 frames)
2014-02-26 09:36:08.117 SmudgesiOS[689:a07]  <com.apple.main-thread> AQMEIOManager::FindIOUnit: error 'NoHW'
2014-02-26 09:36:08.117 SmudgesiOS[689:a07]  <com.apple.main-thread> Prime failed (-66680); will stop (11025/0 frames)
...
mono-rt:    4   AudioToolbox                        0x00a1aa7a _ZN21UISoundRendererStructC2EP17mach_msg_header_tmPK27AudioStreamBasicDescriptionPKhmmPK28AudioStreamPacketDescriptionPKvm + 90
mono-rt:    5   AudioToolbox                        0x00a1bebe UISoundNewRenderer + 94
mono-rt:    6   AudioToolbox                        0x009f3239 ___ZN15AQIONodeManagerC2Ev_block_invoke_0 + 121

iOS 7 Simulator: Hang (Restart Required)

If I connect my Bluetooth headphones before running the app in an iOS 7 Simulator, things are much more annoying. It hangs rather than crashing the app. Xamarin reports some output that I'm guessing can also be seen in Xcode.

WARNING:   128: The default output device's sample rate was changed.
WARNING:   245: Audio device's sample rate changed. You may need to restart the simulator.
WARNING:   235: Default audio device changed. Restart the simulator to have it use the newly-selected device.

Restarting the iOS 7 Simulator doesn't resolve the issue, it just no longer spits out the warnings before it hangs again.

At this point, my Bluetooth headphones are no longer functioning in the same state as before the issue. They show connected, but all the audio is very tinny and distant. It no longer controls iTunes (which Mavericks forces to launch when connected to Bluetooth); if iTunes wasn't running, iTunes will take much longer than normal to launch and will not seem to output any audio. The only solution I have found so far when getting to this point is fully restarting the Mac.

After a restart, but keeping Bluetooth disconnected, the Simulator will run the app just fine in both iOS 6 or iOS 7 variants.

NOTE: In case anyone is curious, the same app deployed to a physical device and with the same Bluetooth headphones connected to said device: app and audio from it work fine.

I was getting this error on Mac mini when developing in Xcode 6 on El Capitan and running the app in iOS 8.4 Simulator using the built in audio output or HDMI output. Plugging in wired headphones and restarting the simulator fixed the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top