memen45 / SubMusic

Sync music and podcasts to your Garmin watch from your own SubSonic or Ampache server
GNU General Public License v3.0
122 stars 13 forks source link

Navidrome (subsonic) playlist sync leads to Garmin SDK 0 error #99

Closed Clusters closed 3 months ago

Clusters commented 4 months ago

Sorry for spamming issue. They seem to be all single issues regarding Navidrome.

First of all some notes to my server:

I can view all playlists in the app and can select them. I selected a playlist only containing a single MP3 song. After selecting the playlist appears on the watch with "needs sync" as expected. Unfortunately, if I try to "Sync" now, I get a GarminSDKError::0 after WiFi connection has established and the Download progress screen appeared for a short amount of time.

Unlike the other two issues I had with Test Server I can't really explain the cause of that, or what that issue really means.

Here is the REST request for that particular playlist (I also tried others, ultimately leading to the same issue):

> curl "https://myNavidrome.tld/rest/getPlaylist.view?v=1.10.2&c=subsonic&f=json&u=dummy_user&p=dummy_password&id=cba544e9-7cec-4bf4-a076-7b17c76f1744"

{"subsonic-response":{"status":"ok","version":"1.16.1","type":"navidrome","serverVersion":"0.52.5 (fd61b29a)","openSubsonic":true,"playlist":{"id":"cba544e9-7cec-4bf4-a076-7b17c76f1744","name":"Electronics I like","songCount":1,"duration":500,"public":true,"owner":"dummy_user","created":"2023-07-16T09:55:35.706618402Z","changed":"2023-07-16T10:24:01Z","coverArt":"pl-cba544e9-7cec-4bf4-a076-7b17c76f1744_64b3c541","entry":[{"id":"67a42871f9fc8eb53f46722bc4d3d238","parent":"cf013662d4c62bf5b3665cb961f2ba1b","isDir":false,"title":"You Can't Stop Mayday (Clubbasse remix LP\u0026M)","album":"Time To Progress","artist":"Clubbasse","year":2002,"genre":"Club","coverArt":"al-cf013662d4c62bf5b3665cb961f2ba1b_0","size":12092848,"contentType":"audio/mpeg","suffix":"mp3","duration":500,"bitRate":192,"path":"Clubbasse/Time To Progress/You Can't Stop Mayday (Clubbasse remix LP\u0026M).mp3","created":"2023-07-16T10:09:33.698681323Z","albumId":"cf013662d4c62bf5b3665cb961f2ba1b","artistId":"a2f691d1163f5a014bf863bb949744d7","type":"music","isVideo":false,"bpm":14012,"comment":"","sortName":"","mediaType":"song","musicBrainzId":"","genres":[],"replayGain":{"trackPeak":1,"albumPeak":1}}]}}}

I tried to enable debug logging, but I can't find any logs on the watch.

memen45 commented 4 months ago

One thing I notice is you have an ampersand in the metadata. Could you try a song without the ampersand? Might be a long shot, but I have seen watches completely reboot on parsing a © symbol somewhere in the metadata.

Also, are you sure your server is reachable from the wifi network you have configured on your watch? And are you using https in the url, without custom ports etc? Some watches require HTTPS and do not like any port specified in the url.

Clusters commented 4 months ago

Thanks for your really fast response!

for the first point. I tried it with a really basic song too:

{"subsonic-response":{"status":"ok","version":"1.16.1","type":"navidrome","serverVersion":"0.52.5 (fd61b29a)","openSubsonic":true,"playlist":{"id":"2fa1a275-4a30-43b0-a4ad-f6fe96746dec","name":"201","comment":"justatestdeletemelater","songCount":1,"duration":433,"public":true,"owner":"dummy_user","created":"2024-07-26T08:49:08.314664794Z","changed":"2024-07-26T11:18:11.294284781Z","coverArt":"pl-2fa1a275-4a30-43b0-a4ad-f6fe96746dec_66a385f3","entry":[{"id":"f2d844d2ed1d6d5edf39a7da0e7e6d5c","parent":"07f89f73a07193b53d2cb9cc9a460489","isDir":false,"title":"End Credits","album":"Cast Away","artist":"Alan Silvestri","track":7,"year":2000,"genre":"soundtrack","coverArt":"mf-f2d844d2ed1d6d5edf39a7da0e7e6d5c_61a39ce6","size":10438078,"contentType":"audio/mpeg","suffix":"mp3","duration":433,"bitRate":192,"path":"Alan Silvestri/Cast Away/07 - End Credits.mp3","discNumber":1,"created":"2023-07-12T18:41:47.606355829Z","albumId":"07f89f73a07193b53d2cb9cc9a460489","artistId":"2478cc57ba580b05e315e53d681eef5e","type":"music","isVideo":false,"bpm":0,"sortName":"","mediaType":"song","musicBrainzId":"f2456041-2b2a-4ddb-82df-a55740b282c7","genres":[],"replayGain":{"trackPeak":1,"albumPeak":1}}]}}} leading to the same response on syncing. I'm also able to browse the songs in the playlist on the watch itself, showing me the correct song title and artist on the watch. So I assume the issue is not directly connected the characters in those two fields.

Regarding your second point however, this could be an issue depending on how Garmin Watches connect to the WiFi. The Wifi I've selected for the watch is reachable (same subnet as Navidrome server), however the DNS resolution must be handled by the local DNS server, otherwise my ISP blocks the loopback traffic. So it purely depends if Garmin sets its own DNS server and is ignoring the DHCP offers configuration. I'll have to try this in a different WiFi network. This might take a couple of days. HTTPS is correctly set as indicated by the watch itself.

gitviola commented 4 months ago

I'm facing the same issue but only for the first sync. The second time I run the sync I get https://github.com/memen45/SubMusic/issues/98 as an error

memen45 commented 4 months ago

Some requests are definitely using Garmin servers, so if your server is not reachable from the global www, it might not work on your watch.

memen45 commented 3 months ago

Thanks for opening the issue! I have some more reports with regards to the Garmin Fenix 7 series watches with this exact same error upon starting a sync. I am wondering if it might be related to the SSL cipher settings or something else. Could you share the exact steps on how you created the Let's Encrypt certificates? And could you share the SSL cipher settings that are enabled on your webserver? Many thanks in advance!

Clusters commented 3 months ago

Sorry for being inactive the last weeks. Unfortunately, I did not had access to another WiFi so far. However, regarding your last question, I use the Python3 certbot for my nginx reverse proxy.

It's one of the default ways to deploy Let's Encrypt certificates for local domains. The way I did it is described here: https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04 (also working on Ubuntu 24.04 or debian).

memen45 commented 3 months ago

Thanks for your message! The default certbot key type is ecdsa, while Fenix 7 series watches seem to only support rsa. Could you try and change this using the cli option --key-type rsa with certbot as described here.

Curious to see if that solves your issue!

Clusters commented 3 months ago

Good find! That was it. Changing the cert key type from ECDSA to RSA fixed the issue for me.

Syncing between my Navidrome server and my Fenix 7 is working now. Thanks a lot @memen45 !

gitviola commented 3 months ago

This also fixed it for me!! 🙌 Now I only have an issue with playlists that have more than 20 songs in it but this is a known issue/limitation stated in the documentation

adam-pye commented 2 months ago

I'm having the exact same problem

My setup is all running on docker

This was all working fine for over a year but has stopped working in last month or so with no changes on my side.

I've used cloudflare to create an origin server cert using RSA 2048 and i'm loading the pem and key into my traefik container.

Whenever I check the certificate via a browser though its always "ECDSA Signature with SHA-256". I think this is because cloudflare generates an 'edge certificate' for connection between browser and cloudflare and i don't see anyway to change this. Seems like they might have changed this recently? Can't think what else would have caused sync to stop working

I'm assuming its related to garmin not supporting ECDSA as that seems to be the problem for most others. Can i check logs some where?