GioF71 / upmpdcli-docker

Easily run upmpdcli with Docker. Renderer/Library Mode, Streaming with Tidal HiRes, Qobuz, SubSonic, Navidrome, Lightweight Music Server, Gonic, HRA, Radio Paradise, Mother Earth Radio, Radio-Browser
Apache License 2.0
38 stars 4 forks source link

[BUG] No devices via upnp #312

Closed kondas closed 3 months ago

kondas commented 1 year ago

It was my bad

GioF71 commented 1 year ago

It might still be useful if you want to report what happened, so maybe I can see if I can improve the documentation accordingly. Thank you

kondas commented 1 year ago

The example configuration for Tidal has RENDERER_MODE=NONE, so the instance is not detected as an upnp render device. It seems like the plugin is still not working (but it is indicated in the documentation in the doc folder) so this way novice users like me are confused since no devices appear either in Tidal or UPnP controllers like mconnect which is the advised mode to playback from Tidal without the plugin. If no Tidal credentials are given, there is no log entries with link also, but as the plugin is broken i guess that is normal.

One thing where there i see some room for improvement, is to hard-fail the entrypoint script when ie. Tidal is requested with feature flag, but it can't be started.

I am happy to contribute a proposal to fix these in a PR.

GioF71 commented 1 year ago

The example configuration for Tidal has RENDERER_MODE=NONE, so the instance is not detected as an upnp render device.

Yes, this way you get a media server on your network, which you can use with any upnp renderer, not necessarily upmpdcli/mpd. I understand that this can be confusing. At least I could add a comment saying that the configuration only creates a media server, and will not create a renderer. I might also add a combination of the two. But as you see, the combinations are way too many to publish. It would become even more confusing. I believe that a source of confusion is that upmpdcli can act as a media server and as a renderer, and can also act as both.

I ask you a question here: where do people usually want to run their media servers? On the same player device? If so, combined configurations might make sense. But again, the media server would not be available if the "combined" device, which runs both, is not running: you would not be able to use the media server and stream to some other upnp-enabled device.

It seems like the plugin is still not working (but it is indicated in the documentation in the doc folder) so this way novice users like me are confused since no devices appear either in Tidal or UPnP controllers like mconnect which is the advised mode to playback from Tidal without the plugin. If no Tidal credentials are given, there is no log entries with link also, but as the plugin is broken i guess that is normal.

One thing where there i see some room for improvement, is to hard-fail the entrypoint script when ie. Tidal is requested with feature flag, but it can't be started.

  • silent fail example 1: current latest images doesn't contain any tidal plugin, so if download not enabled there is no way to start

The Tidal plugin should work with the latest images without need for using the download stategy. Maybe you would not have the latest release but the upstream one should be working. Does it not work for you? Maybe ensure the image is updated. There have been wrong versions of the doc in the past where the suggested branch was not correct, because I started with 'latest', then I had to specify 'latest-subsonic', 'latest-tidal', and sometimes I wrote 'subsonic-latest' instead. But it should be correct now, I will check again, of course feel free to report me where it's wrong. Of course if the git clone fails for any reason, the functionality might be broken. I might improved that part of that script, so that it won't fail silently as you say.

  • silent fail example 2: git clone error, this can happen when the branch is not provided, or invalid. (or no git in image like the renderer only images but that is an invalid use case i guess)

Yes, totally right here. The reason is that upmpdcli has a relatively slow release cycle, so I implemented this method, in accordance with the author, so that users can access the latest version of a plugin without having to wait for the next release of upmpdcli. How did you see this method fail mostly? Wrong branch names, or what else? Again, proper error management is needed in order to avoid these silent failures.

I am happy to contribute a proposal to fix these in a PR.

That is very much appreciated.

kondas commented 1 year ago

Yes, this way you get a media server on your network, which you can use with any upnp renderer, not necessarily upmpdcli/mpd. I understand that this can be confusing. At least I could add a comment saying that the configuration only creates a media server, and will not create a renderer. I might also add a combination of the two. But as you see, the combinations are way too many to publish. It would become even more confusing. I believe that a source of confusion is that upmpdcli can act as a media server and as a renderer, and can also act as both.

This is understandable and evident if somebody is familiar with upnp media / dlna, but i wasn't, and it took a while to get a tiny grasp of what is happening, and determine what i want is a upnp renderer. I didn't know about this ecosystem anything at all, except "upnp" it is a security hole for configuring port forwarding on my router. I think the Tidal connect functionality will attract similar novices in this area, so this could be adressed as extending the documentation in the Tidal part.

I ask you a question here: where do people usually want to run their media servers? On the same player device? If so, combined configurations might make sense. But again, the media server would not be available if the "combined" device, which runs both, is not running: you would not be able to use the media server and stream to some other upnp-enabled device.

It is sensible to make these separate rendering and media server, and the current configuration examples are good regarding this. It is only confisung for novice people who don't now anything, and would like to get Tidal connect funcitonality on amd64. And i think many users will be attracted by this solution, so improvement in the Tidal connect documentation will be helpful

To summarize, i came to find this project as a possibility to use as a tidal-connect "agent". Followed the docs, but no playback device in Tidal, nor log messages regarding tidal account linkage. So it must be that i have to provide those, ran get-credentials, and provided them. Still no playback device. I don't know what i'm doing, upnp is confusing, but the docs say something about upnp control apps? mconnect looks fine and should do what i want. But there are no upnp devices appearing in mconnect also, what is happening here? And the rabbit hole continues. :)

The Tidal plugin should work with the latest images without need for using the download stategy. Maybe you would not have the latest release but the upstream one should be working. Does it not work for you? Maybe ensure the image is updated. There have been wrong versions of the doc in the past where the suggested branch was not correct, because I started with 'latest', then I had to specify 'latest-subsonic', 'latest-tidal', and sometimes I wrote 'subsonic-latest' instead. But it should be correct now, I will check again, of course feel free to report me where it's wrong. Of course if the git clone fails for any reason, the functionality might be broken. I might improved that part of that script, so that it won't fail silently as you say.

It does not, but maybe i'm mising out something here? i'm using giof71/upmpdcli:latest sha256:209545f757630332d06b9ffc34a60dc37e14bd9bf87eea1f4ab33e5fc8f80614 build timestamp: 2023-11-04T19:37:49.290950108Z

[root@srv music]# docker exec  music-upmpd-1 ls -la /usr/share/upmpdcli/cdplugins/
total 52
drwxr-xr-x 13 root root 4096 Nov  4 19:37 .
drwxr-xr-x  6 root root 4096 Nov  4 19:36 ..
drwxr-xr-x  2 root root 4096 Nov  4 19:37 bbc
drwxr-xr-x  2 root root 4096 Nov  4 19:37 deezer
drwxr-xr-x  2 root root 4096 Nov  4 19:37 hra
drwxr-xr-x  2 root root 4096 Nov  4 19:37 mother-earth-radio
drwxr-xr-x  2 root root 4096 Nov  4 19:36 pycommon
drwxr-xr-x  3 root root 4096 Nov  4 19:37 qobuz
drwxr-xr-x  2 root root 4096 Nov  4 19:37 radio-browser
drwxr-xr-x  2 root root 4096 Nov  4 19:37 radio-paradise
drwxr-xr-x  2 root root 4096 Nov  4 19:37 subsonic
drwxr-xr-x  2 root root 4096 Nov  4 19:37 upradios
drwxr-xr-x  3 root root 4096 Nov  4 19:37 uprcl

Downloading the plugin from tidal-latest works, the plugin starts, but no links appear if no credentials provided. Also no render device appearing in Tidal app, with/without credentials. No indication in logs from plugin that anything is wrong

...How did you see this method fail mostly? Wrong branch names, or what else? Again, proper error management is needed in order to avoid these silent failures.

GioF71 commented 1 year ago

You are right, the tidal package is missing. There is a new release building right now. Thank you!! After this I try to reply to your other comments.

kondas commented 1 year ago

I would love to contribute something to this project, so if You think it can waita few days i can work on making the entrypoint script more robust!

GioF71 commented 1 year ago

Yes, this way you get a media server on your network, which you can use with any upnp renderer, not necessarily upmpdcli/mpd. I understand that this can be confusing. At least I could add a comment saying that the configuration only creates a media server, and will not create a renderer. I might also add a combination of the two. But as you see, the combinations are way too many to publish. It would become even more confusing. I believe that a source of confusion is that upmpdcli can act as a media server and as a renderer, and can also act as both.

This is understandable and evident if somebody is familiar with upnp media / dlna, but i wasn't, and it took a while to get a tiny grasp of what is happening, and determine what i want is a upnp renderer. I didn't know about this ecosystem anything at all, except "upnp" it is a security hole for configuring port forwarding on my router. I think the Tidal connect functionality will attract similar novices in this area, so this could be adressed as extending the documentation in the Tidal part.

Maybe I understood incorrectly, but you don't need to enable port forwarding on your router in order to use upnp media servers and renderers. A media server and a upnp renderer are usually supposed to be used inside your network, not outside of its boundaries.

About security, yes in general upnp is not secure. Many current hi-fi streamer devices (say the bluesound node) can use other media servers but usually are not available as upnp renderer nor make their own library available as a new media server afaik.

kondas commented 1 year ago

I have more background in networking, than media streaming, and i only encountered UPnP in that scenario. In a nutshell, many routers expose functions to network clients via UPnP, to make dynamic configuration (for example setting up WAN->LAN port-forwarding) possible directly by the clients. Many routers have this funcionality switched on by default, which poses a huge security risk. I did not mean security problems with this "other part of upnp world"

I still have a hard time understanding the upnp in the media scenario, and basicly don't have a clue about what is happening under the hood, who are the actors, and who does what, althrough I'm very happy that i have some possibility to play back Tidal content on my diy "media server" , and that MQA led is bright on the DAC during this. Oh and the best part is this diy media-server is only running a pulseaudio container locally, and every other component can be placed on my main server which has adequate resources

GioF71 commented 1 year ago

Awesome to hear you are happy. About upnp, there is an alternative with mopidy. The user who built the python api library I use for the tidal plugin for upmpdcli has built a plugin for mopidy. Mopidy is a web server, must be installed on the player itself, I have tried it and I like it very much. I generally prefer the upnp solution because I have more than one player, but again, that project is awesome. Here: https://github.com/tehkillerbee/mopidy-tidal

kondas commented 1 year ago

Thanks for the suggestion, i will check it out, it seems interesting.

I've updated to the latest image, and can confirm the plugin is now there :) But the functionality did not gett better for me unfortunately.

No matter if i provide credentials or not, the plugin only spits out these lines exactly, and no more

CMDTALK: tidal-app.py: Migration [initial_creation] skipped. CMDTALK: tidal-app.py: Migration [tile_image_v1] skipped. CMDTALK: tidal-app.py: Migration [add_album_info_to_played_tracks_v1] skipped. CMDTALK: tidal-app.py: Migration [add_album_id_index_to_played_tracks_v1] skipped. CMDTALK: tidal-app.py: Migration [add_update_time_to_tile_image_v1] skipped. CMDTALK: tidal-app.py: Migration [add_columns_to_played_track_v1] skipped. CMDTALK: tidal-app.py: Migration [add_explicit_to_played_track_v1] skipped. CMDTALK: tidal-app.py: Migration [add_artist_name_to_played_track_v1] skipped. CMDTALK: tidal-app.py: Migration [drop_is_multidisc_album_from_played_track_v1] skipped. CMDTALK: tidal-app.py: Migration [add_album_duration_to_played_track_v1] skipped. CMDTALK: tidal-app.py: Migration [add_indexes_to_tile_image_v1] skipped. CMDTALK: tidal-app.py: Current db version is [11] No device appears in Tidal app to playback. I can see with UPnP Discovery app that there are M-SEARCH messages coming from the tidal app, and NOTIFY messages follow them by upmpdcli.

Do You have an idea what is the issue here? It is possible that i completely misunderstood this system, and looking for something that doesn't even exist as functionality.

EDIT: And i think i found the reason: My misundertanding of this system. I thought that upmpdcli can act as a Tidal-connect end-device, but it is not. It can act as a UPnP media server, that accesses content from Tidal. With a UPnP control app, i can play back the media files from this media server provided by upmpdcli, on an upnp render device (and upmpdcli can act as one also).

GioF71 commented 1 year ago

That log is ok... it is simply checking that the db has been upgraded to the state required by the version you are running. Can you post the full compose file? Did you set network_mode to host?

kondas commented 1 year ago

Yes, here is the compose file

services:
  mpd:
    image: vimagick/mpd
    entrypoint:
      - mpd
      - --stdout
      - --no-daemon
      - /root/.config/mpd.conf
    ports:
      - "6600:6600"
    volumes:
      - /var/data/ssd/music/mpd/config:/root/.config
    restart: unless-stopped
  upmpd:
    image: giof71/upmpdcli:latest
    network_mode: host
    privileged: true
    restart: unless-stopped
    environment:
      - RENDERER_MODE=NONE
      - MPD_HOST=10.88.0.10
      - TIDAL_ENABLE=YES
    volumes:
      - /var/data/ssd/music/upmpd/cache:/cache

But i think i cracked the code :sweat_smile: see my edit in previous post

GioF71 commented 1 year ago

Ok can you also post the upmpdcli container logs?

kondas commented 1 year ago
File /user/config/qobuz.txt not found.
File /user/config/deezer.txt not found.
File /user/config/hra.txt not found.
PORT_OFFSET not specified
Automatically setting UPNPIFACE to [mlx_1]
UPNPIFACE=[]
UPNPIFACE not set
RENDERER_MODE = [NONE]
RENDERER_MODE=[NONE] => OPENHOME=[0] UPNPAV=[0]
UPNPPORT=[] for key [upnpport] on file /app/conf/current-upmpdcli.conf
UPNPPORT not set
UPNPAV=[0] for key [upnpav] on file /app/conf/current-upmpdcli.conf
Setting UPNPAV to [0]
enabling key [upnpav]
Setting value for key [upnpav] to [0]
OPENHOME=[0] for key [openhome] on file /app/conf/current-upmpdcli.conf
Setting OPENHOME to [0]
enabling key [openhome]
Setting value for key [openhome] to [0]
MPD_HOST=[10.88.0.10] for key [mpdhost] on file /app/conf/current-upmpdcli.conf
Setting MPD_HOST to [10.88.0.10]
enabling key [mpdhost]
Setting value for key [mpdhost] to [10.88.0.10]
MPD_PORT=[] for key [mpdport] on file /app/conf/current-upmpdcli.conf
MPD_PORT not set
PLG_MICRO_HTTP_HOST=[] for key [plgmicrohttphost] on file /app/conf/current-upmpdcli.conf
PLG_MICRO_HTTP_HOST not set
PLG_MICRO_HTTP_PORT=[] for key [plgmicrohttpport] on file /app/conf/current-upmpdcli.conf
PLG_MICRO_HTTP_PORT not set
OWN_QUEUE=[] for key [ownqueue] on file /app/conf/current-upmpdcli.conf
OWN_QUEUE not set
CHECK_CONTENT_FORMAT=[]
MEDIA_SERVER_ENABLED=[1]
Setting msfriendlyname to []
MEDIA_SERVER_FRIENDLY_NAME=[] for key [msfriendlyname] on file /app/conf/current-upmpdcli.conf
MEDIA_SERVER_FRIENDLY_NAME not set
RADIOS_ENABLE=[]
BBC_ENABLE=[]
RADIO_BROWSER_ENABLE=[]
SUBSONIC_ENABLE=[]
RADIO_PARADISE_ENABLE=[]
MOTHER_EARTH_RADIO_ENABLE=[]
TIDAL_ENABLE=[YES]
Enabling new Tidal, processing settings
TIDAL_AUTOSTART=[]
TIDAL_AUTOSTART=[1] for key [tidalautostart] on file /app/conf/current-upmpdcli.conf
Setting TIDAL_AUTOSTART to [1]
enabling key [tidalautostart]
Setting value for key [tidalautostart] to [1]
Setting Token Type []
Setting Access Token []
Setting Access Token []
Setting Token Expiry Time []
Setting Audio Quality [LOSSLESS]
Qobuz Enable [no]
Deezer Enable [no]
HRA Enable [no]
UPRCL_ENABLE []
No additional radio list file.
cachedir = /cache
radiolist = /app/conf/radiolist.conf
upradiostitle = Upmpdcli Radio List
#logfilename = /log/upmpdcli.log
#log level defaults to 2
#loglevel = LOG_LEVEL
#pkgdatadir=/usr/share/upmpdcli
#pidfile = /var/run/upmpdcli.pid
upnpiface = mlx_1
#upnpip =
#upnpport = UPNPPORT
#useipv6 = false
#friendlyname = UPMPD_FRIENDLY_NAME
#avfriendlyname = AV_FRIENDLY_NAME
upnpav = 0
openhome = 0
#lumincompat = 0
#ohinfotexttodata = 0
#saveohcredentials = 1
#checkcontentformat = CHECK_CONTENT_FORMAT
#opensslcmd =
#iconpath = /usr/share/upmpdcli/icon.png
#presentationhtml = /usr/share/upmpdcli/presentation.html
#enablel16 = true
mpdhost = 10.88.0.10
#mpdport = MPD_PORT
#mpdpassword =
#mpdtimeoutms = 2000
#ownqueue = OWN_QUEUE
#onstart =
#onplay =
#onpause =
#onstop =
#onstandby =
#externalvolumecontrol =
#getexternalvolume =
#onvolumechange =
#avtautoplay = 0
#ohproductroom = OH_PRODUCT_ROOM
#radioscripts = /usr/share/upmpdcli/radio_scripts
#ohmanufacturername = UpMPDCli heavy industries Co.
#ohmanufacturerinfo = Such nice guys and gals
#ohmanufacturerurl = http://www.lesbonscomptes.com/upmpdcli
#ohmanufacturerimageuri =
#ohmodelname = UpMPDCli UPnP-MPD gateway
#ohmodelinfo =
#ohmodelurl = http://www.lesbonscomptes.com/upmpdcli
#ohmodelimageuri =
#ohproductname = Upmpdcli
#ohproductinfo =
#ohproducturl =
#ohproductimageuri =
#ohmetapersist = 1
#ohmetasleep = 0
#msfriendlyname = MEDIA_SERVER_FRIENDLY_NAME
#plgmicrohttphost = PLG_MICRO_HTTP_HOST
#plgmicrohttpport = PLG_MICRO_HTTP_PORT
#plgproxymethod = redirect
#msiconpath = /usr/share/upmpdcli/icon.png
#hrauser = HRA_USERNAME
#hrapass = HRA_PASSWORD
#hralang = HRA_LANG
#qobuzuser = QOBUZ_USERNAME
#qobuzpass = QOBUZ_PASSWORD
#qobuzformatid = QOBUZ_FORMAT_ID
#deezeruser = DEEZER_USERNAME
#deezerpass = DEEZER_PASSWORD
#uprcluser = UPRCL_USER
#uprcltitle = UPRCL_TITLE
#uprclhostport = UPRCL_HOSTPORT
#uprclconfdir = /uprcl/confdir
#uprclconfrecolluser = /user/config/recoll.conf.user
#uprclminimconfig =
#uprclmediadirs = /uprcl/mediadirs
#uprclpaths =
#uprclautostart = UPRCL_AUTOSTART
#upradiosuser = UPRADIO_USER
#upradiosautostart = RADIOS_AUTOSTART
#bbcuser = BBC_USER
#bbcprogrammedays = BBC_PROGRAMME_DAYS
#sclogfilename =
#scloglevel = 3
#scplaymethod = mpd
#schttpport = 8768
#scalsadevice = default
#sccvttype = SRC_SINC_FASTEST
#scusempdvolume = 0
#sc2mpd =
#screceiverstatefile =
#scplaymethod is alsa
#scstreamcodec =
#scsenderpath =
#scstreamscaled = 1
#scsendermpdport = 6700
#scripts_dir = /usr/share/upmpdcli/src_scripts
#scscriptgracesecs = 2
#radio-browseruser = radio-browseruser
#subsonicautostart = SUBSONIC_AUTOSTART
#subsonicuser = SUBSONIC_USER
#subsonicpassword = SUBSONIC_PASSWORD
#subsonicbaseurl = SUBSONIC_BASE_URL
#subsonicport = SUBSONIC_PORT
#subsonicitemsperpage = SUBSONIC_ITEMS_PER_PAGE
#subsonicappendyeartoalbum = SUBSONIC_APPEND_YEAR_TO_ALBUM
#subsonicappendcodecstoalbum = SUBSONIC_APPEND_CODECS_TO_ALBUM
#subsonicwhitelistcodecs = SUBSONIC_WHITELIST_CODECS
tidaluser = tidal
tidalautostart = 1
tidaltokentype =
tidalaccesstoken =
tidalrefreshtoken =
tidalexpirytime =
tidalaudioquality = LOSSLESS
# Radio Paradise
#radio-paradiseuser = radioparadise
#mother-earth-radiouser = motherearthradio

Ensuring user with uid:[1000] gid:[1000] exists ...
Group with gid [1000] does not exist, creating...
Group [upmpd-user] with gid [1000] created.
User with uid [1000] does not exist, creating...
User [upmpd-user] with uid [1000] created.
Home directory [/home/upmpd-user] not found, creating.
. done.
Setting home directory to [/home/upmpd-user] for user [upmpd-user] ...
usermod: no changes
. done.
Setting shell to [/bin/bash] for user [upmpd-user] ...
. done.
Setting home directory permissions ...
. done.
Setting permissions for writable volumes ...
. done.
About to sleep for 0 second(s)
Ready to start.
USER MODE [upmpd-user] (now mandatory)
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for bbc because neither bbcuser nor bbcautostart are defined in the configuration
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for deezer because neither deezeruser nor deezerautostart are defined in the configuration
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for hra because neither hrauser nor hraautostart are defined in the configuration
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for mother-earth-radio because neither mother-earth-radiouser nor mother-earth-radioautostart are defined in the configuration
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for qobuz because neither qobuzuser nor qobuzautostart are defined in the configuration
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for radio-browser because neither radio-browseruser nor radio-browserautostart are defined in the configuration
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for radio-paradise because neither radio-paradiseuser nor radio-paradiseautostart are defined in the configuration
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for subsonic because neither subsonicuser nor subsonicautostart are defined in the configuration
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for upradios because neither upradiosuser nor upradiosautostart are defined in the configuration
:3:src/mediaserver/contentdirectory.cxx:179::ContentDirectory: not creating entry for uprcl because neither uprcluser nor uprclautostart are defined in the configuration
:3:libupnpp/upnpplib.cxx:248::LibUPnP: Using IPV4 10.88.0.10 port 49152 IPV6  port 49152
CMDTALK: tidal-app.py: Migration [initial_creation] skipped.
CMDTALK: tidal-app.py: Migration [tile_image_v1] skipped.
CMDTALK: tidal-app.py: Migration [add_album_info_to_played_tracks_v1] skipped.
CMDTALK: tidal-app.py: Migration [add_album_id_index_to_played_tracks_v1] skipped.
CMDTALK: tidal-app.py: Migration [add_update_time_to_tile_image_v1] skipped.
CMDTALK: tidal-app.py: Migration [add_columns_to_played_track_v1] skipped.
CMDTALK: tidal-app.py: Migration [add_explicit_to_played_track_v1] skipped.
CMDTALK: tidal-app.py: Migration [add_artist_name_to_played_track_v1] skipped.
CMDTALK: tidal-app.py: Migration [drop_is_multidisc_album_from_played_track_v1] skipped.
CMDTALK: tidal-app.py: Migration [add_album_duration_to_played_track_v1] skipped.
CMDTALK: tidal-app.py: Migration [add_indexes_to_tile_image_v1] skipped.
CMDTALK: tidal-app.py: Current db version is [11]

10.88.0.10 is the ip of the docker host running this container and mpd. mpd is set up to use pulse sink via tcp. I tried deleting the contents of the cache folder , that way i can see the complete db build process. But still no spotify URL for authentication appearing in the log, which is strange. get-credentials is working.

I also gave a try with mopidy, where the authentication url is visible in the logs

kondas commented 1 year ago

I went forward trying to validate my theory about this system, and searched for network servers in mconnect app. The upmpd instance appeared there, and it had a directory named 'Tidal'. After trying to enter it, the mconnect app hangs, but the plugin started working as visible in the log messages appearing after the connect:

CMDTALK: tidal-app.py: browse: args: --{'cmdtalk:proc': 'browse', 'count': '20', 'offset': '0', 'flag': 'children', 'objid': '0$tidal$'}-- CMDTALK: tidal-app.py: Tidal Plugin Release 0.0.12 CMDTALK: tidal-app.py: Cache dir for [tidal] is [/cache/tidal] CMDTALK: tidal-app.py: DB version for [tidal] is [11] CMDTALK: tidal-app.py: Credentials not provided statically, looking for credentials file ... CMDTALK: tidal-app.py: Visit https://link.tidal.com/XXXXX to log in, the code will expire in 300 seconds

After going through the authorization process, and reopening the upnp media server in mconnect, my personal Tidal stuff is there. So it seems like the plugin core is only starting on demand

GioF71 commented 1 year ago

Glad you have found the solution already. Yes, it starts at the first request, it's the default of upmpdcli media server plugins. Would it be better if it started immediately? It should be possible to do it with little effort, and it might be configurable

kondas commented 1 year ago

I think lazy starting is better, but a notice in the docs could help avoid misunderstanding

GioF71 commented 1 year ago

Hello, I made a few changes to the README.md and to the example configurations document, would you like to have a look and see if something is still missing and/or improvable?

kondas commented 1 year ago

Yes indeed, I will also make time on the weekend to make some improvements on the entrypoint script.

GioF71 commented 3 months ago

Hello, could you check the changes? Maybe suggest where I can change something. Thank you!

kondas commented 3 months ago

Hi @GioF71! Since then I have found a solution to run the leaked Tidal Connect application on x86_64 with very good results, so i have abandoned upnpd. This issue can be closed, thanks for checking up!

GioF71 commented 3 months ago

Hello, thank you for commenting here. Would you like to share your solution? How do you run arm binaries on x86? Thank you!

kondas commented 3 months ago

The solution possibly has some limitations, but it is very simple. You can combine binfmt_misc and qemu-static to emulate different architectures and run binaries without a full VM environment. The QUS project makes it very easy to run different architecture containers, which is very convenient. Use QUS to register arm format, and then You can run edg3crusher's container wich contains all needed shared libraries. This is how i use it: The tidal-connect application supports pulseaudio via libportaudio. Install pulseaudio + alsa pulse to have pulseaudio output :

FROM edgecrush3r/tidal-connect:latest

ENV DEBIAN_FRONTEND=noninteractive

COPY sources.list /etc/apt/sources.list

RUN apt-get update && \
    apt-get install -y pulseaudio libasound2-plugins && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

sources.list:

deb http://legacy.raspbian.org/raspbian/ stretch main contrib non-free rpi

I mount the pulse UDS socket to the container, set PULSE_SERVER, and its done. I also mount the UDS of avahi-daemon + dbus, and the tidal-connect service is advertised properly.

 services:

  tidal-connect:
    build:
      context: tidal-connect/build
    restart: unless-stopped
    volumes:
      - pulse-socket:/var/run/pulse/
      - /var/run/avahi-daemon/:/var/run/avahi-daemon/
      - /run/dbus/system_bus_socket:/run/dbus/system_bus_socket
      - ./tidal-connect/config/asound.conf:/etc/asound.conf

asound.conf:

pcm.!default {
    type pulse
    hint.description "Default PulseAudio Output"
}

ctl.!default {
    type pulse
}

It has been working for months now perfect, with minimal resource usage, and proper HI-RES support Let me know if You need help setting it up

GioF71 commented 3 months ago

Thank you for sharing! I will try that as soon as possible and let you know!

GioF71 commented 3 months ago

Hello, I took a quick peek at the QUS project and this is amazing. I supposed qemu was involved in your solution somehow but did not know about this. Thank you again for sharing. As I cannot try it for at least 3-4 more days, I'd like to ask you a question about pulse audio. Did you use pulse because it is what you wanted to achieve, or because the solution cannot work with alsa directly? Thank you!

kondas commented 3 months ago

Actually it is using alsa and sets up pulseaudio as the default alsa output. I did not try using native alsa to hardware, because i also have shairport-sync and librespot ocasionally stream to the DAC. It is as good as native alsa, if not better IMHO, because the sources can stil dynamically change the samplerate (so no resampling is done), but there is no hassle to have them release the hardware properly after stopping streaming.

kondas commented 3 months ago

Hey @GioF71 , i went forward and tried to use native alsa output, without success. Maybe it is a limitation, maybe You can figure out somehow. There is still jack and pulse to solve the problem if needed. I also noticed that maybe Tidal has changed something recently, because now the app only recieves 44.1k 16bit FLAC, flagged as "LOSSLESS" quality. Around May when i worked on this it was different, FLAC or MQA was abailable, 44.1-96k. I had a lot of debugging with multiple pulseaidio versions to be able to handle sample rate changes, because the stream has to be suspended for this. Since my DAC is MQA capable i've configured MQA passthrough in the app and the dac showed unfolding happen.

Currently on MAX quality media if i change to tidal-connect output in desktop app, it reverts to high. And even after disconnecting from tidal-connect output, the app has to be restarted to re-gain MAX quality option...

GioF71 commented 3 months ago

Hello, yes that happens because Tidal dropped all mqa versions of the albums. Everything hires with this version of tidal connect was mqa-encoded, with the first unfolding done at the application level, the second on the dac (if capable), and this could go up to 192kHz Now I guess we are stuck with 16/44 or 24/48, but I did not check if any of the latter still exist today.

P.s. thank you for trying native alsa :-)

On Sun, Sep 1, 2024, 16:43 kondas @.***> wrote:

Hey @GioF71 https://github.com/GioF71 , i went forward and tried to use native alsa output, without success. Maybe it is a limitation, maybe You can figure out somehow. There is still jack and pulse to solve the problem if needed. I also noticed that maybe Tidal has changed something recently, because now the app only recieves 44.1k 16bit FLAC, flagged as "LOSSLESS" quality. Around May when i worked on this it was different, FLAC or MQA was abailable, 44.1-96k. I had a lot of debugging with multiple pulseaidio versions to be able to handle sample rate changes, because the stream has to be suspended for this. Since my DAC is MQA capable i've configured MQA passthrough in the app and the dac showed unfolding happen.

Currently on MAX quality media if i change to tidal-connect output in desktop app, it reverts to high. And even after disconnecting from tidal-connect output, the app has to be restarted to re-gain MAX quality option...

— Reply to this email directly, view it on GitHub https://github.com/GioF71/upmpdcli-docker/issues/312#issuecomment-2323473865, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKX6WC6T6UT2J4XJKZFSTLZUNU53AVCNFSM6AAAAABNAKUJJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGQ3TGOBWGU . You are receiving this because you were mentioned.Message ID: @.***>

GioF71 commented 3 months ago

This particular tidal connect application does not support 24/192 natively. But mopidy-tidal, the tidal plugin for upmpdcli and bubbleUpnp all support up to 24/192. Did you try any of these? Cheers

On Sun, Sep 1, 2024, 17:29 Giovanni Fulco @.***> wrote:

Hello, yes that happens because Tidal dropped all mqa versions of the albums. Everything hires with this version of tidal connect was mqa-encoded, with the first unfolding done at the application level, the second on the dac (if capable), and this could go up to 192kHz Now I guess we are stuck with 16/44 or 24/48, but I did not check if any of the latter still exist today.

On Sun, Sep 1, 2024, 16:43 kondas @.***> wrote:

Hey @GioF71 https://github.com/GioF71 , i went forward and tried to use native alsa output, without success. Maybe it is a limitation, maybe You can figure out somehow. There is still jack and pulse to solve the problem if needed. I also noticed that maybe Tidal has changed something recently, because now the app only recieves 44.1k 16bit FLAC, flagged as "LOSSLESS" quality. Around May when i worked on this it was different, FLAC or MQA was abailable, 44.1-96k. I had a lot of debugging with multiple pulseaidio versions to be able to handle sample rate changes, because the stream has to be suspended for this. Since my DAC is MQA capable i've configured MQA passthrough in the app and the dac showed unfolding happen.

Currently on MAX quality media if i change to tidal-connect output in desktop app, it reverts to high. And even after disconnecting from tidal-connect output, the app has to be restarted to re-gain MAX quality option...

— Reply to this email directly, view it on GitHub https://github.com/GioF71/upmpdcli-docker/issues/312#issuecomment-2323473865, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKX6WC6T6UT2J4XJKZFSTLZUNU53AVCNFSM6AAAAABNAKUJJSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRTGQ3TGOBWGU . You are receiving this because you were mentioned.Message ID: @.***>

kondas commented 3 months ago

Yeah it turns out anything higher than 16/44 was MQA, and they pulled the plug in the end of June. I checked the logs and there was not a single track higher than 16/44 in FLAC format since 25th of July. Some files still contain MQA meta-data (if that is even the corect term) i guess, because the DAC recognises them MQA. I did try some alternatives, but i did not find anything that could be used as a playback device in the official Tidal app, and that is what i like.

GioF71 commented 1 month ago

Hello @kondas, I just tried qus but could not figure out how to run this docker image. Would you like to share how you did that, other than the pulseaudio-related details which you already shared? Thanks a lot!

kondas commented 1 month ago

Sure, i can help. Can you suggest a Discord channel, where we can chat?

GioF71 commented 1 month ago

Just figured out how to create a channel on discord... I just used it a few times but never created one before. Anyway, here, the invite should be valid for 7 days. Thank you!