Csound Csound-dev Csound-tekno Search About

[Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)

Date2020-04-24 15:58
FromKarin Daum
Subject[Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I've just updated Csound 6.14 via the google play store on my HTC U11 (OS: Android 9). It crashes almost immediately when tapping on 'OPEN...' for loading an existing csd-file. The directory "Music" is opened for a fraction of a second but then the Csound-App crashes. Running the examples is not a problem.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-04-24 16:01
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
it also crashes when tapping on ’settings'

> On 24 Apr 2020, at 16:58, Karin Daum  wrote:
> 
> I've just updated Csound 6.14 via the google play store on my HTC U11 (OS: Android 9). It crashes almost immediately when tapping on 'OPEN...' for loading an existing csd-file. The directory "Music" is opened for a fraction of a second but then the Csound-App crashes. Running the examples is not a problem.
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2020-04-24 16:33
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I've no idea if my experience is related or not, but...

My first try at updating to the latest Csound for Android was a disaster - Csound was very slow and crashed profusely.

I reverted to the previous version, and then - before sending an email off to the listserv - downloaded the latest again. Ever since it has been running perfectly.

On Fri, Apr 24, 2020 at 11:02 AM Karin Daum <karin.daum@desy.de> wrote:
it also crashes when tapping on ’settings'

> On 24 Apr 2020, at 16:58, Karin Daum <karin.daum@DESY.DE> wrote:
>
> I've just updated Csound 6.14 via the google play store on my HTC U11 (OS: Android 9). It crashes almost immediately when tapping on 'OPEN...' for loading an existing csd-file. The directory "Music" is opened for a fraction of a second but then the Csound-App crashes. Running the examples is not a problem.
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-24 17:32
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Thanks for the report, I will look into this.

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Apr 24, 2020 at 10:58 AM Karin Daum <karin.daum@desy.de> wrote:
I've just updated Csound 6.14 via the google play store on my HTC U11 (OS: Android 9). It crashes almost immediately when tapping on 'OPEN...' for loading an existing csd-file. The directory "Music" is opened for a fraction of a second but then the Csound-App crashes. Running the examples is not a problem.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-24 18:01
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Hi Mike,

Thanks for looking into it.

I just connected the smartphone to my laptop to see if there is some hint when looking with AndroidStudio into the Logcat. I see an error message like this:

04-24 18:59:44.433 3068-3493/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24

I’m not so much an expert in Android programming that I can tell, if this has some importance for the app.

When tapping on “open…” I see these two debug messages

04-24 18:59:54.082 18979-18979/? D/Csound:: onStop...
04-24 18:59:54.090 18979-18979/? D/Csound:: onDestroy...
 

Regards,

Karin


On 24 Apr 2020, at 18:32, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Thanks for the report, I will look into this.

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Apr 24, 2020 at 10:58 AM Karin Daum <karin.daum@desy.de> wrote:
I've just updated Csound 6.14 via the google play store on my HTC U11 (OS: Android 9). It crashes almost immediately when tapping on 'OPEN...' for loading an existing csd-file. The directory "Music" is opened for a fraction of a second but then the Csound-App crashes. Running the examples is not a problem.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-24 18:19
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Apr 24, 2020 at 1:01 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

Thanks for looking into it.

I just connected the smartphone to my laptop to see if there is some hint when looking with AndroidStudio into the Logcat. I see an error message like this:

04-24 18:59:44.433 3068-3493/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24

I’m not so much an expert in Android programming that I can tell, if this has some importance for the app.

When tapping on “open…” I see these two debug messages

04-24 18:59:54.082 18979-18979/? D/Csound:: onStop...
04-24 18:59:54.090 18979-18979/? D/Csound:: onDestroy...
 

Regards,

Karin


On 24 Apr 2020, at 18:32, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Thanks for the report, I will look into this.

Regards,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Apr 24, 2020 at 10:58 AM Karin Daum <karin.daum@desy.de> wrote:
I've just updated Csound 6.14 via the google play store on my HTC U11 (OS: Android 9). It crashes almost immediately when tapping on 'OPEN...' for loading an existing csd-file. The directory "Music" is opened for a fraction of a second but then the Csound-App crashes. Running the examples is not a problem.

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-24 18:55
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin


Date2020-04-24 21:09
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I just uninstalled Csound from my Samsung Note 8 and reinstalled it from the Play Store. I had no trouble running either a builtin example or a csd on my file system. So the permissions must be OK, at least on my system. 

Thanks for the logcat but I can't really see what is happening. 

When Csound starts it prints the public data dir, make sure you load your csd from that dir.

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-25 09:22
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-25 11:56
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-25 14:25
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-25 15:59
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
/sdcard/Music is what all Android versions understand irrespectively of the presence of an external sd-card. It uses the internal storage. Only on very old Android versions, when the phones didn’t have internal storage space it required a physical sd-card. 

to be sure, that the right path is used, I use in my apps:

File filePath = new File(String.valueOf(Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)));
Link:
https://developer.android.com/reference/android/os/Environment
Best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-25 16:49
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-25 17:23
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
OK, thanks! I will try that right away. If that works I will update the Play Store.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-25 18:32
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Attachments20200425_171207.mp4  
there may be another issue related to this problem.

Yesterday I had a look to Csound on GitHub to see if the source for the app is available there. It isn’t, right? 

What I found ist Csound6.14-2.0-Android, which I suppose is the code for implementing Csound in an app, right?

If I look into the Manifest-file there, I’m missing 

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

I’m used to have it normally in the manifest files of my app. 

If I understand the discussion on


about permissions  with getExternalFilesDir() correctly you need also the READ_EXTERNAL_STORAE permission when reading from a path not belonging to app:

Starting in Build.VERSION_CODES.KITKAT, no permissions are required to read or write to the returned path; it's always accessible to the calling app. This only applies to paths generated for package name of the calling application. To access paths belonging to other packages, Manifest.permission.WRITE_EXTERNAL_STORAGE and/orManifest.permission.READ_EXTERNAL_STORAGE are required.

Do you have set READ_EXTERNAL_STORAGE permissions in the manifest file?

If not, this may also be reason, why the app does not work on all devices.


I’ve a small video attached which shows the behaviour of Csound when tapping on open, which I attach to the mail
You can see that it opens the directory Music and closes immediately.

Best,

Karin

Date2020-04-25 21:09
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I am trying your fix now, but I haven't completed the work.

The source code for the Csound for Android app in the Google Play Store is not in the csound repository, but rather it is in my csound-android repository at https://github.com/gogins/csound-android. I will update the Play Store page about the Csound app to reflect this.

I'll let you know later today, or maybe tomorrow, what happens.

Best,
Mike. 

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 1:32 PM Karin Daum <karin.daum@desy.de> wrote:
there may be another issue related to this problem.

Yesterday I had a look to Csound on GitHub to see if the source for the app is available there. It isn’t, right? 

What I found ist Csound6.14-2.0-Android, which I suppose is the code for implementing Csound in an app, right?

If I look into the Manifest-file there, I’m missing 

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

I’m used to have it normally in the manifest files of my app. 

If I understand the discussion on


about permissions  with getExternalFilesDir() correctly you need also the READ_EXTERNAL_STORAE permission when reading from a path not belonging to app:

Starting in Build.VERSION_CODES.KITKAT, no permissions are required to read or write to the returned path; it's always accessible to the calling app. This only applies to paths generated for package name of the calling application. To access paths belonging to other packages, Manifest.permission.WRITE_EXTERNAL_STORAGE and/orManifest.permission.READ_EXTERNAL_STORAGE are required.

