zmNinja icon indicating copy to clipboard operation
zmNinja copied to clipboard

Android 9 - No notification sound [with resolution]

Open twau opened this issue 5 years ago • 27 comments

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_

twau avatar May 02 '19 16:05 twau

👋 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.

welcome[bot] avatar May 02 '19 16:05 welcome[bot]

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

pliablepixels avatar May 02 '19 17:05 pliablepixels

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[bot] avatar Jun 16 '19 18:06 stale[bot]

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(

greenais avatar Oct 13 '20 08:10 greenais

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.

twau avatar Oct 13 '20 09:10 twau

I got it but you wrote:

enabled in both the general android settings and zmNinja settings.

Where is the latest - zmNinja part?

greenais avatar Oct 13 '20 09:10 greenais

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 https://github.com/pliablepixels/zmNinja/commit/992a697072c71dc374f27add137ea73fb2444454, its now handled with the system notifications settings.

twau avatar Oct 13 '20 09:10 twau

Oh, I see. Thank you for clarification!

greenais avatar Oct 13 '20 12:10 greenais

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 avatar Oct 15 '20 08:10 greenais

@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.

greenais avatar Nov 01 '20 12:11 greenais

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

pliablepixels avatar Nov 15 '20 12:11 pliablepixels

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(

greenais avatar Nov 16 '20 12:11 greenais

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

pliablepixels avatar Nov 16 '20 13:11 pliablepixels

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?

greenais avatar Nov 17 '20 06:11 greenais

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

pliablepixels avatar Nov 17 '20 11:11 pliablepixels

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

greenais avatar Nov 17 '20 12:11 greenais

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

pliablepixels avatar Nov 17 '20 12:11 pliablepixels

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?

greenais avatar Nov 17 '20 13:11 greenais

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

pliablepixels avatar Nov 17 '20 13:11 pliablepixels

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

pliablepixels avatar Nov 17 '20 13:11 pliablepixels

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 avatar Nov 17 '20 13:11 greenais

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.

greenais avatar Nov 17 '20 21:11 greenais

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

pliablepixels avatar Nov 18 '20 11:11 pliablepixels

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

greenais avatar Nov 18 '20 11:11 greenais

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

pliablepixels avatar Nov 18 '20 16:11 pliablepixels

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 avatar Nov 19 '20 02:11 greenais

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.

greenais avatar Nov 19 '20 11:11 greenais