Thank you for your donation!


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


Thread Closed 
Upcoming moOde 9.0.0 (Bookworm)
(05-14-2024, 09:04 PM)Tim Curtis Wrote: Wow that tidal plugin is kind of messy. Can you post the credentials.json file just so I know what it looks like, and do I understand correctly that the creds only get written to this file for OAUTH2 but for PKCE they need to be placed in upmpdcli.conf?

Everything about TIDAL credentials is messy. Sigh.

There are two choices for obtaining and storing credentials.

1. enter them explicitly in upmpdcli.conf

Where do they come from in this case? One runs, from the moOde command line, the get_credentials.py which is part of the python-tidal package and copy/pastes the returned values into upmpdcli.conf. See Jean-Francois's instructions. 

Note that the Python script is meant to be run manually: it outputs a temporary TIDAL URL and pauses. The user copies the URL into a web browser (on some other host in our case) and TIDAL returns the credentials to the script, which prints them out and ends. Hard to automate because the user has to log their account's username/password into the TIDAL webpage (or already be logged into TIDAL).

Note also that the two tidal tokens returned by the script are each hundreds of alphanumeric characters long!

I've only done this for OAUTH2 and not PKCE authentication and I still screwed up somewhere in the copy/pasting. PKCE requires yet another step.

2. have TIDAL download the credentials as a JSON file to the moOde player and do no editing of upmpdcli.conf other then uncommenting the tidaluser line. The python-tidal code finds and uses this JSON file automagically. Again, see J-F's insructions.

Note that this method still requires the user to copy and enter a temporary URL into a web browser. In this case, the URL is written to the journal on first attempt to access the TIDAL section of the moOde UPnP Media Server. I suppose we could configure upmpdcli to write its log to a file and grab the URL from there but a web browser is still required.


This method worked for me without a hitch.

Candidly, for most users, I think a typical moOde config screen is going to be a challenge if method 1 is used to obtain the credentials. The second method seems marginally easier to adapt, at least conceptually.

I'm getting too old for this stuff.

Regards,
Kent
(05-14-2024, 09:49 PM)TheOldPresbyope Wrote:
(05-14-2024, 09:04 PM)Tim Curtis Wrote: Wow that tidal plugin is kind of messy. Can you post the credentials.json file just so I know what it looks like, and do I understand correctly that the creds only get written to this file for OAUTH2 but for PKCE they need to be placed in upmpdcli.conf?

Everything about TIDAL credentials is messy. Sigh.

There are two choices for obtaining and storing credentials.

1. enter them explicitly in upmpdcli.conf

Where do they come from in this case? One runs, from the moOde command line, the get_credentials.py which is part of the python-tidal package and copy/pastes the returned values into upmpdcli.conf. See Jean-Francois's instructions. 

Note that the Python script is meant to be run manually: it outputs a temporary TIDAL URL and pauses. The user copies the URL into a web browser (on some other host in our case) and TIDAL returns the credentials to the script, which prints them out and ends. Hard to automate because the user has to log their account's username/password into the TIDAL webpage (or already be logged into TIDAL).

Note also that the two tidal tokens returned by the script are each hundreds of alphanumeric characters long!

I've only done this for OAUTH2 and not PKCE authentication and I still screwed up somewhere in the copy/pasting. PKCE requires yet another step.

2. have TIDAL download the credentials as a JSON file to the moOde player and do no editing of upmpdcli.conf other then uncommenting the tidaluser line. The python-tidal code finds and uses this JSON file automagically. Again, see J-F's insructions.

Note that this method still requires the user to copy and enter a temporary URL into a web browser. In this case, the URL is written to the journal on first attempt to access the TIDAL section of the moOde UPnP Media Server. I suppose we could configure upmpdcli to write its log to a file and grab the URL from there but a web browser is still required.


This method worked for me without a hitch.

Candidly, for most users, I think a typical moOde config screen is going to be a challenge if method 1 is used to obtain the credentials. The second method seems marginally easier to adapt, at least conceptually.

I'm getting too old for this stuff.

Regards,
Kent

Right. Not possible to make it "user friendly". 

I'm still inclined to leave the plugin in the build tho.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
(05-13-2024, 04:37 PM)TheOldPresbyope Wrote: OK, so it took more than an hour.

Re upmpdcli/TIDAL - I now have it working against mconnectLite on my iPad.

FIrst hurdle - tried to install the Python module

Code:
rho@m900pre6c:~ $ sudo python -m pip install tidalapi==0.7.6
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
   python3-xyz, where xyz is the package you are trying to
   install.
   
   If you wish to install a non-Debian-packaged Python package,
   create a virtual environment using python3 -m venv path/to/venv.
   Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
   sure you have python3-full installed.
   
   For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

So I rook the bull-in-the-china-shop approach and passed the --break-system-packages option on the second try. Seems to have installed the package but again I get warnings of possible breakage and suggestion to use a virtual environment.

Second hurdle - grabbing the necessary credentials and stuffing them in upmpdcli.conf

Oof, the first method looks laborious but would be useful, IMO, because you can see explicitly what you're doing (and see caveat, below).

I chose, instead, to follow Jean-Francois's "Alternatively, for OATH2 mode..." method. 

Opened a terminal on the moOde player (m900pre6c) and ran journalctl -f to watch the messages. Started mconnectLite on the iPad. Chose the m900pre6c UPnP mediaserver and player in Browser and Play to, respectively. Browsed down to the Tidal folder. Up pops the following upmpdcli messages in the journal (sans the May 13 11:50:15 m900pre6c upmpdcli[4927]: preface to each message)