Do you have set READ_EXTERNAL_STORAGE permissions in the manifest file?

If not, this may also be reason, why the app does not work on all devices.


I’ve a small video attached which shows the behaviour of Csound when tapping on open, which I attach to the mail
You can see that it opens the directory Music and closes immediately.

Best,

Karin
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


On 25 Apr 2020, at 18:23, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

OK, thanks! I will try that right away. If that works I will update the Play Store.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-25 21:11
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
By the way, the full list of permissions in the manifest for the Csound for Android app is:

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_SURFACE_FLINGER"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
    <uses-permission android:name="android.permission.CAPTURE_AUDIO_OUTPUT"/>
    <uses-permission android:name="android.permission.CHANGE_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
    <uses-permission android:name="android.permission.EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.INTERACT_ACROSS_USERS_FULL" android:protectionLevel="signature"/>
    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.MANAGE_DOCUMENTS"/>
    <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
    <uses-permission android:name="android.permission.READ_LOGS"/>
    <uses-permission android:name="android.permission.RECORD_AUDIO"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 4:09 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I am trying your fix now, but I haven't completed the work.

The source code for the Csound for Android app in the Google Play Store is not in the csound repository, but rather it is in my csound-android repository at https://github.com/gogins/csound-android. I will update the Play Store page about the Csound app to reflect this.

I'll let you know later today, or maybe tomorrow, what happens.

Best,
Mike. 

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 1:32 PM Karin Daum <karin.daum@desy.de> wrote:
there may be another issue related to this problem.

Yesterday I had a look to Csound on GitHub to see if the source for the app is available there. It isn’t, right? 

What I found ist Csound6.14-2.0-Android, which I suppose is the code for implementing Csound in an app, right?

If I look into the Manifest-file there, I’m missing 

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

I’m used to have it normally in the manifest files of my app. 

If I understand the discussion on


about permissions  with getExternalFilesDir() correctly you need also the READ_EXTERNAL_STORAE permission when reading from a path not belonging to app:

Starting in Build.VERSION_CODES.KITKAT, no permissions are required to read or write to the returned path; it's always accessible to the calling app. This only applies to paths generated for package name of the calling application. To access paths belonging to other packages, Manifest.permission.WRITE_EXTERNAL_STORAGE and/orManifest.permission.READ_EXTERNAL_STORAGE are required.

Do you have set READ_EXTERNAL_STORAGE permissions in the manifest file?

If not, this may also be reason, why the app does not work on all devices.


I’ve a small video attached which shows the behaviour of Csound when tapping on open, which I attach to the mail
You can see that it opens the directory Music and closes immediately.

Best,

Karin
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


On 25 Apr 2020, at 18:23, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

OK, thanks! I will try that right away. If that works I will update the Play Store.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-25 22:11
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-26 00:09
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-26 16:32
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
HI Mike,

thank you for the link. I cloned the repository but did not manage to set up everything correctly. 

The problem I have on my phone, is not opening a file its opening the (default) directory. There is the same problem when tapping on ’new’ or ‘settings’. This you can see in the small ‘video’ at t~6 sec. When tapping on open the directory ‘Music’ pops up for a fraction of a second and Csound is closed.

In the list of permissions, you sent me ‘READ_EXTERNAL_STORAGE’ is missing, indeed. In my apps I had a problem reading files on some phones without this permission. 

Best,

Karin 

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-26 16:43
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Hi Art,

you should not hard code the path, but use Environment.DIRECTORY_MUSIC

