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

Tidal - Radio mode sometimes fails #3437

Open
1 task done
lor74 opened this issue Jan 11, 2025 · 12 comments
Open
1 task done

Tidal - Radio mode sometimes fails #3437

lor74 opened this issue Jan 11, 2025 · 12 comments
Assignees
Labels

Comments

@lor74
Copy link

lor74 commented Jan 11, 2025

What version of Music Assistant has the issue?

2.4.0b12

What version of the Home Assistant Integration have you got installed?

official integration

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

  • Yes

The problem

Using radio mode sometimes i got this error

2025-01-11 09:22:34.035 ERROR (MainThread) [music_assistant.webserver] Error handling message: CommandMessage(message_id='8484db1c1c094fe18ecb03e159459448', command='player_queues/play_media', args={'queue_id': 'apac7f3ee81fe7', 'media': ['library://artist/331'], 'option': 'play', 'radio_mode': True, 'start_item': None})
Traceback (most recent call last):
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/webserver.py", line 361, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/player_queues.py", line 461, in play_media
    raise MediaNotFoundError("No playable items found")

this request fails

action: music_assistant.play_media
data:
  media_id: The White Buffalo
  media_type: artist
  radio_mode: true
target:
  device_id: caba6b5a7a109e62be346484957a84f9

Changing the artist it works. As you can see from the logs using The Beatles radio morks fine.

How to reproduce

Change the radio mode artist media_id

action: music_assistant.play_media
data:
  media_id: The White Buffalo
  media_type: artist
  radio_mode: true
target:
  device_id: caba6b5a7a109e62be346484957a84f9

Music Providers

TIDAL
I have other two music providers
SPOTIFY (radio mode is no more supported #3241)
QUOBUZ (radio mode not supported).

I need also to disable SPOTIFY and QUOBUZ in order to have radio mode partially working.
If the another provider was enabled I got this error, track retreived by tidal but then searched on quobuz

2025-01-10 17:30:56.557 INFO (MainThread) [music_assistant.player_queues] Fetching radio tracks for queue airport express di lorenzo (Airplay) based on: Dire Straits
2025-01-10 17:30:59.001 DEBUG (MainThread) [music_assistant.qobuz] Handling GET request to track/get
2025-01-10 17:31:01.493 DEBUG (MainThread) [music_assistant.qobuz] Handling GET request to catalog/search
2025-01-10 17:31:03.682 DEBUG (ThreadPoolExecutor-0_6) [tidalapi.request] request: https://api.tidal.com/v1/sessions?limit=10000
2025-01-10 17:31:03.809 DEBUG (ThreadPoolExecutor-0_6) [tidalapi.request] request: https://api.tidal.com/v1/users/202192189?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=10000
2025-01-10 17:31:04.057 DEBUG (ThreadPoolExecutor-0_3) [tidalapi.request] request: https://api.tidal.com/v1/search?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=25&query=Dire+Straits+-+Sultans+Of+Swing&offset=0&types=tracks
2025-01-10 17:31:04.075 DEBUG (MainThread) [music_assistant.music.track] Trying to match track Sultans Of Swing on provider Qobuz
2025-01-10 17:31:04.125 DEBUG (MainThread) [music_assistant.qobuz] Handling GET request to track/get
2025-01-10 17:31:04.416 DEBUG (MainThread) [music_assistant.qobuz] Handling GET request to track/get
2025-01-10 17:31:04.693 DEBUG (MainThread) [music_assistant.qobuz] Handling GET request to track/get
2025-01-10 17:31:04.973 ERROR (MainThread) [music_assistant.webserver] Error handling message: CommandMessage(message_id='b9df77298c7d4219b39f4d9676ddcd2e', command='player_queues/play_media', args={'queue_id': 'apac7f3ee81fe7', 'media': ['library://artist/321'], 'option': None, 'radio_mode': True, 'start_item': None})
Traceback (most recent call last):
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/webserver.py", line 361, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/player_queues.py", line 451, in play_media
    media_items = await self._get_radio_tracks(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/player_queues.py", line 1644, in _get_radio_tracks
    for track in await self.mass.music.tracks.similar_tracks(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/tracks.py", line 314, in similar_tracks
    await self.match_providers(ref_item)
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/tracks.py", line 372, in match_providers
    await self.add_provider_mapping(ref_track.item_id, provider_mapping)
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/base.py", line 580, in add_provider_mapping
    db_id = int(item_id)  # ensure integer
            ^^^^^^^^^^^^
ValueError: invalid literal for int() with base 10: '37Tmv4NnfQeb0ZgUC4fOJj'

Player Providers

Airplay

Full log output

music-assistant.log

Additional information

It seems that the issue was related to library.
If the artist was present in the library (as an example The White Buffalo - library://artist/331) radio mode fails.
If I use an artist not present in library radio mode works (diabling the other provider).

What version of Home Assistant Core are your running

2025.1.2

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Raspberry Pi

@lor74 lor74 added the triage label Jan 11, 2025
@OzGav
Copy link
Contributor

OzGav commented Jan 11, 2025

What do you see in PROVIDER DETAILS for the track?

edit: actually artist in your case

@lor74
Copy link
Author

lor74 commented Jan 11, 2025

It was grayed....
I have forced the update for this artist and now radio mode for example with The White Buffalo works.
How can I update the library adding also Tidal?
If I click here... nothing happens

Screenshot 2025-01-11 alle 13 52 52

After the library update can I also re-enable the other provider?
Thanks.

@OzGav
Copy link
Contributor

OzGav commented Jan 11, 2025

I don’t understand the questions. You should have all the providers you want to use added. MA will then add anything you have favourited in those providers to the library.

@lor74
Copy link
Author

lor74 commented Jan 12, 2025

Ok, but when I have added the new provider Tidal this update wasn't done automatically. For this reason I guess the radio mode fails as reported in the logs.
Now it seems working... I need a while to test.
Thanks

@OzGav
Copy link
Contributor

OzGav commented Jan 12, 2025

For any item it fails on you need to look at the PROVIDER DETAILS for that item. If the item isn’t mapped to a provider that supports radio mode then it will fail. That is expected.

@lor74
Copy link
Author

lor74 commented Jan 12, 2025

Ok in this case how can I map the item on the new provided? It should be done automatically when a new provider is added to MA.

In any case this item is mapped

Screenshot 2025-01-12 alle 10 08 48

but radio mode still fails

2025-01-12 10:01:41.236 INFO (MainThread) [music_assistant.player_queues] Fetching radio tracks for queue airport express di lorenzo (Airplay) based on: The Devil Makes Three
2025-01-12 10:01:41.374 DEBUG (MainThread) [music_assistant.qobuz] Handling GET request to track/get
2025-01-12 10:01:43.631 DEBUG (MainThread) [music_assistant.qobuz] Handling GET request to track/get
2025-01-12 10:01:43.840 DEBUG (MainThread) [music_assistant.qobuz] Handling GET request to track/get
2025-01-12 10:01:44.085 DEBUG (MainThread) [music_assistant.qobuz] Handling GET request to catalog/search
2025-01-12 10:01:44.263 DEBUG (ThreadPoolExecutor-0_3) [tidalapi.request] request: https://api.tidal.com/v1/sessions?limit=10000
2025-01-12 10:01:44.391 DEBUG (ThreadPoolExecutor-0_3) [tidalapi.request] request: https://api.tidal.com/v1/users/202192189?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=10000
2025-01-12 10:01:44.621 DEBUG (ThreadPoolExecutor-0_14) [tidalapi.request] request: https://api.tidal.com/v1/search?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=25&query=The+Devil+Makes+Three+-+Pray+for+Rain&offset=0&types=tracks
2025-01-12 10:01:46.681 DEBUG (MainThread) [music_assistant.music.track] Trying to match track Pray for Rain on provider Tidal
2025-01-12 10:01:46.912 DEBUG (ThreadPoolExecutor-0_0) [tidalapi.request] request: https://api.tidal.com/v1/sessions?limit=10000
2025-01-12 10:01:47.048 DEBUG (ThreadPoolExecutor-0_0) [tidalapi.request] request: https://api.tidal.com/v1/users/202192189?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=10000
2025-01-12 10:01:47.188 DEBUG (ThreadPoolExecutor-0_11) [tidalapi.request] request: https://api.tidal.com/v1/tracks/334953160?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=10000
2025-01-12 10:01:47.327 DEBUG (ThreadPoolExecutor-0_6) [tidalapi.request] request: https://api.tidal.com/v1/tracks/334953160/lyrics?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=10000
2025-01-12 10:01:47.539 DEBUG (ThreadPoolExecutor-0_8) [tidalapi.request] request: https://api.tidal.com/v1/sessions?limit=10000
2025-01-12 10:01:47.668 DEBUG (ThreadPoolExecutor-0_8) [tidalapi.request] request: https://api.tidal.com/v1/users/202192189?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=10000
2025-01-12 10:01:47.808 DEBUG (ThreadPoolExecutor-0_1) [tidalapi.request] request: https://api.tidal.com/v1/tracks/111681889?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=10000
2025-01-12 10:01:47.994 DEBUG (ThreadPoolExecutor-0_9) [tidalapi.request] request: https://api.tidal.com/v1/tracks/111681889/lyrics?sessionId=2c1e83be-a0f9-4312-a800-9c8ec1249b18&countryCode=IT&limit=10000
2025-01-12 10:01:48.032 ERROR (MainThread) [music_assistant.webserver] Error handling message: CommandMessage(message_id='28d2b1134194481d937772acd4c7c710', command='player_queues/play_media', args={'queue_id': 'apac7f3ee81fe7', 'media': ['library://artist/327'], 'option': 'play', 'radio_mode': True, 'start_item': None})
Traceback (most recent call last):
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/webserver.py", line 361, in _run_handler
    result = await result
             ^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/player_queues.py", line 451, in play_media
    media_items = await self._get_radio_tracks(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/player_queues.py", line 1644, in _get_radio_tracks
    for track in await self.mass.music.tracks.similar_tracks(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/tracks.py", line 314, in similar_tracks
    await self.match_providers(ref_item)
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/tracks.py", line 372, in match_providers
    await self.add_provider_mapping(ref_track.item_id, provider_mapping)
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/base.py", line 581, in add_provider_mapping
    library_item = await self.get_library_item(db_id)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/venv/lib/python3.12/site-packages/music_assistant/controllers/media/base.py", line 389, in get_library_item
    raise MediaNotFoundError(msg)
music_assistant_models.errors.MediaNotFoundError: track not found in library: 243762007

Why it starts with Qobuz?

music-assistant.log

@OzGav
Copy link
Contributor

OzGav commented Jan 12, 2025

Has the tidal mapping changed? Press the tidal entry in the provider details and see if that takes you to the correct item

@lor74
Copy link
Author

lor74 commented Jan 12, 2025

Yes it's correct

Screenshot 2025-01-12 alle 11 12 25

@OzGav
Copy link
Contributor

OzGav commented Jan 12, 2025

Ok let’s see if @jozefKruszynski has any thoughts?

@jozefKruszynski
Copy link
Contributor

Not really sure what's happening with the qobuz search issue, but the tidal error you get in the final logs you posted is clearly showing that you don't have a specific track in your library.
This one in particular:
image

@lor74
Copy link
Author

lor74 commented Jan 12, 2025

Hi @jozefKruszynski, but radio mode get a list of track from tidal... is not mandatory that the item is in the library right? He should retrieve the streming an play the content... the same as a song/artist serach.

@jozefKruszynski
Copy link
Contributor

Hi @jozefKruszynski, but radio mode get a list of track from tidal... is not mandatory that the item is in the library right? He should retrieve the streming an play the content... the same as a song/artist serach.

Not sure what changed here, as this is an error coming from the core not from the tidal provider. This could be related to recent changes we made for streaming providers, but I'll have to double check.

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

No branches or pull requests

3 participants