Stopping recording causes errors in iOS xCode console

Hi all,

I’m writing an app that measures the volume at certain intervals (every 10 seconds.) Elsewhere in the app I play a sound when the volume exceeds a predefined limit. This all works fine in the simulator and on iOS devices. I’m getting the following errors in the console on the devices however. This error occurs when I stop the recording. I have to stop the recording after each check otherwise I’m unable to play sounds elsewhere in the app.

The errors in the xCode console with the iPad connected and app running are:

May 14 20:54:11 iPad mediaserverd[40] <Error>: 20:54:11.842 <0x256000> AudioConverterNew returned -50

May 14 20:54:11 iPad mediaserverd[40] <Error>: 20:54:11.844 <0x256000> IO_ChangeIOFormat: error -50

May 14 20:54:11 iPad mediaserverd[40] <Error>: 20:54:11.848 <0x256000> Queue_ChangeIOFormat: failed (-50)

The code that measures the volume and stops the recording:

    local recording = media.newRecording()

    recording:startTuner()    

    recording:startRecording()

    

    util.wait(500)–waits 500 ms

    

    local v = recording:getTunerVolume()

    

   

    recording:stopRecording()–causes the exception. Removing this stops the errors, but I’m unable to play music elsewhere in the app

  

Any help will be much appreciated

Rikus

How does your util.wait() function work?

Does the order of stopRecording and getTunerVolume matter?

My util.wait is not very accurate, but it does the job. The code is below. I’ve played around the with order of starting and stopping the tuner and recorder, but I still get the same errors.

util.wait = function (timeInMilliSeconds)

    local waitUntil = system.getTimer() + timeInMilliSeconds

    

    while (system.getTimer() < waitUntil) do end

    

end

Any update on this issue?

Please file a bug report using the Report a Bug link at the top of the page.  You will need to have a very  minimal app that shows the problem.

Thanks

Thank you. 

I’ve submitted a Bug: case 23602 

How does your util.wait() function work?

Does the order of stopRecording and getTunerVolume matter?

My util.wait is not very accurate, but it does the job. The code is below. I’ve played around the with order of starting and stopping the tuner and recorder, but I still get the same errors.

util.wait = function (timeInMilliSeconds)

    local waitUntil = system.getTimer() + timeInMilliSeconds

    

    while (system.getTimer() < waitUntil) do end

    

end

Any update on this issue?

Please file a bug report using the Report a Bug link at the top of the page.  You will need to have a very  minimal app that shows the problem.

Thanks

Thank you. 

I’ve submitted a Bug: case 23602 

Hello

I’m wondering if any progress was made on this?

I keep getting this error on iOS 8.1 when recording audio:

mediaserverd[22] <Error>: 22:15:24.735 ERROR:     [0x100484000] 1039: AudioConverterNew returned -50

This is not happening everytime, but very often.

When this happens my audio file has 4KB and cannot be read.

Here’s what I found on stackoverflow about this issue:

http://stackoverflow.com/questions/18959554/audioqueue-callback-get-empty-buffer-on-ios-7-only

Test was performed using Corona Enterprise 2015.2561, iOS 8.1.3

The only things I do in my code are:

audioHandler = media.newRecording(system.pathForFile(dataToSend.data\_id .. ".aif", system.TemporaryDirectory)) audioHandler:startRecording() --[AFTER A WHILE] audioHandler:stopRecording()

When I download data from my device I can see the file created but with 4KB of data.

That is a really old bug (back when the public build was 2189) and we were unable to reproduce the problem and the bug was closed.  You will probably need to file a new bug report.  You will need to build a small demo app that shows the problem.  Please be sure to include the entire project directory.  Having your xcodeproj file is critical for us to try and repo it.  Zip up the whole folder and file a bug report with it.

Thanks

Rob

Thanks for the response Rob.

I’ve created a little workaround - i set the sample rate after starting new recording.

Since then I didn’t get the error yet. When it comes, I will file a bug report.

The problem with it is that the issue is intermittent and it’s difficult to tell what the hell is going on.

Hello

I’m wondering if any progress was made on this?

I keep getting this error on iOS 8.1 when recording audio:

mediaserverd[22] <Error>: 22:15:24.735 ERROR:     [0x100484000] 1039: AudioConverterNew returned -50

This is not happening everytime, but very often.

When this happens my audio file has 4KB and cannot be read.

Here’s what I found on stackoverflow about this issue:

http://stackoverflow.com/questions/18959554/audioqueue-callback-get-empty-buffer-on-ios-7-only

Test was performed using Corona Enterprise 2015.2561, iOS 8.1.3

The only things I do in my code are:

audioHandler = media.newRecording(system.pathForFile(dataToSend.data\_id .. ".aif", system.TemporaryDirectory)) audioHandler:startRecording() --[AFTER A WHILE] audioHandler:stopRecording()

When I download data from my device I can see the file created but with 4KB of data.

That is a really old bug (back when the public build was 2189) and we were unable to reproduce the problem and the bug was closed.  You will probably need to file a new bug report.  You will need to build a small demo app that shows the problem.  Please be sure to include the entire project directory.  Having your xcodeproj file is critical for us to try and repo it.  Zip up the whole folder and file a bug report with it.

Thanks

Rob

Thanks for the response Rob.

I’ve created a little workaround - i set the sample rate after starting new recording.

Since then I didn’t get the error yet. When it comes, I will file a bug report.

The problem with it is that the issue is intermittent and it’s difficult to tell what the hell is going on.