instead, this will be resolved correctly by the OS of the device, e.g.

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);
File myFile = new File(filePath, myFileString");
Best,

Karin



On 25 Apr 2020, at 23:11, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-26 17:39
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-26 18:14
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-26 18:51
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-26 18:53
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-26 19:09
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-27 00:10
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Mike -

Assuming that the new version (v25) works as you hope, does that mean that you can put your samples and .csd all in the Music folder, and Csound will find them without a complete pathname?

That's the way older Csounds for Android worked. And that's consistent with the fact that Csound is supposed to look first for files in the current directory.

Earlier Android Csounds could also find files with *relative* paths, such as those in /rawwaves or /samples if they were subfolders of /Music. Such is not the case with the current Csound at the Play store. Would this compatibility be restored as well?

On Sun, Apr 26, 2020 at 2:09 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-27 00:17
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I don't know. I always had to give a full pathname myself. We'll just have to see. 

Best, 
Mike

On Sun, Apr 26, 2020, 19:10 Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Mike -

Assuming that the new version (v25) works as you hope, does that mean that you can put your samples and .csd all in the Music folder, and Csound will find them without a complete pathname?

That's the way older Csounds for Android worked. And that's consistent with the fact that Csound is supposed to look first for files in the current directory.

Earlier Android Csounds could also find files with *relative* paths, such as those in /rawwaves or /samples if they were subfolders of /Music. Such is not the case with the current Csound at the Play store. Would this compatibility be restored as well?

On Sun, Apr 26, 2020 at 2:09 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-27 09:57
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Hi Mike,

I don’t know, if you received my reply from yesterday evening because my email address was a different one.

The problem remains with your latest version on GitHub.

I checked the path with one of my apps and I get the same as used by your app. This should be o.k.

So far I did not manage to build your App because a couple of dependencies are missing, which is likely related to the fact that I don’t use the latest version of AndroidStudio.

I had a look to your CsoundAppActivity.

I think the problem is related to the checkDangerousPermissions() method which seems to return false in onActivityResult. This would explain the behaviour of the App. The intents you launch in startActivity are started correctly, e.g. the directory Music pops up when tapping on Open” and then the Csound app closes.

Best,
Karin
  

On 26 Apr 2020, at 20:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-27 11:26
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Thanks for getting back to me. I'll debug that function today and get back to you. It seems likely to me it behaves differently on your device than on mine but we'll see. Perhaps it's one specific permission. 

Best, 
Mike

On Mon, Apr 27, 2020, 04:57 Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I don’t know, if you received my reply from yesterday evening because my email address was a different one.

The problem remains with your latest version on GitHub.

I checked the path with one of my apps and I get the same as used by your app. This should be o.k.

So far I did not manage to build your App because a couple of dependencies are missing, which is likely related to the fact that I don’t use the latest version of AndroidStudio.

I had a look to your CsoundAppActivity.

I think the problem is related to the checkDangerousPermissions() method which seems to return false in onActivityResult. This would explain the behaviour of the App. The intents you launch in startActivity are started correctly, e.g. the directory Music pops up when tapping on Open” and then the Csound app closes.

Best,
Karin
  

On 26 Apr 2020, at 20:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-27 11:44
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
if you would produce a version just with e.g. Log.d(“Csound ”,” checkDangerousPermissions “+String.valueOf(PackageManager.PERMISSION_GRANTED));  in checkDangerousPermissions(), I could tell immediately if this is the problem.

best,
karin


On 27 Apr 2020, at 12:26, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Thanks for getting back to me. I'll debug that function today and get back to you. It seems likely to me it behaves differently on your device than on mine but we'll see. Perhaps it's one specific permission. 

Best, 
Mike

On Mon, Apr 27, 2020, 04:57 Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I don’t know, if you received my reply from yesterday evening because my email address was a different one.

The problem remains with your latest version on GitHub.

I checked the path with one of my apps and I get the same as used by your app. This should be o.k.

So far I did not manage to build your App because a couple of dependencies are missing, which is likely related to the fact that I don’t use the latest version of AndroidStudio.

I had a look to your CsoundAppActivity.

I think the problem is related to the checkDangerousPermissions() method which seems to return false in onActivityResult. This would explain the behaviour of the App. The intents you launch in startActivity are started correctly, e.g. the directory Music pops up when tapping on Open” and then the Csound app closes.

Best,
Karin
  

On 26 Apr 2020, at 20:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-27 13:02
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I'll do that right away but I have a feeling that these permissions are not the problem. I'll also review my code for showing the file dialog which is more likely to be the problem.

Best,
Mike

On Mon, Apr 27, 2020, 06:45 Karin Daum <karin.daum@desy.de> wrote:
if you would produce a version just with e.g. Log.d(“Csound ”,” checkDangerousPermissions “+String.valueOf(PackageManager.PERMISSION_GRANTED));  in checkDangerousPermissions(), I could tell immediately if this is the problem.

best,
karin


On 27 Apr 2020, at 12:26, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Thanks for getting back to me. I'll debug that function today and get back to you. It seems likely to me it behaves differently on your device than on mine but we'll see. Perhaps it's one specific permission. 

Best, 
Mike

On Mon, Apr 27, 2020, 04:57 Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I don’t know, if you received my reply from yesterday evening because my email address was a different one.

The problem remains with your latest version on GitHub.

I checked the path with one of my apps and I get the same as used by your app. This should be o.k.

So far I did not manage to build your App because a couple of dependencies are missing, which is likely related to the fact that I don’t use the latest version of AndroidStudio.

I had a look to your CsoundAppActivity.

I think the problem is related to the checkDangerousPermissions() method which seems to return false in onActivityResult. This would explain the behaviour of the App. The intents you launch in startActivity are started correctly, e.g. the directory Music pops up when tapping on Open” and then the Csound app closes.

Best,
Karin
  

On 26 Apr 2020, at 20:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-27 15:50
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I've updated the permissions handling in the Csound app at: https://github.com/gogins/csound-android/releases/tag/v26, which describes the changes I made. Everything is logged.

Let me know if this works for you. I am still looking at the way the file dialogs work, as I had to fiddle with them for some time to get them to work when I wrote that code.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Apr 27, 2020 at 8:02 AM Michael Gogins <michael.gogins@gmail.com> wrote:
I'll do that right away but I have a feeling that these permissions are not the problem. I'll also review my code for showing the file dialog which is more likely to be the problem.

Best,
Mike

On Mon, Apr 27, 2020, 06:45 Karin Daum <karin.daum@desy.de> wrote:
if you would produce a version just with e.g. Log.d(“Csound ”,” checkDangerousPermissions “+String.valueOf(PackageManager.PERMISSION_GRANTED));  in checkDangerousPermissions(), I could tell immediately if this is the problem.

best,
karin


On 27 Apr 2020, at 12:26, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Thanks for getting back to me. I'll debug that function today and get back to you. It seems likely to me it behaves differently on your device than on mine but we'll see. Perhaps it's one specific permission. 

Best, 
Mike

On Mon, Apr 27, 2020, 04:57 Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I don’t know, if you received my reply from yesterday evening because my email address was a different one.

The problem remains with your latest version on GitHub.

I checked the path with one of my apps and I get the same as used by your app. This should be o.k.

So far I did not manage to build your App because a couple of dependencies are missing, which is likely related to the fact that I don’t use the latest version of AndroidStudio.

I had a look to your CsoundAppActivity.

I think the problem is related to the checkDangerousPermissions() method which seems to return false in onActivityResult. This would explain the behaviour of the App. The intents you launch in startActivity are started correctly, e.g. the directory Music pops up when tapping on Open” and then the Csound app closes.

Best,
Karin
  

On 26 Apr 2020, at 20:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-27 16:42
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
it still crashes. I attach the printouts in Logcat associated with csound:
04-27 16:57:25.945 3072-3830/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-27 16:57:25.947 3072-3830/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4468
04-27 16:57:25.954 3072-3830/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-27 16:57:25.955 3072-3830/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-27 16:57:25.963 3072-3830/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3e35fb3 com.csounds.Csound6}
04-27 16:57:25.963 3072-3830/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/26
04-27 16:57:25.964 3072-3830/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3e35fb3 com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-27 16:57:25.972 4468-4468/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-27 16:57:25.978 3072-3487/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3e35fb3 com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-27 16:57:25.978 3072-3487/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-27 16:57:25.980 6199-7163/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-27 16:57:25.980 6199-7163/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-27 16:57:25.990 3072-3487/? D/InputDispatcher: setFocus: AppWindowToken{ed0d14b token=Token{e2d121a ActivityRecord{4a7a8c5 u0 com.csounds.Csound6/.CsoundAppActivity t5559}}}
04-27 16:57:25.998 6199-7163/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587999445980, ExtraPackageName: NULL, Extra2PackageName: NULL
04-27 16:57:26.055 11915-11915/? D/Csound:: onCreate...
04-27 16:57:26.061 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.068 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 5 lines
04-27 16:57:26.069 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.070 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.071 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.072 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.083 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 9 lines
04-27 16:57:26.084 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.085 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.086 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.087 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.089 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 2 lines
04-27 16:57:26.090 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.091 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.091 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.092 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.094 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.095 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.101 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 6 lines
04-27 16:57:26.102 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.103 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.113 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 7 lines
04-27 16:57:26.115 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.121 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.127 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 1 line
04-27 16:57:26.133 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.138 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.148 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.157 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.242 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.638 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 149 lines
04-27 16:57:26.640 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.655 11915-11915/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@78e77d2, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-27 16:57:26.656 3072-4392/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-27 16:57:26.664 11915-11915/? I/Csound:: This is the Csound for Android app version code: 26
04-27 16:57:26.665 11915-11915/? I/Csound:: The Csound native library version is: 6140
04-27 16:57:26.666 11915-11915/? I/Csound:: The external storage public directory for music for Csound is: /storage/emulated/0/Music
04-27 16:57:26.668 11915-11915/? I/Csound:: The external files directory for music for Csound is: /storage/emulated/0/Android/data/com.csounds.Csound6/files/Music
04-27 16:57:26.752 3072-4392/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(11915), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-27 16:57:26.755 3072-3093/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +805ms
04-27 16:57:26.920 2635-2670/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{476b340 u0 Splash Screen com.csounds.Csound6}#0
04-27 16:57:26.920 2635-2670/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{476b340 u0 Splash Screen com.csounds.Csound6}#0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here I tapped on Open <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
04-27 16:57:29.060 11915-11915/? D/Csound:: onStop...
04-27 16:57:29.070 11915-11915/? D/Csound:: onDestroy...
04-27 16:57:29.656 4468-4468/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

============================

if I understand this correctly, the write permission is granted. However, no further massages are printed. If you added some printout to the onActivityResult method

Just a question: shouldn’t you override the onPause & onResume methods because the activities you launch in the onOptionsItemSelected method and which will be in foreground do not belong to com.csounds.Csound6?

If you added some message to be printed by the onActivityResult method, wouldn’t the absence of a such a message mean, that this is not executed?

I’m not sure, because I didn’t do it up to now in my apps. So far I only launched other activities which were part of the app. 

Best,

Karin

On 27 Apr 2020, at 16:50, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I've updated the permissions handling in the Csound app at: https://github.com/gogins/csound-android/releases/tag/v26, which describes the changes I made. Everything is logged.

