Start Recording Audio does not work with any audio source

Post your questions and help other users.

Moderator: Martin

dah
Posts: 20
Joined: 25 Feb 2014 17:15

Start Recording Audio does not work with any audio source

Post by dah » 01 Apr 2016 18:34

Hi Martin,

For some reason Start Recording Audio does not work at all on my device (Lenovo K3 Note with Android 5.0).

I've tried every audio source and I always get the error message at the end of this message.

Other voice recorder apps work without any problems.

Can I somehow help to debug this error?

Best regards,
Daniel

PS: The error message:

Code: Select all

01.04.2016 20:19:55.607 [note.audio] Flow ends execution due to errors
01.04.2016 20:19:55.607 [note.audio] Error:
ch.gridvision.ppam.androidautomagiclib.util.p: Could not start recording audio. The selected audio source might not be available on this device.
at ch.gridvision.ppam.androidautomagic.c.a.hv.a(SourceFile:360)
at ch.gridvision.ppam.androidautomagic.c.c.e.a(SourceFile:621)
at ch.gridvision.ppam.androidautomagic.c.c.e.b(SourceFile:979)
at ch.gridvision.ppam.androidautomagic.c.c.e.a(SourceFile:62)
at ch.gridvision.ppam.androidautomagic.c.c.e$1.run(SourceFile:784)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:194)
at android.app.ActivityThread.main(ActivityThread.java:5576)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:955)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:750)
Caused by: java.io.FileNotFoundException: /storage/sdcard1/AMF/Notes/audio/01.04.2016 20:19:55.m4ka: open failed: EINVAL (Invalid argument)
at libcore.io.IoBridge.open(IoBridge.java:496)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:117)
at java.io.RandomAccessFile.<init>(RandomAccessFile.java:149)
at android.media.MediaRecorder.prepare(MediaRecorder.java:785)
at ch.gridvision.ppam.androidautomagic.c.a.hv.a(SourceFile:294)
... 12 more
Caused by: android.system.ErrnoException: open failed: EINVAL (Invalid argument)
at libcore.io.Posix.open(Native Method)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:186)
at libcore.io.IoBridge.open(IoBridge.java:482)
... 16 more

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Start Recording Audio does not work with any audio sourc

Post by Martin » 01 Apr 2016 19:15

Hi Daniel

Maybe it's a permission issue with the external SD card. I assume that this is a real SD card, correct?
Could you please try to store the audio file on the internal storage like /storage/emulated/0/test.m4a?

Regards,
Martin

dah
Posts: 20
Joined: 25 Feb 2014 17:15

Re: Start Recording Audio does not work with any audio sourc

Post by dah » 03 Apr 2016 21:17

Thanks for the quick response, Martin.

Yes, this makes the error go away.

The question is why does Automagic not have permission to write to the SD card? (On my device AM has root access)

Also, the error message isn't really a userful one.

The error message is now gone but it seems AM still does not record anything.

I've checked "Show status bar notification to stop recording" and I see a notification pop up.

But if I expand the status bar then there is no notification.

Recording files seem to be empty when I stop the recording via Stop Audio Recording and check the created file.

And Start Recording Audio seems to have another small bug.

If the file name has a space then only the path up to the space seems to get used.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Start Recording Audio does not work with any audio sourc

Post by Martin » 04 Apr 2016 19:01

Hi,

Most functions of Automagic are run as the normal app user since the features are accessed using the regular API of Android so root can often not be used. The actions that support root have to be implemented in quite a special way to support root.

Are you stopping the recording immediately when it was started? The notification should be shown as long as the recording is active. Are there any other error messages in the log? What settings do you use in Start Recording Audio? Please also try to reboot the device once, sometimes this can help.

A space in the file name seems to work on my test devices. Please send the log and flows to me so I can try to reproduce with the exact same settings you are using (on the flow list: menu->Manage->Log, menu->Send Log).

Regards,
Martin

dah
Posts: 20
Joined: 25 Feb 2014 17:15

Re: Start Recording Audio does not work with any audio sourc

Post by dah » 05 Apr 2016 21:37

Hi,

I wrote a detailed reply and then this shitty forum software decided I should login again and discarded what I wrote.

