Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android 9 - No notification sound [with resolution] #814

Open
twau opened this issue May 2, 2019 · 27 comments
Open

Android 9 - No notification sound [with resolution] #814

twau opened this issue May 2, 2019 · 27 comments

Comments

@twau
Copy link

twau commented May 2, 2019

Some Android 9 phones have problem with no notification sound even if its enabled in both the general android settings and zmNinja settings. It only vibrates when receiving an notification but plays no sound. Then you might have to change the notification sound in the "PhoneGap PushPlugin"as described below.

Workaround to fix this is to go to:

  1. Apps & notifications
  2. Select zmNinja to bring up App info
  3. Verify Notifications is set to "On" and click it (see first picture for example)
  4. Click "PhoneGap PushPlugin" (see secound picture for example)
  5. Here under "Sound" you will see its empty, you have to choose a custom sound and it should now work. (see third picture for example)

This worked on both OnePlus 6 and Samsung Galaxy A8 2018 running Android 9.

zmNinja version:1.3.056 (android)
ZoneMinder version:1.32.3
OnePlus 6 with latest update 9.0.5, Android 9.
Samsung Galaxy A8 2018 running Android 9.

1_
2_
3_

@welcome
Copy link

welcome bot commented May 2, 2019

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you follow the issue template or I may not respond.

@pliablepixels pliablepixels changed the title Android 9 - No notification sound Android 9 - No notification sound [with resolution] May 2, 2019
@pliablepixels pliablepixels pinned this issue May 2, 2019
@pliablepixels
Copy link
Member

Thanks - this is very useful (till I know if phonegap-plugin-push has a solution for this)

@pliablepixels pliablepixels unpinned this issue Jun 10, 2019
@pliablepixels pliablepixels pinned this issue Jun 10, 2019
@stale
Copy link

stale bot commented Jun 16, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 16, 2019
@stale stale bot removed the stale label Jun 16, 2019
@greenais
Copy link

Hey, @twau tell me please - where did you find option to enable sound notifications in zmNinja settings?
Searched throughly all main menu, looked for it here in docs - nothing...
I have both - desktop and adroid latest versions (really look totally same) - none has alert notifications.
The only thing I have now - red bell overlying alerted monitor, but silently(

@twau
Copy link
Author

twau commented Oct 13, 2020

Hey, @twau tell me please - where did you find option to enable sound notifications in zmNinja settings?
Searched throughly all main menu, looked for it here in docs - nothing...
I have both - desktop and adroid latest versions (really look totally same) - none has alert notifications.
The only thing I have now - red bell overlying alerted monitor, but silently(

The steps and pictures above is for the Android system settings, these options is not located inside zmNinja. Open android Settings and then Apps & notifications and search for zmNinja in there.

@greenais
Copy link

greenais commented Oct 13, 2020

I got it but you wrote:

enabled in both the general android settings and zmNinja settings.

Where is the latest - zmNinja part?

@twau
Copy link
Author

twau commented Oct 13, 2020

Where is the latest - zmNinja part?

Ah now I understand :-) Checked myself and I could not find it either anymore, found that it's now removed pliablepixels@992a697, its now handled with the system notifications settings.

@greenais
Copy link

Oh, I see. Thank you for clarification!

@greenais
Copy link

The thing is that on Huawei tablet I have no PhoneGap PushPlugin item in zmNinja notifications.
@pliablepixels what could be wrong with that?
zmNinja is updated to the latest (just released) version.
Screenshot_20201015-113830
Screenshot_20201015-114216

@greenais
Copy link

greenais commented Nov 1, 2020

@pliablepixels, perhaps there are any plans to move sound management back to the app?
PG has a variety of sound plugins AFAIK...
Plus this can make desktop version really equal to mobile one.

@pliablepixels
Copy link
Member

pliablepixels commented Nov 15, 2020

I am not sure what the issue is anymore. I just tested on Android 9.

a) You need to be on the latest zmNinja app on play store (1.6.002 I think)
b) You need to be on the latest ES (6.0.6)

If you are not on ES 6.0.6 or not on 1.6.002 of zmN, things will not work as intended

Now, assuming you are on the latest:

Screenshot_1605444287

Screenshot_1605445389

I get the right sound for my notifications all the time

@greenais
Copy link

greenais commented Nov 16, 2020

