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

MQA, HIFI Playback #33

Closed
bikebandit101 opened this issue Feb 21, 2021 · 10 comments
Closed

MQA, HIFI Playback #33

bikebandit101 opened this issue Feb 21, 2021 · 10 comments

Comments

@bikebandit101
Copy link

Hey Tehkillerbee,
Looking the the master and dev fork seems like you & your team(?) are working on getting access for MQA track into Mopidy? Is there anything you need to help this endeavor along? I have very limited programming skills, but if there is something you need to help you, please let me know. This feature would be really great. Thank you for maintaining this Git
Kyle

@tehkillerbee
Copy link
Owner

tehkillerbee commented Feb 22, 2021

Hey @bikebandit101 Yes, the dev branch contains some experiments that I did while testing pull request #27 on Python 3. This pull request adds support for MQA / master quality playback in addition to other improvements. However, I have not merged it, as it is currently not working correctly with Python 3 and it requires an unsupported fork of the tidalapi with OAuth login support.

To answer your question, I would very much like to add support for MQA, but since it requires a different login method (OAuth), this feature would have to be added to the python-tidal/tidalAPI module first, before MQA support can be added to mopidy-tidal.

I think a lot of inspiration can be taken from #27 and the forks by the PR auther, as theygives an idea of the changes required for both mopidy-tidal (this plugin) and the fork of python-tidal / tidalapi:
https://github.com/quodrum-glas/mopidy-tidal
https://github.com/quodrum-glas/python-tidal

If the above changes can be made into a pull request that can be merged into the python-tidal module, then we can finally have both MQA and OAuth support in python-tidal. Most of the legwork has already been done by @quodrum-glas

I do not have a MQA subscription to test with at this point. If you have a subscription, you may be able to help by testing it, when more progress is made. :)

@bikebandit101
Copy link
Author

Hey @tehkillerbee ,
I cannot do my much programming, but that might be changing due to a job change and having to learn python. But, what I can offer at the moment, is getting you a MQA subscription to help the development process along. I would be more than happy to beta / alpha testing for the release. My overall goal in this is that Mopidy to support Tidal because [I think] Tidal is the best HiFi streaming service. And, I believe that having Mopidy run the server / MPD for control is a better solution than Volumio because with Rasberry OS still running this enables the Pi to perform other functions such as NAS drive for saving your high quality PCM / DSD files over the network, running a CD drive, and display. Exchange Volumio for Mopidy. Attached is my DAC development project. I am designing the power board to run the DAC, FiFo Pi (Ian Canada - check out his Github) , PI, HDDs, and an optical drive. If you're interested in one of these boards; once I have the PCB mades, I can send you a raw board.
DAC Technical Specifications.pdf

@tehkillerbee
Copy link
Owner

The ability to test with MQA is definitely necessary, for sure. But I think the main issue is still the OAuth login. So that need to be fixed as the first thing.

Your DAC project look very interesting. I would be glad to test a board. Since my main occupation is an EE, I do have the equipment to assemble it. I assume you collaborate with Ian Canada?

@bikebandit101
Copy link
Author

Sure, I will send you a board and BOM when I get it done. I didnt really collaborate with Ian Canada rather brought his parts. By training I am R&D engineer in Med Device.
I can reach out to Tidal about API access? Is there any in particular I should ask or is there a better way I can assist. Thanks!

@tehkillerbee
Copy link
Owner

I doubt that reaching out to Tidal would give us any more information. But there are a couple of instructions listed here: https://github.com/tidal-engineering/passport-tidal. There is also a discussion here regarding getting API access MusicPlayerDaemon/MPD#545
Quoting jonaski in the above thread: "I don't think Tidal would approve an open source project where the client id can be seen in the source code. And without the client id no-one can use it."

In any case, the tidalAPI has been reverse engineered by DerNuntius and others (see https://github.com/Fokka-Engineering/TIDAL/wiki for more information). I would probably look at https://github.com/Fokka-Engineering/TIDAL/wiki/auth-token for more information about the auth process and see if a similar approach can be implemented for the python-tidal plugin.

@tehkillerbee
Copy link
Owner

tehkillerbee commented Apr 17, 2021

FYI, the tidalapi has been updated with OAuth support in the latest 0.6.8 version. This makes it relatively straightforward to add support for High res playback. However, changes are needed in both tidalapi and this plugin to make it possible.

@bikebandit101
Copy link
Author

Hey @tehkillerbee I saw your post sorry I have gotten back sooner, I moved back home and got new job. Needless to say things have been crazy. I saw all the back forth about the update. Looks promising. Let me know if there is something you need to do for help. Thanks,

@hmelder
Copy link

hmelder commented May 8, 2021

I doubt that reaching out to Tidal would give us any more information. But there are a couple of instructions listed here: https://github.com/tidal-engineering/passport-tidal. There is also a discussion here regarding getting API access MusicPlayerDaemon/MPD#545
Quoting jonaski in the above thread: "I don't think Tidal would approve an open source project where the client id can be seen in the source code. And without the client id no-one can use it."

In any case, the tidalAPI has been reverse engineered by DerNuntius and others (see https://github.com/Fokka-Engineering/TIDAL/wiki for more information). I would probably look at https://github.com/Fokka-Engineering/TIDAL/wiki/auth-token for more information about the auth process and see if a similar approach can be implemented for the python-tidal plugin.

I use mopidy-tidal myself and really like it. I'm currently thinking about implementing the libopenTIDAL C library into a mopidy-tidal fork. A libopenTIDAL python wrapper (for a discord bot) is already in use so it's just a matter of rewriting tidal related calls in mopidy-tidal.

MQA reverse engineering is complex and difficult. Only binary blobs and shared libraries are currently capable of decoding/unfolding MQA flacs. I've looked at a couple of implementations, one in java and the other in C++. There is a TIDAL Connect server binary with all the certificates and MQA decoding but understanding disassembled code of an decoder is not an easy task.

This is an example of the bluesound shared library: https://code.videolan.org/mansr/mqa

@tehkillerbee
Copy link
Owner

tehkillerbee commented May 12, 2021

@DerNuntius Your suggestion about implementing a libopenTIDAL wrapper sounds like a very a good idea. This will also make the mopidy-tidal plugin less dependent on the python-tidal project, that is not always updated frequently.

Also, I should clarify my earlier messages, as I have been confusing MQA and HIFI quality naming used by Tidal.

While HIFI support has previously been added to a fork of mopidy-tidal as previously mentioned, MQA support has definitely not been available up to this point. HIFI quality is relatively easy to add support for, as far as I understand, but MQA is difficult and not something I have looked much into. I will probably start looking into HIFI support as the first thing.

@tehkillerbee tehkillerbee changed the title MQA Playback MQA, HIFI Playback May 12, 2021
@prietus
Copy link

prietus commented May 26, 2021

hi, I have MQA master subscription to tidal and I'd be very pleased to test anything you'd need.

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

No branches or pull requests

4 participants