Let me know if this works for you. I am still looking at the way the file dialogs work, as I had to fiddle with them for some time to get them to work when I wrote that code.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Apr 27, 2020 at 8:02 AM Michael Gogins <michael.gogins@gmail.com> wrote:
I'll do that right away but I have a feeling that these permissions are not the problem. I'll also review my code for showing the file dialog which is more likely to be the problem.

Best,
Mike

On Mon, Apr 27, 2020, 06:45 Karin Daum <karin.daum@desy.de> wrote:
if you would produce a version just with e.g. Log.d(“Csound ”,” checkDangerousPermissions “+String.valueOf(PackageManager.PERMISSION_GRANTED));  in checkDangerousPermissions(), I could tell immediately if this is the problem.

best,
karin


On 27 Apr 2020, at 12:26, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Thanks for getting back to me. I'll debug that function today and get back to you. It seems likely to me it behaves differently on your device than on mine but we'll see. Perhaps it's one specific permission. 

Best, 
Mike

On Mon, Apr 27, 2020, 04:57 Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I don’t know, if you received my reply from yesterday evening because my email address was a different one.

The problem remains with your latest version on GitHub.

I checked the path with one of my apps and I get the same as used by your app. This should be o.k.

So far I did not manage to build your App because a couple of dependencies are missing, which is likely related to the fact that I don’t use the latest version of AndroidStudio.

I had a look to your CsoundAppActivity.

I think the problem is related to the checkDangerousPermissions() method which seems to return false in onActivityResult. This would explain the behaviour of the App. The intents you launch in startActivity are started correctly, e.g. the directory Music pops up when tapping on Open” and then the Csound app closes.

Best,
Karin
  

On 26 Apr 2020, at 20:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here


Date2020-04-27 19:01
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I have opened in issue in the Csound for Android repository for this problem: https://github.com/gogins/csound-android/issues/2.

We are going back and forth a lot in the Csound list, perhaps it is better if you make comments on the issue page. You need to sign in to GitHub to comment on issues. It's easy to create an account if you don't have one.

I have posted a new release of the app at the same place: https://github.com/gogins/csound-android/releases/tag/v26. This adds a read permission to the file chooser and puts in the logging you asked for.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Apr 27, 2020 at 11:42 AM Karin Daum <karin.daum@desy.de> wrote:
it still crashes. I attach the printouts in Logcat associated with csound:
04-27 16:57:25.945 3072-3830/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-27 16:57:25.947 3072-3830/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4468
04-27 16:57:25.954 3072-3830/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-27 16:57:25.955 3072-3830/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-27 16:57:25.963 3072-3830/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3e35fb3 com.csounds.Csound6}
04-27 16:57:25.963 3072-3830/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/26
04-27 16:57:25.964 3072-3830/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3e35fb3 com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-27 16:57:25.972 4468-4468/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-27 16:57:25.978 3072-3487/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3e35fb3 com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-27 16:57:25.978 3072-3487/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-27 16:57:25.980 6199-7163/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-27 16:57:25.980 6199-7163/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-27 16:57:25.990 3072-3487/? D/InputDispatcher: setFocus: AppWindowToken{ed0d14b token=Token{e2d121a ActivityRecord{4a7a8c5 u0 com.csounds.Csound6/.CsoundAppActivity t5559}}}
04-27 16:57:25.998 6199-7163/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587999445980, ExtraPackageName: NULL, Extra2PackageName: NULL
04-27 16:57:26.055 11915-11915/? D/Csound:: onCreate...
04-27 16:57:26.061 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.068 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 5 lines
04-27 16:57:26.069 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.070 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.071 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.072 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.083 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 9 lines
04-27 16:57:26.084 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.085 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.086 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.087 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.089 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 2 lines
04-27 16:57:26.090 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.091 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.091 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.092 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.094 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.095 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.101 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 6 lines
04-27 16:57:26.102 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.103 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.113 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 7 lines
04-27 16:57:26.115 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.121 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.127 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 1 line
04-27 16:57:26.133 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.138 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.148 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.157 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.242 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.638 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 149 lines
04-27 16:57:26.640 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.655 11915-11915/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@78e77d2, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-27 16:57:26.656 3072-4392/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-27 16:57:26.664 11915-11915/? I/Csound:: This is the Csound for Android app version code: 26
04-27 16:57:26.665 11915-11915/? I/Csound:: The Csound native library version is: 6140
04-27 16:57:26.666 11915-11915/? I/Csound:: The external storage public directory for music for Csound is: /storage/emulated/0/Music
04-27 16:57:26.668 11915-11915/? I/Csound:: The external files directory for music for Csound is: /storage/emulated/0/Android/data/com.csounds.Csound6/files/Music
04-27 16:57:26.752 3072-4392/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(11915), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-27 16:57:26.755 3072-3093/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +805ms
04-27 16:57:26.920 2635-2670/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{476b340 u0 Splash Screen com.csounds.Csound6}#0
04-27 16:57:26.920 2635-2670/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{476b340 u0 Splash Screen com.csounds.Csound6}#0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here I tapped on Open <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
04-27 16:57:29.060 11915-11915/? D/Csound:: onStop...
04-27 16:57:29.070 11915-11915/? D/Csound:: onDestroy...
04-27 16:57:29.656 4468-4468/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

============================

if I understand this correctly, the write permission is granted. However, no further massages are printed. If you added some printout to the onActivityResult method

Just a question: shouldn’t you override the onPause & onResume methods because the activities you launch in the onOptionsItemSelected method and which will be in foreground do not belong to com.csounds.Csound6?

If you added some message to be printed by the onActivityResult method, wouldn’t the absence of a such a message mean, that this is not executed?

I’m not sure, because I didn’t do it up to now in my apps. So far I only launched other activities which were part of the app. 

Best,

Karin

On 27 Apr 2020, at 16:50, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I've updated the permissions handling in the Csound app at: https://github.com/gogins/csound-android/releases/tag/v26, which describes the changes I made. Everything is logged.

Let me know if this works for you. I am still looking at the way the file dialogs work, as I had to fiddle with them for some time to get them to work when I wrote that code.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Apr 27, 2020 at 8:02 AM Michael Gogins <michael.gogins@gmail.com> wrote:
I'll do that right away but I have a feeling that these permissions are not the problem. I'll also review my code for showing the file dialog which is more likely to be the problem.

Best,
Mike

On Mon, Apr 27, 2020, 06:45 Karin Daum <karin.daum@desy.de> wrote:
if you would produce a version just with e.g. Log.d(“Csound ”,” checkDangerousPermissions “+String.valueOf(PackageManager.PERMISSION_GRANTED));  in checkDangerousPermissions(), I could tell immediately if this is the problem.

best,
karin


On 27 Apr 2020, at 12:26, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Thanks for getting back to me. I'll debug that function today and get back to you. It seems likely to me it behaves differently on your device than on mine but we'll see. Perhaps it's one specific permission. 

Best, 
Mike

On Mon, Apr 27, 2020, 04:57 Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I don’t know, if you received my reply from yesterday evening because my email address was a different one.

The problem remains with your latest version on GitHub.

I checked the path with one of my apps and I get the same as used by your app. This should be o.k.

So far I did not manage to build your App because a couple of dependencies are missing, which is likely related to the fact that I don’t use the latest version of AndroidStudio.

I had a look to your CsoundAppActivity.

I think the problem is related to the checkDangerousPermissions() method which seems to return false in onActivityResult. This would explain the behaviour of the App. The intents you launch in startActivity are started correctly, e.g. the directory Music pops up when tapping on Open” and then the Csound app closes.

Best,
Karin
  

On 26 Apr 2020, at 20:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-28 16:03
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
I have tested my changes to the Csound for Android app using an emulator for the HTC U11 with an Android 9 system image. I was not able to reproduce the crash on file browser open reported by Karin Daum.

Karin, if you could completely uninstall your app and re-install from https://github.com/gogins/csound-android/releases/tag/v26, I would appreciate your patience in trying again.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Apr 27, 2020 at 2:01 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I have opened in issue in the Csound for Android repository for this problem: https://github.com/gogins/csound-android/issues/2.

We are going back and forth a lot in the Csound list, perhaps it is better if you make comments on the issue page. You need to sign in to GitHub to comment on issues. It's easy to create an account if you don't have one.

I have posted a new release of the app at the same place: https://github.com/gogins/csound-android/releases/tag/v26. This adds a read permission to the file chooser and puts in the logging you asked for.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Apr 27, 2020 at 11:42 AM Karin Daum <karin.daum@desy.de> wrote:
it still crashes. I attach the printouts in Logcat associated with csound:
04-27 16:57:25.945 3072-3830/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-27 16:57:25.947 3072-3830/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4468
04-27 16:57:25.954 3072-3830/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-27 16:57:25.955 3072-3830/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-27 16:57:25.963 3072-3830/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3e35fb3 com.csounds.Csound6}
04-27 16:57:25.963 3072-3830/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/26
04-27 16:57:25.964 3072-3830/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3e35fb3 com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-27 16:57:25.972 4468-4468/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-27 16:57:25.978 3072-3487/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3e35fb3 com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-27 16:57:25.978 3072-3487/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-27 16:57:25.980 6199-7163/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-27 16:57:25.980 6199-7163/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-27 16:57:25.990 3072-3487/? D/InputDispatcher: setFocus: AppWindowToken{ed0d14b token=Token{e2d121a ActivityRecord{4a7a8c5 u0 com.csounds.Csound6/.CsoundAppActivity t5559}}}
04-27 16:57:25.998 6199-7163/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587999445980, ExtraPackageName: NULL, Extra2PackageName: NULL
04-27 16:57:26.055 11915-11915/? D/Csound:: onCreate...
04-27 16:57:26.061 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.068 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 5 lines
04-27 16:57:26.069 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.070 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.071 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.072 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.083 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 9 lines
04-27 16:57:26.084 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.085 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.086 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.087 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.089 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 2 lines
04-27 16:57:26.090 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.091 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.091 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.092 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.094 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.095 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.101 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 6 lines
04-27 16:57:26.102 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.103 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.113 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 7 lines
04-27 16:57:26.115 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.121 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.127 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 1 line
04-27 16:57:26.133 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.138 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.148 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.157 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.242 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.638 11915-11915/? I/chatty: uid=10210(com.csounds.Csound6) identical 149 lines
04-27 16:57:26.640 11915-11915/? D/Csound: ContextCompat.checkSelfPermission for android.permission.WRITE_EXTERNAL_STORAGE returned: 0
04-27 16:57:26.655 11915-11915/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@78e77d2, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-27 16:57:26.656 3072-4392/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-27 16:57:26.664 11915-11915/? I/Csound:: This is the Csound for Android app version code: 26
04-27 16:57:26.665 11915-11915/? I/Csound:: The Csound native library version is: 6140
04-27 16:57:26.666 11915-11915/? I/Csound:: The external storage public directory for music for Csound is: /storage/emulated/0/Music
04-27 16:57:26.668 11915-11915/? I/Csound:: The external files directory for music for Csound is: /storage/emulated/0/Android/data/com.csounds.Csound6/files/Music
04-27 16:57:26.752 3072-4392/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(11915), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-27 16:57:26.755 3072-3093/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +805ms
04-27 16:57:26.920 2635-2670/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{476b340 u0 Splash Screen com.csounds.Csound6}#0
04-27 16:57:26.920 2635-2670/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{476b340 u0 Splash Screen com.csounds.Csound6}#0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here I tapped on Open <<<<<<<<<<<<<<<<<<<<<<<<<<<<<
04-27 16:57:29.060 11915-11915/? D/Csound:: onStop...
04-27 16:57:29.070 11915-11915/? D/Csound:: onDestroy...
04-27 16:57:29.656 4468-4468/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

============================

if I understand this correctly, the write permission is granted. However, no further massages are printed. If you added some printout to the onActivityResult method

Just a question: shouldn’t you override the onPause & onResume methods because the activities you launch in the onOptionsItemSelected method and which will be in foreground do not belong to com.csounds.Csound6?

If you added some message to be printed by the onActivityResult method, wouldn’t the absence of a such a message mean, that this is not executed?

I’m not sure, because I didn’t do it up to now in my apps. So far I only launched other activities which were part of the app. 

Best,

Karin

On 27 Apr 2020, at 16:50, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I've updated the permissions handling in the Csound app at: https://github.com/gogins/csound-android/releases/tag/v26, which describes the changes I made. Everything is logged.

Let me know if this works for you. I am still looking at the way the file dialogs work, as I had to fiddle with them for some time to get them to work when I wrote that code.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Apr 27, 2020 at 8:02 AM Michael Gogins <michael.gogins@gmail.com> wrote:
I'll do that right away but I have a feeling that these permissions are not the problem. I'll also review my code for showing the file dialog which is more likely to be the problem.

Best,
Mike

On Mon, Apr 27, 2020, 06:45 Karin Daum <karin.daum@desy.de> wrote:
if you would produce a version just with e.g. Log.d(“Csound ”,” checkDangerousPermissions “+String.valueOf(PackageManager.PERMISSION_GRANTED));  in checkDangerousPermissions(), I could tell immediately if this is the problem.

best,
karin


On 27 Apr 2020, at 12:26, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Thanks for getting back to me. I'll debug that function today and get back to you. It seems likely to me it behaves differently on your device than on mine but we'll see. Perhaps it's one specific permission. 

Best, 
Mike

On Mon, Apr 27, 2020, 04:57 Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I don’t know, if you received my reply from yesterday evening because my email address was a different one.

The problem remains with your latest version on GitHub.

I checked the path with one of my apps and I get the same as used by your app. This should be o.k.

So far I did not manage to build your App because a couple of dependencies are missing, which is likely related to the fact that I don’t use the latest version of AndroidStudio.

I had a look to your CsoundAppActivity.

I think the problem is related to the checkDangerousPermissions() method which seems to return false in onActivityResult. This would explain the behaviour of the App. The intents you launch in startActivity are started correctly, e.g. the directory Music pops up when tapping on Open” and then the Csound app closes.

Best,
Karin
  

On 26 Apr 2020, at 20:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have made another change that might help. In the manifest I tell the app to remain compatible with older APIs regarding external storage, see https://developer.android.com/training/data-storage/compatibility.

I have again updated the app at https://github.com/gogins/csound-android/releases/tag/v25, please try again.

Thanks for your patience,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:53 PM Michael Gogins <michael.gogins@gmail.com> wrote:
OK, I'll look for problems specific to HTC devices.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 1:51 PM Karin Daum <karin.daum@desy.de> wrote:
Thanks for your effort. It still dos not work. I deinstalled the vision from the play store and installed the version from GitHub. The behaviour is the same., except the message when started now showing the path to the public directory  and to data/…

the path is still /storage/emulated/0/…

Btw. The read permissions were not needed. The official version has also read access to the external storage, when looking via settings->app and request all permissions to be shown.

Best,
Karin


On 26 Apr 2020, at 19:14, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

My mistake!

You were talking about READ_EXTERNAL_STORAGE, and I assumed that you were talking about WRITE_EXTERNAL_STORAGE, because I assumed that that implied permission to read as well. (Perhaps that's so on my devices, but not on yours.)

I have explicitly added permission to READ_EXTERNAL_STORAGE and replaced the app at:  https://github.com/gogins/csound-android/releases/tag/v25. Please try that version and let me know if it works for you.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Apr 26, 2020 at 12:39 PM Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I’ve cloned the repository and managed to set up everything to execute fresh-build-android.sh. I get a quite some warnings and two fatal errors, listed below:

In file included from /Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.cpp:20:
/Users/daum/GitHub/csound-android/CsoundForAndroid/ndk-libraries/oboe/src/aaudio/AAudioLoader.h:57:10: fatal error:
      'android/ndk-version.h' file not found
#include <android/ndk-version.h>
 
and

In file included from /Users/daum/GitHub/csound-android/dependencies/csound/Engine/csound_orc_semantics.c:30:
/Users/daum/GitHub/csound-android/dependencies/csound/H/csound_orc.h:33:10: fatal error: 'csound_orcparse.h' file not found
#include "csound_orcparse.h"

These two .h-files are missing.

cheers,

karin

On 26 Apr 2020, at 01:09, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

TL;DR: On your HTC, try running your csd from or writing a soundfile to: /Android/data/com.csounds.Csound6/files/Music, and let me know what happens.

This is the directory returned by getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_MUSIC). I have added a printout of this directory to the Csound startup messages, and you can download this version of Csound from the csound-android repository at https://github.com/gogins/csound-android/releases/tag/v25.

Background follows...

Android apps have three basic storage locations: the application sandbox which is normally invisible but can be viewed by developers or if you unlock your device, the external files directory (as above, found in /Android/data/<app uri>/files) which is specific to each app but can be accessed by other apps, and the external storage public directory which is what the current Csound app uses because it is more visible to users and is designed for sharing files between applications.

Frustratingly, Android prefers to access the external storage public directory only as either literally a database, or as a library of documents with specific MIME types. This is the directory returned by Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC). This is the only way to get the Android system file browser to work that I could find, and it wasn't easy. Quite possibly my code for getting file paths out of document URIs works on Samsung but not on HTC. 

At any rate, please try the suggestion above and let me know what happens.

buildIrreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sat, Apr 25, 2020 at 5:11 PM Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
So, should the most (dependable and) universal complete paths for Android Csound samples be: (all of the below)
/sdcard/Music/xxx
or
/sdcard/Music/rawwaves/xxx
or
/sdcard/Music/samples/xxx

in contrast to, for example:
/storage/emulated/0/Music/xxx
?

On later versions of Android, a complete path is required. On earlier versions, samples present in the current directory didn't require a path.  


On Sat, Apr 25, 2020 at 11:50 AM Karin Daum <karin.daum@desy.de> wrote:
I just see, that 

Environment.getExternalStoragePublicDirectory(DIRECTORY_MUSIC)

has been deprecated for API29 (Android 10) and that Context.getExternalFilesDir(String)

should be used instead. To get the path

File filePath = getExternalFilesDir(Environment.DIRECTORY_MUSIC);

 should work for all API Levels Csound is aiming for.

best,

Karin

On 25 Apr 2020, at 15:25, Arthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE> wrote:

OK, then.

Is there any path to the Music folder that will work on *all* Android devices?

Csound for Android will always need to access this folder (or some other universal location) for samples.

On Sat, Apr 25, 2020 at 6:57 AM Michael Gogins <michael.gogins@gmail.com> wrote:
Beta is ok.

Android changed read/write permissions for tighter security and made it much harder for Csound to write files.

I will check Android and HTC forums for this issue. I had looked at Android forums but not specifically HTC.

Best,
Mike

On Sat, Apr 25, 2020, 04:22 Karin Daum <karin.daum@desy.de> wrote:


When Csound starts it prints the public data dir, make sure you load your csd from that dir.

This is what is used for public data:

04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music

This is why I connected the phone to AndroidStudio.  /storage/emulated/ is not directly visible to the user on the phone, but it is present in the Device File Explorer or via adb. This path is only an alias and it is pointing to the same path as /sdcard does. The problem I see, that on the HTC U11 the user does not have read/write access to /storage/emulated. Only execute is allowed. Also with adb I don’t get access to  /storage/emulated/. However  /storage/emulated/ 0/Music is visible with adb.

Concerning the permissions, I checked an older device (Sony C6603) on which Android 5.1.1 API22 is running, which is above the minimum version for Csound:  API21. On this device I do get read/write access to /storage/emulated, but the path /storage/emulated/0/ does not exist. /storage/emulaed/legacy is used instead, which then point to the same file structure than /sdcard does.

It seems as if the file structure and permissions accessed via the path /storage/emulated may differ from device to device. However, using as default the alias /sdcard instead should work on all devices. (This is what I use as default in the apps I’ve written)  

I guess, this may be the problem I have with using Csound 6.14.0 on my phone (b.t.w. when looking with settings->app->com.csound.Csound6 it tells me the version is 6.14.0 beta. Is this o.k?)

Best,

Karin

If that doesn't help I'll try with the app image for your phone. Let me know.

Best, 
Mike



On Fri, Apr 24, 2020, 13:55 Karin Daum <karin.daum@desy.de> wrote:




 

On 24 Apr 2020, at 19:19, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

Logcat is verbose. If you are running in Android Studio, clear logcat by clicking on the little trash can, and try running. When it crashes, go to the [dead] logcat pane, copy the entire contents, and mail then to me. The onStop etc. come some time after the system has decided to shut down Csound.

I’m not sure, that I understand it correctly. I’m using the app as downloaded from the app store. The only thing I can do is selecting the messages in Logcat related to csound. This is what I get (after clearing Logcat):

04-24 19:34:16.038 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}
04-24 19:34:25.034 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 2000 type(userData2): 1
04-24 19:34:25.035 3068-7233/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity (has extras)} from uid 2897 pid 4455
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 2
04-24 19:34:25.036 3068-7233/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): 1
04-24 19:34:25.048 3068-7233/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{3384cfb com.csounds.Csound6}
04-24 19:34:25.048 3068-7233/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity/24
04-24 19:34:25.049 3068-7233/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.053 4455-4455/? I/ContextualWidget: click item=ApplicationInfo(id=64, title=Csound for Android 6.14.0, componentName=ComponentInfo{com.csounds.Csound6/com.csounds.Csound6.CsoundAppActivity} type=0 appsContainer=<ALLAPPS> user=UserHandle{0} restored=0 isDisabled=0)
04-24 19:34:25.058 3068-7685/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{3384cfb com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-24 19:34:25.059 3068-7685/? D/BoostFramework: perfHint : hint: 0x1083 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): -1 type(userData2): -1
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-24 19:34:25.061 6008-6951/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-24 19:34:25.076 3068-7685/? D/InputDispatcher: setFocus: AppWindowToken{e7e2b3d token=Token{b04b494 ActivityRecord{e0ac0e7 u0 com.csounds.Csound6/.CsoundAppActivity t5437}}}
04-24 19:34:25.081 6008-6951/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1587749665061, ExtraPackageName: NULL, Extra2PackageName: NULL
04-24 19:34:25.133 21114-21114/? D/Csound:: onCreate...
04-24 19:34:25.751 21114-21114/? I/SensorManager: registerListenerImpl: listener = com.csounds.Csound6.CsoundAppActivity$6@1ecfc8d, sensor = {Sensor name="BMI160 Accelerometer", vendor="Bosch", version=1, type=1, maxRange=78.4532, resolution=0.0023942017, power=0.001, minDelay=2500}, delay = 50000, handler = null
04-24 19:34:25.752 3068-6476/? W/SensorService: D/enable: pkg_name = com.csounds.Csound6.CsoundAppActivity
04-24 19:34:25.759 21114-21114/? I/Csound:: This is the Csound for Android app version code: 24
04-24 19:34:25.760 21114-21114/? I/Csound:: The Csound native library version is: 6140
04-24 19:34:25.761 21114-21114/? I/Csound:: The public data directory for this app is: /storage/emulated/0/Music
04-24 19:34:25.821 3068-4647/? D/InputMethodManagerService: Switching to client com.csounds.Csound6(21114), IME=com.emoji.keyboard.touchpal.oem/com.cootek.smartinput5.TouchPalIME
04-24 19:34:25.828 3068-3089/? I/ActivityManager: Displayed com.csounds.Csound6/.CsoundAppActivity: +796ms
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to set client state on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:25.989 2631-3813/? W/SurfaceFlinger: Attempting to destroy on removed layer: Window{cdd728a u0 Splash Screen com.csounds.Csound6}#0
04-24 19:34:29.522 3068-3394/? D/HtcWLD_v6.7.3:     com.csounds.Csound6 com.csounds.Csound6 100 141865
04-24 19:34:36.296 21114-21114/? D/Csound:: onStop...
04-24 19:34:36.304 21114-21114/? D/Csound:: onDestroy...
04-24 19:34:36.990 4455-4455/? I/Launcher.Workspace: Updated app: com.csounds.Csound6<|>UserHandle{0}

It is just possible that you did not allow required permissions, so uninstall the app, clear your device of cached data, reinstall the app, and be sure you have enabled the two permissions required by the app (it pops up dialogs for that).


I deleted all data of Csound, uninstalled it and installed it again. The permissions were granted (as I did before)

Is it possible, that in AndroidManifest.xml-file some of the permissions are missing ?
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Best, Karin

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2020-04-28 17:59
FromKarin Daum
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Hi Mike,

I tested the new version. It’s as before. Csound simply stops when I try Open, New, Save as or Settings.

The only thing which I noticed in logcat that there is alway an error from the ActivityTrigger, here shown in case of ‘Settings' being selected:


04-28 17:58:00.829 22128-22128/? D/Csound: onOptionsItemSelected: Settings
04-28 17:58:00.832 3072-3509/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 1000 type(userData2): 1
04-28 17:58:00.834 3072-3509/? I/ActivityManager: START u0 {cmp=com.csounds.Csound6/.SettingsActivity} from uid 10212 pid 22128
04-28 17:58:00.840 3072-3509/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{5aff6ef com.csounds.Csound6}
04-28 17:58:00.840 3072-3509/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.SettingsActivity/26
04-28 17:58:00.841 3072-3509/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{5aff6ef com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-28 17:58:00.846 3072-3509/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{5aff6ef com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-28 17:58:00.849 6199-6221/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-28 17:58:00.849 6199-6221/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-28 17:58:00.849 6199-6221/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1588089480849, ExtraPackageName: NULL, Extra2PackageName: NULL
04-28 17:58:00.851 3072-3509/? D/InputDispatcher: setFocus: AppWindowToken{c2a8808 token=Token{1e6a9ab ActivityRecord{cb8ffa u0 com.csounds.Csound6/.SettingsActivity t5615}}}
04-28 17:58:01.347 22128-22128/? D/Csound:: onStop...
04-28 17:58:01.377 22128-22128/? D/Csound:: onDestroy...

I get similar messages for ‘Open’ :

04-28 18:25:48.455 25568-25568/? D/Csound: onOptionsItemSelected: Open...
04-28 18:25:48.457 3072-4540/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): android:ui duration(userData1): 2000 type(userData2): 1
04-28 18:25:48.458 889-975/? I/ANDR-PERF-MPCTL: perfHint: id = 0x1081, type = 1, handle = 4489, pid = 3072, recv time = 2000
04-28 18:25:48.458 889-975/? I/ANDR-PERF-OPTSHANDLER: PMQos latency = 0x2c
04-28 18:25:48.458 3072-4540/? I/ActivityManager: START u0 {act=android.intent.action.CHOOSER flg=0x3 cmp=android/com.android.internal.app.ChooserActivity (has extras)} from uid 10212 pid 25568
04-28 18:25:48.464 3072-4540/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{af75bcf android}
04-28 18:25:48.464 3072-4540/? E/ActivityTrigger: activityStartTrigger: not whiteListedandroid/com.android.internal.app.ChooserActivity/28
04-28 18:25:48.465 3072-4540/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{af75bcf android} is now in focus and seems to be in full-screen mode
04-28 18:25:48.465 3072-4540/? D/ActivityTrigger: ActivityTrigger activityPauseTrigger 
04-28 18:25:48.471 3072-4540/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{af75bcf android} is now in focus and seems to be in full-screen mode
04-28 18:25:48.472 3072-3749/? W/HtcSystemUPManager: HtcSystemUPHandler The policy is disabled. AppId: activity_history, category: launch
04-28 18:25:48.474 6199-7163/? I/TopPkgCallbackInterface: onVisiblePackageChanged Bundle=Bundle[mParcelledData.dataSize=240]
04-28 18:25:48.474 6199-7163/? I/[B+]AppInfoService: [onVisiblePackageChanged] Receive from framework:
04-28 18:25:48.474 6199-7163/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:android
04-28 18:25:48.474 6199-7163/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged++
04-28 18:25:48.474 6199-7163/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:android
….
04-28 18:25:48.486 3072-3096/? I/ActivityManager: Start proc 25712:android:ui/1000 for activity android/com.android.internal.app.ChooserActivity
04-28 18:25:48.524 3072-7078/? D/InputDispatcher: setFocus: AppWindowToken{70be111 token=Token{f0b0d38 ActivityRecord{e6e459b u0 android/com.android.internal.app.ChooserActivity t5623}}}
4-28 18:25:49.253 25568-25568/? D/Csound:: onStop...
04-28 18:25:49.263 868-27825/? D/SDM: DisplayBase::BuildLayerStackStats: LayerStack layer_count: 4, app_layer_count: 3, gpu_target_index: 3, display type: 0
04-28 18:25:49.263 25568-25568/? D/Csound:: onDestroy...
but in this case it’s the ChooserActivity launched by

Intent chooser = Intent.createChooser(intent, "Open file);
startActivityForResult(chooser, OPEN_FILE_REQUEST);

This is the only thing I realise and that there is no message from checkOnePermission printed. 

I could not find in Logcat any traceback dump due to crashing (what you normally get). Csound simply stops without obvious error message. 

Since you are not able to reproduce the behaviour with the emulator, do you think, it still makes sense that I comment on GitHub, describing the problem?

Best,

Karin


On 28 Apr 2020, at 17:03, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have tested my changes to the Csound for Android app using an emulator for the HTC U11 with an Android 9 system image. I was not able to reproduce the crash on file browser open reported by Karin Daum.

Karin, if you could completely uninstall your app and re-install from https://github.com/gogins/csound-android/releases/tag/v26, I would appreciate your patience in trying again.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Apr 27, 2020 at 2:01 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I have opened in issue in the Csound for Android repository for this problem: https://github.com/gogins/csound-android/issues/2.

We are going back and forth a lot in the Csound list, perhaps it is better if you make comments on the issue page. You need to sign in to GitHub to comment on issues. It's easy to create an account if you don't have one.

I have posted a new release of the app at the same place: https://github.com/gogins/csound-android/releases/tag/v26. This adds a read permission to the file chooser and puts in the logging you asked for.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com




Date2020-04-28 18:44
FromMichael Gogins
SubjectRe: [Csnd] Problems with opening files in Csound-App Android 9 (HTC U11)
Yes of course, just paste this email into your comment. This may actually be helpful for debugging. 

Best, 
Mike

On Tue, Apr 28, 2020, 12:59 Karin Daum <karin.daum@desy.de> wrote:
Hi Mike,

I tested the new version. It’s as before. Csound simply stops when I try Open, New, Save as or Settings.

The only thing which I noticed in logcat that there is alway an error from the ActivityTrigger, here shown in case of ‘Settings' being selected:


04-28 17:58:00.829 22128-22128/? D/Csound: onOptionsItemSelected: Settings
04-28 17:58:00.832 3072-3509/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): com.csounds.Csound6 duration(userData1): 1000 type(userData2): 1
04-28 17:58:00.834 3072-3509/? I/ActivityManager: START u0 {cmp=com.csounds.Csound6/.SettingsActivity} from uid 10212 pid 22128
04-28 17:58:00.840 3072-3509/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{5aff6ef com.csounds.Csound6}
04-28 17:58:00.840 3072-3509/? E/ActivityTrigger: activityStartTrigger: not whiteListedcom.csounds.Csound6/com.csounds.Csound6.SettingsActivity/26
04-28 17:58:00.841 3072-3509/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{5aff6ef com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-28 17:58:00.846 3072-3509/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{5aff6ef com.csounds.Csound6} is now in focus and seems to be in full-screen mode
04-28 17:58:00.849 6199-6221/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:com.csounds.Csound6
04-28 17:58:00.849 6199-6221/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:com.csounds.Csound6
04-28 17:58:00.849 6199-6221/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged-- PackageName: com.csounds.Csound6, TimeStamp: 1588089480849, ExtraPackageName: NULL, Extra2PackageName: NULL
04-28 17:58:00.851 3072-3509/? D/InputDispatcher: setFocus: AppWindowToken{c2a8808 token=Token{1e6a9ab ActivityRecord{cb8ffa u0 com.csounds.Csound6/.SettingsActivity t5615}}}
04-28 17:58:01.347 22128-22128/? D/Csound:: onStop...
04-28 17:58:01.377 22128-22128/? D/Csound:: onDestroy...

I get similar messages for ‘Open’ :

04-28 18:25:48.455 25568-25568/? D/Csound: onOptionsItemSelected: Open...
04-28 18:25:48.457 3072-4540/? D/BoostFramework: perfHint : hint: 0x1081 pkg_name(userDataStr): android:ui duration(userData1): 2000 type(userData2): 1
04-28 18:25:48.458 889-975/? I/ANDR-PERF-MPCTL: perfHint: id = 0x1081, type = 1, handle = 4489, pid = 3072, recv time = 2000
04-28 18:25:48.458 889-975/? I/ANDR-PERF-OPTSHANDLER: PMQos latency = 0x2c
04-28 18:25:48.458 3072-4540/? I/ActivityManager: START u0 {act=android.intent.action.CHOOSER flg=0x3 cmp=android/com.android.internal.app.ChooserActivity (has extras)} from uid 10212 pid 25568
04-28 18:25:48.464 3072-4540/? D/ActivityTrigger: activityStartTrigger: Activity is Triggerred in full screen ApplicationInfo{af75bcf android}
04-28 18:25:48.464 3072-4540/? E/ActivityTrigger: activityStartTrigger: not whiteListedandroid/com.android.internal.app.ChooserActivity/28
04-28 18:25:48.465 3072-4540/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{af75bcf android} is now in focus and seems to be in full-screen mode
04-28 18:25:48.465 3072-4540/? D/ActivityTrigger: ActivityTrigger activityPauseTrigger 
04-28 18:25:48.471 3072-4540/? D/ActivityTrigger: activityResumeTrigger: The activity in ApplicationInfo{af75bcf android} is now in focus and seems to be in full-screen mode
04-28 18:25:48.472 3072-3749/? W/HtcSystemUPManager: HtcSystemUPHandler The policy is disabled. AppId: activity_history, category: launch
04-28 18:25:48.474 6199-7163/? I/TopPkgCallbackInterface: onVisiblePackageChanged Bundle=Bundle[mParcelledData.dataSize=240]
04-28 18:25:48.474 6199-7163/? I/[B+]AppInfoService: [onVisiblePackageChanged] Receive from framework:
04-28 18:25:48.474 6199-7163/? I/[B+]AppInfoService: [onVisiblePackageChanged] packages:android
04-28 18:25:48.474 6199-7163/? I/[B+]TopPkgCallbackHelper: sendVisiblePackageChanged++
04-28 18:25:48.474 6199-7163/? I/[B+]AppInfoSyncManager: [onAppInfoEvent] app:android
….
04-28 18:25:48.486 3072-3096/? I/ActivityManager: Start proc 25712:android:ui/1000 for activity android/com.android.internal.app.ChooserActivity
04-28 18:25:48.524 3072-7078/? D/InputDispatcher: setFocus: AppWindowToken{70be111 token=Token{f0b0d38 ActivityRecord{e6e459b u0 android/com.android.internal.app.ChooserActivity t5623}}}
4-28 18:25:49.253 25568-25568/? D/Csound:: onStop...
04-28 18:25:49.263 868-27825/? D/SDM: DisplayBase::BuildLayerStackStats: LayerStack layer_count: 4, app_layer_count: 3, gpu_target_index: 3, display type: 0
04-28 18:25:49.263 25568-25568/? D/Csound:: onDestroy...
but in this case it’s the ChooserActivity launched by

Intent chooser = Intent.createChooser(intent, "Open file);
startActivityForResult(chooser, OPEN_FILE_REQUEST);

This is the only thing I realise and that there is no message from checkOnePermission printed. 

I could not find in Logcat any traceback dump due to crashing (what you normally get). Csound simply stops without obvious error message. 

Since you are not able to reproduce the behaviour with the emulator, do you think, it still makes sense that I comment on GitHub, describing the problem?

Best,

Karin


On 28 Apr 2020, at 17:03, Michael Gogins <michael.gogins@GMAIL.COM> wrote:

I have tested my changes to the Csound for Android app using an emulator for the HTC U11 with an Android 9 system image. I was not able to reproduce the crash on file browser open reported by Karin Daum.

Karin, if you could completely uninstall your app and re-install from https://github.com/gogins/csound-android/releases/tag/v26, I would appreciate your patience in trying again.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Mon, Apr 27, 2020 at 2:01 PM Michael Gogins <michael.gogins@gmail.com> wrote:
I have opened in issue in the Csound for Android repository for this problem: https://github.com/gogins/csound-android/issues/2.

We are going back and forth a lot in the Csound list, perhaps it is better if you make comments on the issue page. You need to sign in to GitHub to comment on issues. It's easy to create an account if you don't have one.

I have posted a new release of the app at the same place: https://github.com/gogins/csound-android/releases/tag/v26. This adds a read permission to the file chooser and puts in the logging you asked for.

Best,
Mike

-----------------------------------------------------
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com



Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here