I made a screen cast that shows everything:

https://www.dropbox.com/s/uczetsrv335it ... 4.mp4?dl=0

Let me know if something is unclear.
Most functions of Automagic are run as the normal app user since the features are accessed using the regular API of Android so root can often not be used. The actions that support root have to be implemented in quite a special way to support root.
That's Interesting.

The question is still why 'Start Recording Audio' can't write to my sd card. 'Write to File' doesn't have any problems.
A space in the file name seems to work on my test devices.
It turned out this was my fault (my file explorer shows file names only until spaces when they are too long.

Best regards,
Daniel

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Start Recording Audio does not work with any audio sourc

Post by Martin » 06 Apr 2016 18:46

Hi

According to the screencast there's something not working properly. However the log was not complete since it only shows the filtered entries. Could you please enable Debug Log in the preferences of Automagic, record the audio one more time and then send the unfiltered log and the flows to me (menu->Manage->Log, menu->Send log).

Action 'Write to File' uses the regular APIs provided by Android to write data to a file. The media recorder used to record audio uses it's own mechanism to write to the specified file, maybe the media recorder uses a different mechanism to write to the file that does not work with SD cards.

Please also try to reboot the device once.

Regards,
Martin

dah
Posts: 20
Joined: 25 Feb 2014 17:15

Re: Start Recording Audio does not work with any audio sourc

Post by dah » 08 Apr 2016 19:08

Okay, I've sent you the flow and log. The email has the subject line "[Automagic] Log: note.audio".

Btw., does 'send log' send the whole log or only the flow specific log? And does 'send flow' send all flows or only one?

I ask because the flow file is called 'flows.xml'.
Action 'Write to File' uses the regular APIs provided by Android to write data to a file. The media recorder used to record audio uses it's own mechanism to write to the specified file, maybe the media recorder uses a different mechanism to write to the file that does not work with SD cards.
If this problem happens often would it be possible to add a checkbox that when checked results in Automagic writing the file to a temporary file and then after the recording stopped moves the file to the provided location?
Please also try to reboot the device once.
I did this already the last time but forgot to include it in the second version of my message (and I rebooted again before I re-run the flow this time). But it doesn't seem to change anything.

Best regards,
Daniel

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Start Recording Audio does not work with any audio sourc

Post by Martin » 08 Apr 2016 19:41

Hi,

Automagic sends the part of the log you also see in the log so might be filtered for this particular flow when opened from a flow (filtered in the title). Please clear the filter or open the log from the flow list using menu->Manage->Log, menu->'Send Log' so that I get the full log which often contains interesting system information not directly pertaining to a flow or system errors that can not be directly attributed to a flow for technical reasons sometimes.

Automagic attaches all flows to the log-mail, not just one flow.

Regards,
Martin

dah
Posts: 20
Joined: 25 Feb 2014 17:15

Re: Start Recording Audio does not work with any audio sourc

Post by dah » 18 Apr 2016 13:13

Hi,

Sorry, I totally forgot about this thread.

Okay, I repeated everything and sent the full log. The subject line has again 'note.aduio' in it.

> Automagic attaches all flows to the log-mail, not just one flow.

Can you change this?

I'd prefer if I don't have to think about what personal data I've saved in my flows (or remove them temporarily).

And you probably don't want personal data from your users either.

For example, imagine someone puts his bank login data in a flow and gets robbed shortly after he sent you his flows...

You already have the code to select flows and to extract the data and create another XML file shouldn't be much work.

This way we could just select the relevant flows and it would be easy to make sure that there are no personal data.

Best regards,
Daniel

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Start Recording Audio does not work with any audio sourc

Post by Martin » 18 Apr 2016 18:59

Thanks for the logs. The device returns an undocumented status code when the recording is started which causes the recording to stop. I'll try to add a workaround to the next version of Automagic. Would be great if you could test in the next version or an EAP build if this fixes the problem.

I see your point about attaching the flows. I'll add it to the todo-list to just share a few selected flows.
You can also decide to not send the flows in case you store data in your flows that is not suitable to be shared. You can use the regular Send Flows action on the flow list to send a few flows in another mail.

Regards,
Martin

Post Reply