Problems with TIDAL Integration - stops working when idle

Looks like an OAuth token refresh issue.

Nov 11 16:33:43 volumio-4 volumio[1273]: error: Could not get TIDAL Stream URL: Could not get TIDAL Stream URL: failed to get stream from provider tidal: rpc error: code = PermissionDenied desc = failed to get user sessions: got 401: {"status":401,"subStatus":11003,"userMessage":"The token has expired. (Expired on time)"}

https://logs.volumio.org/volumio/enxT5Dj.html

1 Like

Thanks for finding this @hulver !

@volumio @marco_volumio @Darmur If this is an OAuth token refresh issue, then it seems to be on Volumio’s side, right?

I’m a happy Volumio user, and also use other streaming platforms with native Tidal integration. These appear to be operating properly, which is another pointer as to a platform-specific issue instead.

Please help - as it is, we have to log out and back in again every time we want to use Tidal as a source right now.

@volumio @marco_volumio

Ok, so I’ve dug more into this. Not having the source for the tidal streaming stuff makes it difficult.

When you do an initial token fetch, the API returns an access token, and an expiry time. However, the code does nothing with the expiry time other than make a note of it.

You then set up some code to refresh the token every 12 hours (I think).

I’m guessing that the TIDAL api has recently changed to timeout tokens quicker than that. Although debugging is difficult, it’s not impossible, and I can see that the token timeout is now 1 hour.

All the example code on the TIDAL dev site uses 24 hour token expiry, which leads me to think that’s what it used to be.

You should change the timeout to be set according to the value stored in tokenExpirationTime when the token refresh is called, rather than just a blanket 12 hours.

– Edit to add
Of course, although it would require a fairly large re-architecting of the TIDAL code, it should be able to detect that a ‘Token has timed out’ result has been returned, refresh the token and try again automatically.

– Edit again to add
Actually, looking into this more, the way the TIDAL SDK does it is a good approach. Make the access token be returned by a method, rather than it being a variable. Then check if the token is expired and refresh it then if needed.
Not quite as robust as an automatic retry if the call fails with a token error. You could invalidate the token if you get an error and then refresh it if the token is invalid on the next call.

I’ll stop getting frustrated over code I can’t fix myself now.

Please fix this soon, I’m still in my trial period for Volumio premium, and this isn’t a great experience.

– Edit the next day (12 Nov)

Just updated to 4.067. After the reboot I logged into Tidal and started a long playlist. It stopped working after an hour, so I think my findings about the token expiring after an hour are correct.

4 Likes

Hello all! Considering @hulver 's findings, is there any new information on this and update on when we could expect a fix? @volumio @marco_volumio Thanks in advance!

First of all, huge kudos to @hulver : your assumption was absolutely spot on! Thanks for taking the time to share it; your input helped us quickly identify what was going on (fun fact: neither we nor TIDAL initially thought of this).

Here’s what happened:
TIDAL recently narrowed the validity window for authentication tokens. Our method for refreshing those tokens was no longer sufficient (that’s on us, our implementation wasn’t fully aligned with how it should have been done).

The good news:
We’ve fixed the issue.
The not-so-good news: it’s not something we can patch remotely via the cloud. The fix requires an update on the devices themselves. We’re currently validating the fix and will release an emergency update for all platforms in the next few days (as soon as QA is complete).

In the meantime:

  • If you’re affected by the issue, when TIDAL errors out, simply disable and then re-enable TIDAL from the Sources settings page.
  • Once the update is available and installed, everything will work as expected again.

We sincerely apologize for the inconvenience: this one’s on us.

Thanks for your patience and for helping us track this down

10 Likes

@volumio @hulver

Personally, I feel it’s my duty to thank the entire VOLUMIO support team for promptly addressing the issue reported by users, which confirms the great added value of this outstanding Italian company.

But I also take this opportunity to extend my personal applause and appreciation to @hulver for his clear insight and, even more so, for the great expertise he demonstrated in analyzing this complex problem.

Really good.

8 Likes

Thanks, you’re welcome. Happy I could help.

6 Likes

The community at it’s best.

1 Like

Version 3.866 is installed on the MacMini, which has been a perfect Volumio host until now. Recently, however, a problem has emerged where when I want to listen to a TIDAL stream and open TIDAL in Volumio, there’s nothing in it! It’s completely empty. If I restart the computer, sometimes it takes until the third restart to have a LAN connection, and the saved albums become visible in TIDAL. If I start playing an album, sometimes the playback stops halfway through, and there isn’t a single album left in Tidal. I have to restart the whole thing again. The MacMini has been functioning as a streamer for years, flawlessly until now, so it’s not the problem. The albums on the internal and external drives don’t disappear, only the TIDAL albums. What should I do to get my player working properly again?

----------------------------- Delete here & above before posting below -----------------

Issue has been widely reported. The fix is on its way.

This is completely unacceptable! I pay to be a premium member, I pay to Volumion to listen to music, and now I’m practically getting nothing for my money. What used to work before, why isn’t it working now?

I understand your frustration. When something that used to work suddenly doesn’t, it’s annoying, especially as a paying customer.

There has recently been a change in how TIDAL handles its connection with Volumio, and this unexpectedly caused the issue you’re seeing. The good news is that we’ve already identified the root cause and a fix is on its way.

We are very sorry for the inconvenience. Our team is working to restore full functionality as quickly as possible, and things should be back to normal shortly. Part of what your subscription supports is exactly this, ensuring that even when external services change something on their side, we can react promptly and provide a fix.

Thank you for your patience, and we appreciate your support. If anything else comes up, we are here to help.

a new version with the fix for Tidal and Tidal Connect has been released, please update your devices

I’ve been using it since it became available this morning. I’m on 4.069. Tidal is running very nicely. It’s been over 1 1/2 hours and still working flawlessly.

Thanks all for the quick update and resolution!

2 Likes

Rivo+ works perfectly after installing the new version.

All good now after updating. Thanks guys for identifying the issue fast, and fixing it even faster.
Kudos to all who participated!

All the kudos go to @hulver and the mighty Volumio crew!
@hulver for playing digital detective and nailing the exact issue like a boss.
And Volumio for somehow squeezing it into their jam-packed, caffeine-fueled roadmap, because who needs sleep when you’re pushing greatness?

Another customer appreciative of the efforts by @hulver and the Volumio team involved in this fix.

Tidal on Rivo+ has been working fine for the last 4 hours after the update v3.874

Many thanks

After yesterday’s latest OS update, I can confirm that from yesterday afternoon and throughout last night, TIDAL streaming on my Rivo Plus worked flawlessly without any issues.

My compliments to the entire VOLUMIO staff for the quick resolution of the issue.