Code:
CMDTALK: tidal-app.py: Tidal Plugin Release 0.3.0
CMDTALK: tidal-app.py: enable_read_stream_metadata=[False]
CMDTALK: tidal-app.py: enable_assume_bitdepth=[True]
tidal: getcachedir: me: upmpdcli
CMDTALK: tidal-app.py: Cache dir for [tidal] is [/var/cache/upmpdcli/tidal]
CMDTALK: tidal-app.py: DB version for [tidal] is [12]
CMDTALK: tidal-app.py: browse: path: ----
CMDTALK: tidal-app.py: browse: path_list: --['0$tidal$']-- last: --0$tidal$--
CMDTALK: tidal-app.py: Loading credentials ...
tidal: getcachedir: me: upmpdcli
CMDTALK: tidal-app.py: get_credentials_from_config_or_files pkce file is not available
tidal: getcachedir: me: upmpdcli
CMDTALK: tidal-app.py: File /var/cache/upmpdcli/tidal/credentials.json not found
tidal: getcachedir: me: upmpdcli
CMDTALK: tidal-app.py: File /var/cache/upmpdcli/tidal/pkce.credentials.json not found
CMDTALK: tidal-app.py: PKCE credentials not statically available
CMDTALK: tidal-app.py: OAUTH2 credentials not statically available
CMDTALK: tidal-app.py: Visit https://link.tidal.com/XXXXX to log in, the code will expire in 300 seconds


Here I've obscured the actual 5-character code in the link.

Immediately opened the link on a web browser on my laptop, logged into the app with my TIDAL credentials, and got a message back in the browser that my device had been successfully linked to my accound.

Back to mconnectLite. The TIDAL folder is now fully populated and I'm listening to The Poll Winners: Barney Kessel with Shelly Manne and Ray Brown, a jazz album I cherished back when I was a teenager. The moOde player seems a little slow to respond when I start a    track but it's now playing and the WebUI is displaying the coverart and track info. Seems to display only the currently playing track and not the album track list but I haven't delved very deeply.

Caveat: The method I chose creates OATH2 credentials, whiich limits access to 24bit/48KHz files (which is fine for me at this stage in my life!). To create PKCE credentials instead, and hence be able to access 24bit/192KHz files, requires using the first method with extra steps. It's all explained in the referenced documentation.

Regards,
Kent

ETA -

1. I'm not sure it was needed using the second authentication method, but I thought I had seen a note somewhere that I had to uncomment the line #tidaluser = tidal in upmpdcli.conf in order for the plugin to start, so I did before I did anything else. When I get the chance, I'll repeat the process on another player without this initial step.

2. Using the second method results in the authentication credentials being stored in /var/cache/upmpdcli/tidal/credentials.json
rather than in upmpdcli.conf.

Hello all, I am new here. I also tried to setup Tidal and had similar issues as reported above.

Reading this, I also setup mconnectlite on my iPad and saw that indeed Tidal works as described above. However, when doing that, aren’t we just using mconnectlite to access Tidal and just stream it via upnp to the Pi instead of Moode on the Pi directly accessing Tidal?

Best regards

Gertjan
@gjh_in_the_moode 

This is a moOde development thread, not a support thread. (see my earlier post).

However, since you asked, certain apps such as mconnectLite, mconnect, BubbleUPnP, and BubbleDS can access certain commercial streaming music services (Qobuz and TIDAL in particiular) directly. They refer to them variously as  "Internet Music" or "Cloud" library. In this mode, moOde is strictly the UPnP Rendererer and no upmpdcli plugin is required.

The upmpdcli-tidal plugin allows moOde itself to act as a proxy UPnP Media Server for TIDAL (in the same way as the upmpdcli-qobuz plugin behavies for Qobuz). In this mode, any UPnP Control Point, not just the mconnect or Bubble products can access the commercal streaming service.via the moOde UPnP mediaserver, aka a local UPnP Media Server. There are other distinctions but this isn't the thread to discuss them in.

Regards,
Kent
Re upmpdcli/TIDAL

Part four.

Turns out I posted my issue to the wrong repo and was kindly redirected to J-F's upmpdcli repo. I got an immediate response from Giovanni Fulco who authored the plugin and, almost immediately after, a hotfix which works!

@Tim Curtis

I'd wait until he and J-F have decided how to fold the hotfix into the upmpdcli repo before building the plugin into moOde 9 (not to be confused with Plan 9 from either Outer Space or Bell Labs)..

Regards,
Kent
(05-15-2024, 01:36 PM)TheOldPresbyope Wrote: Re upmpdcli/TIDAL

Part four.

Turns out I posted my issue to the wrong repo and was kindly redirected to J-F's upmpdcli repo. I got an immediate response from Giovanni Fulco who authored the plugin and, almost immediately after, a hotfix which works!

@Tim Curtis

I'd wait until he and J-F have decided how to fold the hotfix into the upmpdcli repo before building the plugin into moOde 9 (not to be confused with Plan 9 from either Outer Space or Bell Labs)..

Regards,
Kent

Got it. We can always add the plugin later via in-place update after 9.0.0 ships.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Just an FYI, testing the multiroom feature. It seems that Bookworm network stack and "other stuff" allows tx/rx buffer and Opus frame size to be lowered.
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
I found out today that the rotary encoder is not working. No problems in 8.3.9.
(05-17-2024, 05:03 PM)Patolog1964 Wrote: I found out today that the rotary encoder is not working.  No problems in 8.3.9.

Prolly the same issue causing the Boss2 OLED python script to fail

Try

sudo apt -y install python3-rpi-lgpio
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Thank you. Everything is working now.


Forum Jump: