KieronQuinn / AmbientMusicMod

Port of Now Playing from Pixels to other Android devices
GNU General Public License v3.0
1.82k stars 40 forks source link

Manual Recognition Button Does Not Update the Widget #214

Closed Attacktive closed 5 months ago

Attacktive commented 7 months ago

I'm sure that I've seen it DO work; the text on the widget changed to something like 'Recognising' but it doesn't do anything when it doesn't work. I have no idea what the exact condition may be.

Automatic recognition always works properly so I guess it's matter of the widget.

[ 12-07 15:24:07.873 17571:17571 I/AmbientMusicDetector ] Running on-device song recognition.

[ 12-07 15:24:07.874 17571:17571 I/AudioBufferManager ] Creating AudioRecord accessing DSP audio.

[ 12-07 15:24:07.943 17571:17703 D/PixAmbMusic ] Got AudioRecord, format=AudioFormat: props=7 enc=2 chan=0x10 chan_index=0x0 rate=16000, rate=16000

[ 12-07 15:24:07.944 17571:17703 D/PixAmbMusic ] Buffer length=128000

[ 12-07 15:24:15.953 17571:17703 I/AudioBufferManager ] Background #2: Audio recording finished, got 128000 samples.

[ 12-07 15:24:15.955 17571:17651 I/AmbientMusicDetector ] Received music trigger with last-matched track ID '0' () from shard ''

[ 12-07 15:24:15.957 17571:17651 I/NnfpMusicRecognizer ] SoundSearch FP fallback configuration: AutoOnDemand: false HistoryDonation: false SoSe Fps: false

[ 12-07 15:24:15.957 17571:17651 D/NNFP ] Recognising using NNFP v3

[ 12-07 15:24:15.973 17571:17651 I/native ] I0000 00:00:1701930255.972981 17651 tensorflow_fingerprinter.cc:50] CPU Music detector score: 0.0100174

[ 12-07 15:24:15.981 17571:17651 I/native ] I0000 00:00:1701930255.981772 17651 tensorflow_fingerprinter.cc:50] CPU Music detector score: 0.0310408

[ 12-07 15:24:15.990 17571:17651 I/native ] I0000 00:00:1701930255.990459 17651 tensorflow_fingerprinter.cc:50] CPU Music detector score: 0.0152135

[ 12-07 15:24:15.998 17571:17651 I/native ] I0000 00:00:1701930255.998761 17651 tensorflow_fingerprinter.cc:50] CPU Music detector score: 0.0200131

[ 12-07 15:24:15.998 17571:17651 I/native ] I0000 00:00:1701930255.998833 17651 tensorflow_fingerprinter.cc:131] Music detector done. Stats: Total run-time: 40.272396ms IntToFloat: 467.187us, 16 calls, 128000 items Resample: 8.720262ms, 5 calls, 88201 items PowerSpectrogram: 3.636613ms, 5 calls, 4 items MusicDetectorScores: 27.095208ms, 5 calls, 4 items DetectorScores: 5 calls, 4 items

[ 12-07 15:24:15.998 17571:17651 I/native ] I0000 00:00:1701930255.998930 17651 tensorflow_fingerprinter.cc:240] Best music score is: 0.03 Considered high: No

[ 12-07 15:24:15.998 17571:17651 I/native ] I0000 00:00:1701930255.998949 17651 tensorflow_fingerprinter.cc:256] Sound Search fingerprints not needed. Music score high: No

[ 12-07 15:24:15.999 17571:17651 I/native ] I0000 00:00:1701930255.999382 17651 recognizer.cc:162] Skipped fingerprinting, because music detector score below threshold.

[ 12-07 15:24:15.999 17571:17651 D/NNFP ] Recognising using NNFP v3

[ 12-07 15:24:16.001 17571:17651 I/NnfpMusicRecognizer ] Finished recognition for region xa and DB version 3069 with result: NOT_MUSIC

[ 12-07 15:24:16.001 17571:17651 D/PixAmbMusic ] Computing DSP squelch overrides.

[ 12-07 15:24:16.002 17571:17651 D/PixAmbMusic ] Using aggressive policy. num recognitions: 0, num detections: 10

[ 12-07 15:24:16.002 17571:17651 I/RecognitionStateHandler ] Dsp model overrides: reloadDetectionModel = [true] : new squelch = [90000] Reconfiguration [# qrk@f727dd4b] Latest:[# puj@a37acaa2]

[ 12-07 15:24:16.002 17571:17651 D/PixAmbMusic ] LastMatch: {track_id: 0, title: ''}

[ 12-07 15:24:16.003 17571:17651 D/PixAmbMusic ] Wrote recognitionState: # qbd@ba2973d8

[ 12-07 15:24:16.004 17571:17651 I/MusicRecognitionHandler ] Music recognition was skipped, because secondary music detector score below threshold (= 0.2)

[ 12-07 15:24:16.006 17571:17651 I/WestworldAmbientMusicLo ] Now Playing Usage FA is disabled via flag.

[ 12-07 15:24:16.007 17571:17651 I/AmbientMusicDetector ] Pipeline run finished, restarting model: true

[ 12-07 15:24:16.009 17571:17689 W/SoundTriggerDetectionService ] operationFinished called, but no client for 9f6ad62a-1f0b-11e7-87c5-40a8f03d3f15. Was this called after onDisconnected?

[ 12-07 15:24:16.009 17571:17651 I/AmbientMusicServiceMana ] Trying to load model /system/etc/firmware/music_detector.sound_model from /system/etc/firmware/music_detector.descriptor

[ 12-07 15:24:16.009 17571:17651 I/AmbientMusicServiceMana ] Applying config override: # puf@43da8f23

[ 12-07 15:24:16.011 17571:17651 W/AmbientHotwordUtil ] java.lang.IllegalArgumentException: Could not find descriptor for 'classifier_frame_step_ms' at reu.n(PG:3) at reu.b(PG:1) at pvb.w(PG:47) at pvb.r(PG:4) at puw.close(PG:4) at kxb.run(PG:2) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at qdm.run(PG:38) at java.lang.Thread.run(Thread.java:1012)

[ 12-07 15:24:16.012 17571:17651 W/AmbientHotwordUtil ] java.lang.IllegalArgumentException: Could not find descriptor for 'classifier_frame_step_ms' at reu.n(PG:3) at reu.b(PG:1) at pvb.w(PG:53) at pvb.r(PG:4) at puw.close(PG:4) at kxb.run(PG:2) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:487) at java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:307) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644) at qdm.run(PG:38) at java.lang.Thread.run(Thread.java:1012)

[ 12-07 15:24:16.012 17571:17651 I/SoundTriggerManagerComp ] Loading model 9f6ad62a-1f0b-11e7-87c5-40a8f03d3f15

[ 12-07 15:24:16.012 17571:17651 I/AmbientMusicServiceMana ] Re-starting music detector model.

[ 12-07 15:24:16.012 17571:17651 I/AmbientMusicServiceMana ] Trying to unloading model 12caddb1-acdb-4dce-8cb0-2e95a2313aee

[ 12-07 15:24:16.012 17571:17651 I/SoundTriggerManagerComp ] Unloading model 12caddb1-acdb-4dce-8cb0-2e95a2313aee

[ 12-07 15:24:16.012 17571:17651 I/AmbientMusicServiceMana ] Update config: # puf@43da8f23 Success: true


- log from `com.kieronquinn.app.ambientmusicmod`

[ 12-07 15:26:47.235 21066:21066 I/ViewRootImpl@1cd598f[MainActivity] ] onDisplayChanged oldDisplayState=2 newDisplayState=2

[ 12-07 15:26:47.318 21066:21066 D/ConnectivityManager ] StackLog: [android.net.ConnectivityManager.sendRequestForNetwork(ConnectivityManager.java:4322)] [android.net.ConnectivityManager.registerDefaultNetworkCallbackForUid(ConnectivityManager.java:4886)] [android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4853)] [android.net.ConnectivityManager.registerDefaultNetworkCallback(ConnectivityManager.java:4827)] [com.kieronquinn.app.ambientmusicmod.utils.extensions.Extensions_ContextKt$getNetworkCapabilities$1.invokeSuspend(Extensions+Context.kt:211)] [com.kieronquinn.app.ambientmusicmod.utils.extensions.Extensions_ContextKt$getNetworkCapabilities$1.invoke(Unknown Source:8)] [com.kieronquinn.app.ambientmusicmod.utils.extensions.Extensions_ContextKt$getNetworkCapabilities$1.invoke(Unknown Source:4)] [kotlinx.coroutines.flow.ChannelFlowBuilder.collectTo$suspendImpl(Builders.kt:322)] [kotlinx.coroutines.flow.ChannelFlowBuilder.collectTo(Unknown Source:0)] [kotlinx.coroutines.flow.CallbackFlowBuilder.collectTo(Builders.kt:336)] [kotlinx.coroutines.flow.internal.ChannelFlow$collectToFun$1.invokeSuspend(ChannelFlow.kt:60)] [kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)] [kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)]

[ 12-07 15:26:47.335 21066:21066 D/ConnectivityManager ] StackLog: [android.net.ConnectivityManager.unregisterNetworkCallback(ConnectivityManager.java:4996)] [com.kieronquinn.app.ambientmusicmod.utils.extensions.Extensions_ContextKt$getNetworkCapabilities$1$1.invoke(Extensions+Context.kt:214)] [com.kieronquinn.app.ambientmusicmod.utils.extensions.Extensions_ContextKt$getNetworkCapabilities$1$1.invoke(Extensions+Context.kt:213)] [kotlinx.coroutines.channels.ProduceKt.awaitClose(Produce.kt:54)] [kotlinx.coroutines.channels.ProduceKt$awaitClose$1.invokeSuspend(Unknown Source:13)] [kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)] [kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:104)]

[ 12-07 15:26:47.409 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [81]

[ 12-07 15:26:47.437 21066:21066 W/BpBinder ] Large outgoing transaction of 702452 bytes, interface descriptor , code 13

[ 12-07 15:26:47.440 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [108]

[ 12-07 15:26:47.464 21066:21066 W/BpBinder ] Large outgoing transaction of 703116 bytes, interface descriptor , code 13

[ 12-07 15:26:47.468 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [137]

[ 12-07 15:26:47.494 21066:21066 W/BpBinder ] Large outgoing transaction of 703780 bytes, interface descriptor , code 13

[ 12-07 15:26:47.497 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [154]

[ 12-07 15:26:47.527 21066:21066 W/BpBinder ] Large outgoing transaction of 704444 bytes, interface descriptor , code 13

[ 12-07 15:26:47.639 21066:21076 I/ambientmusicmod ] Background concurrent copying GC freed 76725(3175KB) AllocSpace objects, 19(4788KB) LOS objects, 49% free, 8469KB/16MB, paused 117us,54us total 220.221ms

[ 12-07 15:26:47.639 21066:21076 W/ambientmusicmod ] Reducing the number of considered missed Gc histogram windows from 121 to 100

[ 12-07 15:26:47.645 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.645 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.646 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.648 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.650 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.650 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.650 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.650 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.653 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.653 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.654 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.655 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.656 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.656 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.658 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.659 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.661 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.661 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.662 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.662 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.663 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.665 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.665 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.667 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.668 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.668 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.669 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.670 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.670 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.670 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.672 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.680 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.680 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.681 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.682 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.682 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.683 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.685 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.685 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.685 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.687 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.688 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.688 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.690 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.690 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.691 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.693 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.693 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.693 21066:21078 W/System ] A resource failed to call CursorWindow.close.

[ 12-07 15:26:47.693 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:47.694 21066:21078 W/System ] A resource failed to call CursorWrapperInner.close.

[ 12-07 15:26:48.089 21066:21066 I/ViewRootImpl@1cd598f[MainActivity] ] onDisplayChanged oldDisplayState=2 newDisplayState=2

[ 12-07 15:26:55.462 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [81]

[ 12-07 15:26:55.511 21066:21066 W/BpBinder ] Large outgoing transaction of 705108 bytes, interface descriptor , code 13

[ 12-07 15:26:55.515 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [108]

[ 12-07 15:26:55.559 21066:21066 W/BpBinder ] Large outgoing transaction of 705772 bytes, interface descriptor , code 13

[ 12-07 15:26:55.566 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [137]

[ 12-07 15:26:55.604 21066:21066 W/BpBinder ] Large outgoing transaction of 706436 bytes, interface descriptor , code 13

[ 12-07 15:26:55.608 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [154]

[ 12-07 15:26:55.648 21066:21066 W/BpBinder ] Large outgoing transaction of 707100 bytes, interface descriptor , code 13

[ 12-07 15:26:55.654 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [81]

[ 12-07 15:26:55.685 21066:21066 W/BpBinder ] Large outgoing transaction of 707780 bytes, interface descriptor , code 13

[ 12-07 15:26:55.688 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [108]

[ 12-07 15:26:55.730 21066:21066 W/BpBinder ] Large outgoing transaction of 708460 bytes, interface descriptor , code 13

[ 12-07 15:26:55.733 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [137]

[ 12-07 15:26:55.771 21066:21066 W/BpBinder ] Large outgoing transaction of 709140 bytes, interface descriptor , code 13

[ 12-07 15:26:55.777 21066:21066 I/AppWidgetManager ] updateAppWidget() appWidgetIds = [154]

[ 12-07 15:26:55.825 21066:21066 W/BpBinder ] Large outgoing transaction of 709820 bytes, interface descriptor , code 13

KieronQuinn commented 7 months ago

The log shows it coming back as NOT_MUSIC, does the widget not update to show this?

Attacktive commented 7 months ago

Hi, @KieronQuinn. Thank you for your time.

The log shows it coming back as NOT_MUSIC, does the widget not update to show this?

No. The automatic recognition does update the widget to Recognising state periodically but hitting the button doesn't; it stays to No Music Recognised.

It's Samsung Galaxy S23 and it persists on both OneUI and Microsoft Launcher.

Attacktive commented 7 months ago

I can confirm that the recognition DOES work as expected.

I play a song and touch the recognition button on the widget, then the Now Playing history has it after a few seconds; it's just that the widget doesn't update its state.

KieronQuinn commented 5 months ago

The only way I can reproduce this on a Samsung device is by the app being killed or crashing. Given it's working when you're doing it manually, I think this is a case of the app being killed unfortunately, so all I can do is suggest you follow the steps at https://dontkillmyapp.com/samsung