Hi, thank you for the prompt reply.
I'm already on 1.6.000 (the latest available on Google Play for now) and my zmNinja settings are exactly as per screenshot above - no sound-related stuff.
Couple of weeks ago I used the latest stable ES release according to install docs and have no idea how to check its version. According to CHANGELOG.md it's probably 5.15.6 (2020-06-30)
Is 6.0.6 available in master? Can I just run master installation over already installed version or some steps to remove it first needed? Anyway, I get "red bell" notifications in zmNinja, so assume that ES part works probably. But silently(

@pliablepixels
Copy link
Member

Hi, the latest stable ES is 6.0.6.

A few notes:

  • If you are not running ES 6.x then you are likely not receiving notifications on zmNinja 1.6 (see this)
  • You seem to be referring to what happens when the app is running (since you mentioned the bell). When the app is running, and you are not running ES 6.x, the notification is delivered over websockets. There is no sound (I think - I don't 100% remember). With ES 6.0, you should see the notification banner show up. In your case, when your app is running, does the notification banner (system notification) show?
  • I tested with ES 6.x and zmN 1.6 right now - when the app is running, I see the system notification and hear the notification sound. I also tested when the app is not running (or is in background). I see the system notification and hear the sound.

So bottom line:

  • Please first make sure you are on ES 6.x

@greenais
Copy link

Hi, thank you for your help.
"does the notification banner (system notification) show?"

  • No, just red bell appears after a while, nothing else

I updated ES to 6.0.6 (no issues. all dependencies Ok), generated new certs, put them in /etc/apache2/ssl/, edited configs

=zmeventnotification.ini
[ssl]
# Enable SSL (default: yes)
enable = yes
cert = !ES_CERT_FILE
key = !ES_KEY_FILE
cert = /etc/apache2/ssl/zoneminder.crt
key = /etc/apache2/ssl/zoneminder.key

and

=secrets.ini
...
ES_CERT_FILE=/etc/apache2/ssl/zoneminder.crt
ES_KEY_FILE=/etc/apache2/ssl/zoneminder.key

but on recommended test run got the error

sudo -u www-data /usr/bin/zmeventnotification.pl --debug
INF:2020-11-17,09:30:02 PARENT: using config file: /etc/zm/zmeventnotification.ini
11/17/2020 09:30:02.394875 zmeventnotification[1323].INF [main:975] [PARENT: using config file: /etc/zm/zmeventnotification.ini]
INF:2020-11-17,09:30:02 PARENT: using secrets file: /etc/zm/secrets.ini
11/17/2020 09:30:02.504021 zmeventnotification[1323].INF [main:975] [PARENT: using secrets file: /etc/zm/secrets.ini]
11/17/2020 09:30:02.531902 zmeventnotification[1323].FAT [main:435] [Token:ES_CERT_FILE
/etc/apache2/ssl/zoneminder.crt not found in secret file]

What could be wrong with that?

@pliablepixels
Copy link
Member

It might be that it doesn’t have read permissions.

@greenais
Copy link

No, 755 for /ssl directory and 644 for both key files, owner is root off cause.
Moreover - we run command with sudo...

@pliablepixels
Copy link
Member

You are running it with sudo www-data not root. If the file actually exists it means www-data likely cannot read it.

@greenais
Copy link

Oh, yes, missed that, thank you.
Anyway 755 and 644 should be quite enough for www-data (as part of others) to be able to read...

File copied successfully by
sudo -u www-data cp /etc/apache2/ssl/zoneminder.crt /var/www

What else in the script could produce such an error?

@pliablepixels
Copy link
Member

On looking at the error it actually seems to be a token issue. Note the weird line break in the error message.

@pliablepixels
Copy link
Member

Your zmeventnotification.ini as posted is wrong. You have duplicate definitions of cert and key.

@greenais
Copy link

Strings

cert = !ES_CERT_FILE
key = !ES_KEY_FILE

were looking like needed ones, so I decided just to uncomment and edit next two with paths.
Commented them out and ES works now. Thank you!

Let me check the main issue - with sound

@greenais
Copy link

Unfortunately sound settings didn't appear - everything left in the state it was (and I posted above). Probably it's the matter of my particular Android? It's Huawei official, no tweaks, no changes.
Screenshot_20201117-170524
One positive change - Android started to show system notifications for zmNinja alerts, so we can be sure that ES works.

@pliablepixels
Copy link
Member

Which android version are you running? I am testing on 8 and 9.

@greenais
Copy link

It's 7, tablet details screenshot I posted above.
I'm trying to find another device where I can set up my google account to install zmNinija, old phone available has Android 4 unfortunately, not supported

@pliablepixels
Copy link
Member

If you are on android 7, try making use_fcmv1 = no in zmeventnotification.ini and see if that produces sound.

@greenais
Copy link

Thanks, I will test it and let you know.
I found more or less modern Redmi to check - it produces system notifications and alert sound
IMG_20201118_174825
but again no sound specific items in system zmNinja settings, only switches to enable/disable - absolutely equivalent to screenshot I posted above for Amdroid 7/Huawei. So I can't chose sound for alert as you do.

@greenais
Copy link

use_fcmv1 = no did the trick, now Huawei has default alarm sound too.
Thank you very much!
But sound settings are still unavailable, probably you can solve that in future releases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants