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

Selecting HI_RES (OAUTH) still plays HI_RES_LOSSLESS #168

Closed
fmarzocca opened this issue Mar 30, 2024 · 11 comments · Fixed by #169
Closed

Selecting HI_RES (OAUTH) still plays HI_RES_LOSSLESS #168

fmarzocca opened this issue Mar 30, 2024 · 11 comments · Fixed by #169

Comments

@fmarzocca
Copy link

fmarzocca commented Mar 30, 2024

I have set HI_RES and OAUTH, as confirmed by the log:

Mar 29 17:40:29 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.backend Mopidy-Tidal version: v0.3.6
Mar 29 17:40:29 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.backend Python-Tidal version: v0.7.5
Mar 29 17:40:29 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.backend PKCE login web server port: 8989
Mar 29 17:40:29 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.backend Quality: HI_RES
Mar 29 17:40:29 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.backend Authentication: OAuth
Mar 29 17:40:29 pab mopidy[642]: WARNING  [TidalBackend-3 (_actor_loop)] mopidy_tidal.backend AUTO login implies lazy connection, setting lazy=Tru>
Mar 29 17:40:29 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.backend Login method: AUTO
Mar 29 17:40:29 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.backend Using default client id & client secret from python->

but it still plays HI_RES_LOSSLESS/FLAC for tracks that also have HI_RES/MQA available:

Mar 30 12:56:17 pab mopidy[642]: DEBUG    [mopidy-tidal-images-_0] mopidy_tidal.library Image URL for 'tidal:album:244731': 'https://resources.tidal.com/images/4f9e1be6/>
Mar 30 13:00:28 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.playback TIDAL uri: tidal:track:15796:77661290:77661291
Mar 30 13:00:29 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.playback MimeType:application/dash+xml
Mar 30 13:00:29 pab mopidy[642]: INFO     [TidalBackend-3 (_actor_loop)] mopidy_tidal.playback Starting playback of track:77661291, (quality:HI_RES_LOSSLESS, codec:flac,>

The track uri tidal:track:15796:77661290:77661291 has MQA capability, but it plays HI_RES_LOSSLESS/FLAC:

./tidalQuality.py "tidal:track:15796:77661290:77661291"
Playing: {"quality": "HI_RES_LOSSLESS", "codec": "flac"}
Track metadata: ['LOSSLESS', 'HIRES_LOSSLESS', 'MQA']

Shouldn't TidalPlaybackProvider take care of this?

@fmarzocca fmarzocca changed the title Selecting HI_RES still plays HI_RES_LOSSLESS Selecting HI_RES (OAUTH) still plays HI_RES_LOSSLESS Mar 30, 2024
@tehkillerbee
Copy link
Owner

Hires lossless playback should not be possible if oauth is used. I believe this is related to the bug I talked about in the other issue. You can check what is_pkce is set to in your session json file.

Try to delete your oauth session and sign in again and see if it helps.

@fmarzocca
Copy link
Author

fmarzocca commented Mar 30, 2024

Hires lossless playback should not be possible if oauth is used.

I know. That's why I opened the ticket.
This is in tidal-oauth.json:
"is_pkce": {"data": true}

Try to delete your oauth session and sign in again and see if it helps.

Again?.... :-( Can't I just edit the json and put false? Why it has true? I have regenerated it a week ago.

@fmarzocca
Copy link
Author

fmarzocca commented Mar 30, 2024

I have deleted oauth session and signed in again. Now the track is correctly reported as HI-RES/MQA, but in the session json there is always: is_pkce": {"data": true}

@tehkillerbee
Copy link
Owner

tehkillerbee commented Apr 2, 2024

Yep, I believe I have found the cause of this bug. A fix will be added in the next release of mopidy-tidal / tidalapi.

@fmarzocca
Copy link
Author

@tehkillerbee
Johannes, I am experiencing this problem every day. As I don't currently have the budget to buy a new DAC, but my converter works great with MQA, I would like to continue using my mopidy's playlists.

If you don't have planned to publish the new release soon, can I have the patch to apply locally?

@tehkillerbee
Copy link
Owner

tehkillerbee commented Apr 8, 2024

This is already fixed on the latest master.

You could always install that until the next release of tidalapi/ mopidy-tidal is ready.

Otherwise I'll try to get the next release ready ASAP

@fmarzocca
Copy link
Author

Ah, ok. Does it extends to tidalapi too?

@tehkillerbee
Copy link
Owner

The issue is caused by tidalapi but probably the best idea to update both mopidy-tidal and tidalapi.

@fmarzocca
Copy link
Author

Otherwise I'll try to get the next release ready ASAP

Thanks!

@fmarzocca
Copy link
Author

fmarzocca commented Apr 9, 2024

I am afraid it is still there...
With OAUTH and HI_RES, the track tidal:track:2579:77622430:77622437 plays at:
{"quality": "HI_RES_LOSSLESS", "codec": "flac"}

Should I have (again) to delete the session json file?

@fmarzocca
Copy link
Author

fmarzocca commented Apr 9, 2024

I have deleted the session file and now it looks OK. I will report any future issue.
Now the session oauth file correctly contains:
"is_pkce": {"data": false}

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

Successfully merging a pull request may close this issue.

2 participants