Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


upmpdcli Tidal plugin
#11
@Snoil 

I had only a few moments this morning to follow up on your question.

First, I should have read your post more carefully. My step 1 is still necessary.

In principle, step 2 is not necessary because Tim bumped the version of upmpdcli built into moOde 9.1.0---but read on.

I just tried repeating only step 1 and steps 3-5 on a fresh moOde 9.1.0 install and discovered a couple of missing bits.

1. It turns out there is no /var/cache/upmpdcli directory in moOde as distributed. Conveniently, it gets created the first time a user enables the UPnP renderer (with owner/group upmpdcli:root).

I didn't notice that before because I was already experimenting with the Qobuz plugin so the directory was already present when I took up Tidal.

Solution: just enable the UPnP renderer if the directory doesn't exist yet.

2, Executing step 3 creates a new directory /var/cache/upmpdcli/tidal containing the file pkce.credentials.json, both with owner:group root:root). This ownership causes troubles, such as your UPnP Control Point throwing a "Service login or communication failure error" message when you try to connect to the Tidal service via your moOde player.

I can only assume that I discovered that during my early experiments and promptly forgot. Mea culpa.

Solution: from the command line, change the ownership of the directory and file. I chose to make them the same as their parent /var/cache/upmpdcli directory. Easily done recursively as follows. [ALERT: be sure you're at the correct directory!!!]


Code:
moode: /var/cache/upmpdcli $ sudo chown -R upmpdcli:root tidal

3. At this point, after completing my steps, I seemed to have Tidal available through the moOde UPnP MediaServer which gets started in the process. I can connect, browse, and select a track to play using my Connect Point (mconnectLite on my iPad for this test) BUT it fails to play. There's an internal error thrown in the upmpdcli plugin code. 

Sorry, I don't have time to chase this down until perhaps late today or tomorrow.

Meanwhile, many UPnP Connect Point apps also provide their own direct access to Tidal (and Qobuz). They act as proxy UPnP Media Servers for these services, so you can still play tracks while you wait.

Regards,
Kent
Reply
#12
(09-28-2024, 11:07 AM)Snoil Wrote: 2) /var/cache/upmpdcli does not contain a 'cache' folder it seems.
3) I'm not sure what logs you mean

thank you

Hello, I don't want to overlap with @TheOldPresbyope who is helping you.
The directory to look for json files in is in fact not /var/cache/upmpdcli, but /var/cache/upmpdcli/tidal

By logs I mean, the contents of the file /var/log/upmpdcli.log which you can read using 

Code:
cat /var/log/upmpdcli.log

or, via the systemd tools, using


Code:
journalctl -u upmpdcli


That said, please follow @TheOldPresbyope instruction which will most likely solve your issue! :-)
A good Last.fm scrobbler solution for Moode here, docker image here
Reply
#13
(09-28-2024, 02:40 PM)TheOldPresbyope Wrote:  I was already experimenting with the Qobuz plugin
Ah ok. I didnt see any recent complaints about qobuz other than my own one. whatever you like better working on is fine by me of course but I'll try try tidal when the time comes.
Sorry that I cant be of any help.

Thanks to both of you for your effort.
Reply
#14
Quick note-

I found some time to revisit this thread today. Turns out I have no problem with the upmpdcli Tidal plugin if I use OAUTH2 authentication. Everything Just Works™. 

I'll try again on a clean system to make sure I wasn't making a mistake with PKCE before I post problem details and update my first post.

Quick synopsis with OAUTH2 method on a clean moOde install:

1. Enable your moOde player's "UPnP Client for MPD" renderer if you haven't already done so.

2. From the command line on your moOde player, Install the Python tidalapi module (Ignore the warning message you get when it's complete). 


Code:
sudo python3 -m pip install tidalapi==0.7.6 --break-system-packages


2. From the command line, ask to get OAUTH2 credentials (Note: unlike in my first post, this will now store the result with the correct ownership)


Code:
sudo -u upmpdcli python3 /usr/share/upmpdcli/cdplugins/tidal/get_credentials.py -t OAUTH2 -f /var/cache/upmpdcli/tidal/credentials.json


The response will be something like


Code:
Authentication type is [OAUTH2]
Visit https://link.tidal.com/XXXXX to log in, the code will expire in 300 seconds


Keep the comand-line terminal open (to see the followup) and use your web browser to visit the URL. You'll have to log into your Tidal account. Follow the prompts until you get to a "Your device was successfully linked to your account" screen. You're done with the browser.

Go back to the command line. You'll see a long response which begins with

Code:
Writing the credentials to file [/var/cache/upmpdcli/tidal/credentials.json] ...
Credentials written to [/var/cache/upmpdcli/tidal/credentials.json]
Credentials file for type [OAUTH2] in json format:
...


You may wish to save the response in its entirety (it lists the credentials in two different forms in case you need to resurrect them later) but at this point you're done. Close the command line session.

I'm listening to a classic Wayne Shorter session I found on Tidal as I type this (ah, nostalgia). Using mConnectLite with my moOde player's UPnP-mediaserver selected as the Local Server, moOde UPnP selected as the "Play to" renderer.

Regards,
Kent
PS - if you have more than one moOde player in operation, you need do this on only one of them. It can be the UPnP mediaserver for any of them.
Reply
#15
This is very interesting!
I am an total noob in programming but I am able to copy paste commands in command line.
If I would copy paste and run all the code lines in your topic it should work?

Kind regards,
Reply
#16
(10-06-2024, 03:27 PM)Supersurfer Wrote: This is very interesting!
I am an total noob in programming but I am able to copy paste commands in command line.
If I would copy paste and run all the code lines in your topic it should work?

Kind regards,

Yes, first the command in step 1; after it runs to completion, the command in step 2. I do this via an ssh login from the terminal on another computer but it can also be done via moOde’s built-in Web SSH terminal. 

I notice I neglected to say (in my post #14)  you have to restart the UPnP renderer when you’re done.

Regards,
Kent
Reply
#17
I unfortunately do not get past the second command line? Below is what I received after entering "sudo -u upmpdcli python3 /usr/share/upmpdcli/cdplugins/tidal/get_credentials.py -t OAUTH2 -f /var/cache/upmpdcli/tidal/credentials.json":

Traceback (most recent call last):
File "/usr/share/upmpdcli/cdplugins/tidal/get_credentials.py", line 18, in <module>
import tidalapi
ModuleNotFoundError: No module named 'tidalapi'
Reply
#18
Nevermind; similar to other facets of getting my system to play well with Moode, it took several attempts before it went thru.
Reply
#19
I'm a total noob about all of this, but I want to understand better what is it for:
@TheOldPresbyope: even without this procedure, I can stream Tidal from mConnect on a tablet to my Moode UPNP Render.
What does this procedure adds?
Reply
#20
(10-17-2024, 07:07 PM)Daksha Wrote: I'm a total noob about all of this, but I want to understand better what is it for:
@TheOldPresbyope: even without this procedure, I can stream Tidal from mConnect on a tablet to my Moode UPNP Render.
What does this procedure adds?

Sure, you can use certain UPnP Control Points (such as mConnect, BubbleUPnP, etc.) which provide built-in support for Tidal (and often Qobuz, as well) with vanilla moOde.

What this procedure adds is the ability to use Tidal as a source even if you are using UPnP Control Points which don't have the built-in support, of which there are many, The same is true for Qobuz because of the Qobuz plugin already available in moOde.

There are certain technical differences in operation as well, but there's no point in discussing those here.

Regards,
Kent
Reply


Forum Jump: