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 extention not found in image: giof71/mopidy #1

Open
Andy-Voigt opened this issue May 15, 2024 · 46 comments
Open

Tidal extention not found in image: giof71/mopidy #1

Andy-Voigt opened this issue May 15, 2024 · 46 comments

Comments

@Andy-Voigt
Copy link

Hello, i use the compose example to test mopidy with the tidal plugin. On start the log says

WARNING  2024-05-15 13:10:55,119 [13:MainThread] mopidy.config
  Ignoring config section 'tidal' because no matching extension was found
@GioF71
Copy link
Owner

GioF71 commented May 15, 2024

Hello, are you running this on the same Moode Audio box on the Pi2, that you mentioned here?
Also, are you running the exact compose file mentioned in the README.md?

@Andy-Voigt
Copy link
Author

Andy-Voigt commented May 20, 2024

I've try it on my host maschine a i7 "adler-lake" Laptop.

Here is what i did:

andy:~/ $ cat docker-compose.yml                                                                                                                                          [20:47:30]
version: "3.3"

services:
  mopidy:
    image: giof71/mopidy
    container_name: mopidy
    user: "1000:29"
    devices:
      - /dev/snd:/dev/snd
    environment:
      - AUDIO_OUTPUT=alsasink device=hw:D10
      - RESTORE_STATE=yes
      - SCROBBLER_ENABLED=${SCROBBLER_ENABLED:-no}
      - TIDAL_ENABLED=yes
      - TIDAL_QUALITY=LOSSLESS
    ports:
      - 6680:6680
    volumes:
      - ./config:/config
      - ./cache:/cache
      - ./data:/data
    restart: always
andy:~/ $ docker-compose up                                                                                                                                               [20:47:31]
WARN[0000] /home/andy/docker-compose.yml: `version` is obsolete 
[+] Running 5/5
 ✔ mopidy Pulled                                                                                                                                                               87.9s 
   ✔ 274c90ccaeb3 Pull complete                                                                                                                                                78.4s 
   ✔ 90edb9c1c31f Pull complete                                                                                                                                                81.9s 
   ✔ e831df7603a1 Pull complete                                                                                                                                                82.0s 
   ✔ 1bffd4329e5f Pull complete                                                                                                                                                82.1s 
[+] Running 2/2
 ✔ Network andy_default  Created                                                                                                                                                0.0s 
 ✔ Container mopidy      Created                                                                                                                                                0.1s 
Attaching to mopidy
mopidy  | Current user id is [1000]
mopidy  | USER_MODE=[]
mopidy  | Cache directory [/config] is not writable
mopidy  | Removing configuration files ...
mopidy  | rm: cannot remove '/tmp//config/*conf': No such file or directory
mopidy  | . done
mopidy  | Cache directory [/cache] is not writable
mopidy  | Data directory [/data] is not writable
mopidy  | COMMAND_LINE=[PYTHONPATH=/opt/mopidy-venv mopidy --config /tmp//config --option core/cache_dir=/tmp//cache --option core/data_dir=/tmp//data]
mopidy  | Configuration: 
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'mpd' because no matching extension was found
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'local' because no matching extension was found
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'scrobbler' because no matching extension was found
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'iris' because no matching extension was found
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'tidal' because no matching extension was found
mopidy  | [core]
mopidy  | cache_dir = /tmp//cache
mopidy  | config_dir = /tmp//config

@GioF71
Copy link
Owner

GioF71 commented May 20, 2024

maybe you started the container with a different user? the mounted directories are not writable. Try restoring the ownership:

sudo chown -R 1000:29 ./config
sudo chown -R 1000:29 ./cache
sudo chown -R 1000:29 ./data

then recreate the container:

docker-compose up -d --force-recreate

@GioF71
Copy link
Owner

GioF71 commented May 20, 2024

Also this line:

  - AUDIO_OUTPUT=alsasink device=hw:D10

is not ok in your system, you should replace "D10" with "sndrpihifiberry" or even hw:0 considering you have only that audio device.

@Andy-Voigt
Copy link
Author

Yes all of this is true. But why is the tidal extension not found?

"Ignoring config section 'tidal' because no matching extension was found"

@GioF71
Copy link
Owner

GioF71 commented May 20, 2024

uhm, that in fact is quite strange. Is your o.s. 32bit or 64bit? I assume it's 32, am I right?
try:

uname -a

I have tried the solution on pi4 running raspberry pi os arm64 and osmc on pi4 again. The latter is 64bit kernel and 32bit userland I believe. So maybe I never tried a plain 32 bit system. If you confirm your system is 32bit with the output of that command, I might be able to try and reproduce the issue in the next few days on a 32bit moode installation. Of course on a Pi3, not a Pi2 as I don't own one.

@GioF71
Copy link
Owner

GioF71 commented May 21, 2024

I've try it on my host maschine a i7 "adler-lake" Laptop.

Here is what i did:

andy:~/ $ cat docker-compose.yml                                                                                                                                          [20:47:30]
version: "3.3"

services:
  mopidy:
    image: giof71/mopidy
    container_name: mopidy
    user: "1000:29"
    devices:
      - /dev/snd:/dev/snd
    environment:
      - AUDIO_OUTPUT=alsasink device=hw:D10
      - RESTORE_STATE=yes
      - SCROBBLER_ENABLED=${SCROBBLER_ENABLED:-no}
      - TIDAL_ENABLED=yes
      - TIDAL_QUALITY=LOSSLESS
    ports:
      - 6680:6680
    volumes:
      - ./config:/config
      - ./cache:/cache
      - ./data:/data
    restart: always
andy:~/ $ docker-compose up                                                                                                                                               [20:47:31]
WARN[0000] /home/andy/docker-compose.yml: `version` is obsolete 
[+] Running 5/5
 ✔ mopidy Pulled                                                                                                                                                               87.9s 
   ✔ 274c90ccaeb3 Pull complete                                                                                                                                                78.4s 
   ✔ 90edb9c1c31f Pull complete                                                                                                                                                81.9s 
   ✔ e831df7603a1 Pull complete                                                                                                                                                82.0s 
   ✔ 1bffd4329e5f Pull complete                                                                                                                                                82.1s 
[+] Running 2/2
 ✔ Network andy_default  Created                                                                                                                                                0.0s 
 ✔ Container mopidy      Created                                                                                                                                                0.1s 
Attaching to mopidy
mopidy  | Current user id is [1000]
mopidy  | USER_MODE=[]
mopidy  | Cache directory [/config] is not writable
mopidy  | Removing configuration files ...
mopidy  | rm: cannot remove '/tmp//config/*conf': No such file or directory
mopidy  | . done
mopidy  | Cache directory [/cache] is not writable
mopidy  | Data directory [/data] is not writable
mopidy  | COMMAND_LINE=[PYTHONPATH=/opt/mopidy-venv mopidy --config /tmp//config --option core/cache_dir=/tmp//cache --option core/data_dir=/tmp//data]
mopidy  | Configuration: 
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'mpd' because no matching extension was found
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'local' because no matching extension was found
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'scrobbler' because no matching extension was found
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'iris' because no matching extension was found
mopidy  | WARNING  2024-05-20 18:49:01,481 [13:MainThread] mopidy.config
mopidy  |   Ignoring config section 'tidal' because no matching extension was found
mopidy  | [core]
mopidy  | cache_dir = /tmp//cache
mopidy  | config_dir = /tmp//config

I also see you have created the docker-compose file in the home directory. That means that the config, cache and data directories are created directly under the home. I'd suggest to create a subdirectory under home so the mounted volumes are separated from the directories in the home.
Of course this won't solve your issue.
I did not understand you were using an amd64 system. I will try and reproduce.

@GioF71
Copy link
Owner

GioF71 commented May 21, 2024

Ok, so the problem is that your directories are not available before the container is created.
For this reason, they are created with root user by the container itself, but then the process runs as user "1000:29", resulting in the issue you are encountering: directories are not writable.
In order to solve your issue, there are two options.
With your existing docker-compose, ensure that the directories are writable.
So maybe move it to a directory, create the directories there, and restart the container:

docker stop mopidy
docker rm mopidy
mkdir ~/mopidy-tidal
mv ~/docker-compose.yml ~/mopidy-tidal/docker-compose.yml
cd ~/mopidy-tidal
mkdir cache config data
docker-compose up -d --force-recreate

As an alternative, you can change the compose and avoid the "user" property, and use PUID and PGID instead. This way, the folders are chowned while the container starts. Your compose would become:

version: "3.3"

services:
  mopidy:
    image: giof71/mopidy
    container_name: mopidy
    devices:
      - /dev/snd:/dev/snd
    environment:
      - PUID=1000
      - PGID=29     
      - AUDIO_OUTPUT=alsasink device=hw:0
      - RESTORE_STATE=yes
      - SCROBBLER_ENABLED=${SCROBBLER_ENABLED:-no}
      - TIDAL_ENABLED=yes
      - TIDAL_QUALITY=LOSSLESS
    ports:
      - 6680:6680
      - 8989:8989
    volumes:
      - ./config:/config
      - ./cache:/cache
      - ./data:/data
    restart: always

@GioF71
Copy link
Owner

GioF71 commented May 21, 2024

Please also open port 8989 which is needed for pkce authentication. After that, you might also remove that exposed port.

If you use LOSSLESS and HI_RES, but not HI_RES_LOSSLESS, that port is not necessary. Just watch the logs, you will see a url, open it with your browser, authenticate with Tidal and authorize the app.
For HI_RES_LOSSLESS, you will need to go to http://your-host:8989 and follow the instructions

@Andy-Voigt
Copy link
Author

Andy-Voigt commented May 22, 2024

With the folder in place. Also no tidal plugin available.

andy:~/ $ docker stop mopidy                                                                                                                        [11:26:57]
mopidy
andy:~/ $ docker rm mopidy                                                                                                                          [11:27:01]
mopidy
andy:~/ $ mkdir ~/mopidy-tidal                                                                                                                      [11:27:04]
andy:~/ $ mv ~/docker-compose.yml ~/mopidy-tidal/docker-compose.yml                                                                                 [11:27:06]
andy:~/ $ cd ~/mopidy-tidal                                                                                                                         [11:27:09]
andy:mopidy-tidal/ $ mkdir cache config data                                                                                                        [11:27:11]
andy:mopidy-tidal/ $ docker-compose up -d --force-recreate                                                                                          [11:27:21]
WARN[0000] /home/andy/mopidy-tidal/docker-compose.yml: `version` is obsolete 
[+] Running 2/2
 ✔ Network mopidy-tidal_default  Created                                                                                                                  0.0s 
 ✔ Container mopidy              Started                                                                                                                  0.3s 
andy:mopidy-tidal/ $ docker logs -f mopidy                                                                                                          [11:27:44]
Current user id is [0]
USER_MODE=[]
User mode disabled
Config directory [/config] is writable
Removing configuration files ...
rm: cannot remove '/config/*conf': No such file or directory
. done
Cache directory [/cache] is writable
Data directory [/data] is writable
COMMAND_LINE=[PYTHONPATH=/opt/mopidy-venv mopidy --config /config --option core/cache_dir=/cache --option core/data_dir=/data]
Configuration: 
WARNING  2024-05-22 09:27:44,323 [9:MainThread] mopidy.config
  Ignoring config section 'scrobbler' because no matching extension was found
WARNING  2024-05-22 09:27:44,323 [9:MainThread] mopidy.config
  Ignoring config section 'local' because no matching extension was found
WARNING  2024-05-22 09:27:44,323 [9:MainThread] mopidy.config
  Ignoring config section 'tidal' because no matching extension was found
WARNING  2024-05-22 09:27:44,323 [9:MainThread] mopidy.config
  Ignoring config section 'iris' because no matching extension was found
WARNING  2024-05-22 09:27:44,323 [9:MainThread] mopidy.config
  Ignoring config section 'mpd' because no matching extension was found
andy:mopidy-tidal/ $ cat docker-compose.yml                                                                                                        [11:29:24]
version: "3.3"

services:
  mopidy:
    image: giof71/mopidy
    container_name: mopidy
    devices:
      - /dev/snd:/dev/snd
    environment:
      - PUID=1000
      - PGID=29     
      - AUDIO_OUTPUT=alsasink device=hw:0
      - RESTORE_STATE=yes
      - SCROBBLER_ENABLED=${SCROBBLER_ENABLED:-no}
      - TIDAL_ENABLED=yes
      - TIDAL_QUALITY=LOSSLESS
    ports:
      - 6680:6680
      - 8989:8989
    volumes:
      - ./config:/config
      - ./cache:/cache
      - ./data:/data
    restart: always

@GioF71
Copy link
Owner

GioF71 commented May 22, 2024

which user are you using? try:

id

and post the output. If you are not uid 1000, some values must be changed.

@Andy-Voigt
Copy link
Author

Ups the plugin is under "browse". The error message is not correct the plugin is there. Thanks for your help.

@GioF71
Copy link
Owner

GioF71 commented May 22, 2024

Ups the plugin is under "browse". The error message is not correct the plugin is there. Thanks for your help.

so it is working?

@Andy-Voigt
Copy link
Author

yes its working also with named volumes or folder self created.

@GioF71
Copy link
Owner

GioF71 commented May 22, 2024

Ok excellent news. Feel free to open other issue, maybe if you want to configure hires.
Remember to star the repo(s) if you like the work!
Cheers

@GioF71
Copy link
Owner

GioF71 commented May 22, 2024

Hello, thanks to your ticket, I found a few issues with user mode specifically.
So generally speaking, using

user: "1000:29"

was working fine, but setting PUID/PGID/AUDIO_GID was not working properly.
You might also find in your installation that the local folders are owned by root.
I am building a new image which should solve the issue. It should take 12 minutes to build or so.

@GioF71
Copy link
Owner

GioF71 commented May 22, 2024

Also, I wrongly suggested to set PGID to the audio group.
While this is not totally wrong, ideally when using user mode, if you uid and gid are both 1000 and the audio group is 29, you should set

- PUID=1000
- PGID=1000
- AUDIO_GID=29

you can find the gid of the audio group using the command:

getent group audio

@GioF71
Copy link
Owner

GioF71 commented Nov 13, 2024

Hello, can we close this?

@Pentium82
Copy link

Trying install on rAudio 64bit and i'm facing with these issue:
rAudio:~/mopidy-docker # docker-compose run mopidy WARN[0000] /root/mopidy-docker/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion WARN[0000] Found orphan containers ([mopidy-docker-mopidy-run-a130dfb056d7 mopidy-docker-mopidy-run-8561ba2ede8c]) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up. Current user id is [1000] USER_MODE=[] Cache directory [/config] is not writable Removing configuration files ... rm: cannot remove '/tmp//config/*conf': No such file or directory . done Cache directory [/cache] is not writable Data directory [/data] is not writable COMMAND_LINE=[PYTHONPATH=/opt/mopidy-venv mopidy --config /tmp//config --option core/cache_dir=/tmp//cache --option core/data_dir=/tmp//data] Configuration: WARNING 2024-11-16 05:12:38,118 [12:MainThread] mopidy.config Ignoring config section 'tidal' because no matching extension was found WARNING 2024-11-16 05:12:38,118 [12:MainThread] mopidy.config Ignoring config section 'local' because no matching extension was found WARNING 2024-11-16 05:12:38,118 [12:MainThread] mopidy.config Ignoring config section 'iris' because no matching extension was found WARNING 2024-11-16 05:12:38,118 [12:MainThread] mopidy.config Ignoring config section 'scrobbler' because no matching extension was found WARNING 2024-11-16 05:12:38,118 [12:MainThread] mopidy.config Ignoring config section 'mpd' because no matching extension was found [core] cache_dir = /tmp//cache config_dir = /tmp//config data_dir = /tmp//data max_tracklist_length = 10000 restore_state = true [logging] verbosity = 0 format = %(levelname)-8s %(asctime)s [%(process)d:%(threadName)s] %(name)s\n %(message)s color = true config_file = [audio] mixer = software mixer_volume = output = alsasink device=hw:0 buffer_time = [proxy] scheme = hostname = port = username = password = [file] enabled = false ; Extension disabled by user config. [http] enabled = true hostname = 0.0.0.0 port = 6680 zeroconf = Mopidy HTTP server on $hostname allowed_origins = csrf_protection = true default_app = mopidy [m3u] enabled = true base_dir = default_encoding = latin-1 default_extension = .m3u8 playlists_dir = [softwaremixer] enabled = true [stream] enabled = true protocols = http https mms rtmp rtmps rtsp metadata_blacklist = timeout = 5000 CMD_LINE=[] Container running as 1000 INFO 2024-11-16 05:12:40,857 [20:MainThread] mopidy.__main__ Starting Mopidy 3.4.2 INFO 2024-11-16 05:12:40,987 [20:MainThread] mopidy.config Loading config from builtin defaults INFO 2024-11-16 05:12:40,996 [20:MainThread] mopidy.config Loading config from file:///tmp/config/scrobbler.conf INFO 2024-11-16 05:12:40,997 [20:MainThread] mopidy.config Loading config from file:///tmp/config/file.conf INFO 2024-11-16 05:12:40,998 [20:MainThread] mopidy.config Loading config from file:///tmp/config/local.conf INFO 2024-11-16 05:12:40,999 [20:MainThread] mopidy.config Loading config from file:///tmp/config/iris.conf INFO 2024-11-16 05:12:41,000 [20:MainThread] mopidy.config Loading config from file:///tmp/config/mpd.conf INFO 2024-11-16 05:12:41,001 [20:MainThread] mopidy.config Loading config from file:///tmp/config/mopidy.conf INFO 2024-11-16 05:12:41,002 [20:MainThread] mopidy.config Loading config from file:///tmp/config/audio.conf INFO 2024-11-16 05:12:41,003 [20:MainThread] mopidy.config Loading config from file:///tmp/config/tidal.conf INFO 2024-11-16 05:12:41,004 [20:MainThread] mopidy.config Loading config from file:///tmp/config/http.conf INFO 2024-11-16 05:12:41,005 [20:MainThread] mopidy.config Loading config from command line options INFO 2024-11-16 05:12:41,844 [20:MainThread] mopidy.__main__ Enabled extensions: softwaremixer, tidal, http, m3u, stream, iris INFO 2024-11-16 05:12:41,845 [20:MainThread] mopidy.__main__ Disabled extensions: file, scrobbler, local, jellyfin, mpd WARNING 2024-11-16 05:12:41,846 [20:MainThread] mopidy.__main__ Found jellyfin configuration errors. The extension has been automatically disabled: WARNING 2024-11-16 05:12:41,847 [20:MainThread] mopidy.__main__ jellyfin/hostname must be set. WARNING 2024-11-16 05:12:41,847 [20:MainThread] mopidy.__main__ jellyfin/username must be set. WARNING 2024-11-16 05:12:41,848 [20:MainThread] mopidy.__main__ Please fix the extension configuration errors or disable the extensions to silence these messages. INFO 2024-11-16 05:12:43,030 [20:MainThread] mopidy.commands Starting Mopidy mixer: SoftwareMixer INFO 2024-11-16 05:12:43,036 [20:MainThread] mopidy.commands Starting Mopidy audio INFO 2024-11-16 05:12:43,044 [20:MainThread] mopidy.commands Starting Mopidy backends: M3UBackend, StreamBackend, TidalBackend INFO 2024-11-16 05:12:43,046 [20:MainThread] mopidy.internal.path Creating dir file:///tmp/data/m3u INFO 2024-11-16 05:12:43,088 [20:MainThread] mopidy.internal.path Creating dir file:///tmp/cache/tidal INFO 2024-11-16 05:12:43,092 [20:Audio-2 (_actor_loop)] mopidy.audio.actor Audio output set to "alsasink device=hw:0" INFO 2024-11-16 05:12:43,105 [20:MainThread] mopidy.internal.path Creating dir file:///tmp/data/tidal INFO 2024-11-16 05:12:43,117 [20:TidalBackend-5 (_actor_loop)] mopidy_tidal.backend Mopidy-Tidal version: v0.3.9 INFO 2024-11-16 05:12:43,128 [20:TidalBackend-5 (_actor_loop)] mopidy_tidal.backend Python-Tidal version: v0.8.1 INFO 2024-11-16 05:12:43,137 [20:TidalBackend-5 (_actor_loop)] mopidy_tidal.backend PKCE login web server port: 8989 INFO 2024-11-16 05:12:43,148 [20:TidalBackend-5 (_actor_loop)] mopidy_tidal.backend Quality: LOSSLESS INFO 2024-11-16 05:12:43,151 [20:TidalBackend-5 (_actor_loop)] mopidy_tidal.backend Authentication: OAuth WARNING 2024-11-16 05:12:43,154 [20:TidalBackend-5 (_actor_loop)] mopidy_tidal.backend AUTO login implies lazy connection, setting lazy=True. INFO 2024-11-16 05:12:43,155 [20:TidalBackend-5 (_actor_loop)] mopidy_tidal.backend Login method: AUTO INFO 2024-11-16 05:12:43,156 [20:TidalBackend-5 (_actor_loop)] mopidy_tidal.backend Using default client id & client secret from python-tidal INFO 2024-11-16 05:12:43,158 [20:MainThread] mopidy.commands Starting Mopidy core INFO 2024-11-16 05:12:43,186 [20:Core-6 (_actor_loop)] mopidy.internal.path Creating dir file:///tmp/data/core INFO 2024-11-16 05:12:43,188 [20:Core-6 (_actor_loop)] mopidy.core.actor Loading state from /tmp/data/core/state.json.gz INFO 2024-11-16 05:12:43,190 [20:Core-6 (_actor_loop)] mopidy.internal.storage File does not exist: /tmp/data/core/state.json.gz INFO 2024-11-16 05:12:43,191 [20:Core-6 (_actor_loop)] mopidy.core.actor Failed to delete /tmp/data/core/state.json.gz INFO 2024-11-16 05:12:43,193 [20:MainThread] mopidy.commands Starting Mopidy frontends: HttpFrontend, IrisFrontend INFO 2024-11-16 05:12:43,197 [20:HttpFrontend-8 (_actor_loop)] mopidy.http.actor HTTP server running at [::ffff:0.0.0.0]:6680 INFO 2024-11-16 05:12:43,307 [20:IrisFrontend-9 (_actor_loop)] mopidy_iris.core Starting Iris 3.69.3 INFO 2024-11-16 05:12:43,308 [20:MainThread] mopidy.commands Starting GLib mainloop INFO 2024-11-16 05:12:43,317 [20:IrisFrontend-9 (_actor_loop)] mopidy.internal.path Creating dir file:///tmp/data/iris INFO 2024-11-16 05:12:43,325 [20:HttpServer] mopidy.internal.path Creating dir file:///tmp/data/http please help me.
Then stuck there.

@Pentium82
Copy link

Pentium82 commented Nov 16, 2024

Screenshot_20241116_122508_Termius.th.jpg

@GioF71
Copy link
Owner

GioF71 commented Nov 16, 2024

Sure, can you post your compose file or docker run command?
It seems that the directories are not writable. Let's see what is going on

@Pentium82
Copy link

Pentium82 commented Nov 16, 2024

Thank you very much. Here's what I did:

  1. Git clone your repo to local
  2. Install buildx for r Audio (arch linux)
  3. Build docker image
  4. Copy and save your compose file to my local
  5. Run docker command, then had issue.
    When i ran the command: getent group audio, system returns 996.
    Thus i have only card so i just changed your compose at 2 line
    PGID=996
    • AUDIO_OUTPUT=alsasink device=hw:0

@GioF71
Copy link
Owner

GioF71 commented Nov 16, 2024

which user are you using? Try executing

id

and post the result here.
I assume your are using this:

version: "3.3"

services:
  mopidy:
    image: giof71/mopidy
    container_name: mopidy
    devices:
      - /dev/snd:/dev/snd
    environment:
      - PUID=1000
      - PGID=29     
      - AUDIO_OUTPUT=alsasink device=hw:0
      - RESTORE_STATE=yes
      - SCROBBLER_ENABLED=${SCROBBLER_ENABLED:-no}
      - TIDAL_ENABLED=yes
      - TIDAL_QUALITY=LOSSLESS
    ports:
      - 6680:6680
      - 8989:8989
    volumes:
      - ./config:/config
      - ./cache:/cache
      - ./data:/data
    restart: always

I would try to set ownership in the folders with

chown 1000:1000 config cache data

Prepend sudo if you get an error related to permissions.

Maybe add the env variable

PGID=1000

under PUID=1000

The try again using

docker-compose up -d --force-recreate

Let me know if this helps!

@GioF71
Copy link
Owner

GioF71 commented Nov 16, 2024

Ops, I see from the previous post that you are using the root user. So maybe instead of PUID, PGID and AUDIO_GID, set USER_MODE=no.
Remove entirely those PUID, PGID and AUDIO_GID. The application will run as root.

so the compose would be:

version: "3.3"

services:
  mopidy:
    image: giof71/mopidy
    container_name: mopidy
    devices:
      - /dev/snd:/dev/snd
    environment:
      - USER_MODE=no
      - AUDIO_OUTPUT=alsasink device=hw:0
      - RESTORE_STATE=yes
      - SCROBBLER_ENABLED=${SCROBBLER_ENABLED:-no}
      - TIDAL_ENABLED=yes
      - TIDAL_QUALITY=LOSSLESS
    ports:
      - 6680:6680
      - 8989:8989
    volumes:
      - ./config:/config
      - ./cache:/cache
      - ./data:/data
    restart: always

Let me know!

@GioF71
Copy link
Owner

GioF71 commented Nov 16, 2024

Also, why do you build the image? Can't you pull it from docker hub? They are available here

@Pentium82
Copy link

Pentium82 commented Nov 16, 2024

Also, why do you build the image? Can't you pull it from docker hub? They are available here

I had nothing with linux, so sorry.
Read your guide and i think i have to build the docker image to my local. So i can pull it from docker hub directly to the /mopydiyl-tidal folder which i cloned before?

@GioF71
Copy link
Owner

GioF71 commented Nov 16, 2024

hello, you don't even need to clone the repository unless you want to build the image yourself, maybe for developing purpose. I believe considering what you are saying that you can just skip this step and directly use the compose file.
You only need to create a directory, save the content to docker-compose.yaml (or .yml if you prefer) and simply run docker-compose up -d

@GioF71
Copy link
Owner

GioF71 commented Nov 16, 2024

The command docker-compose up -d already pulls the image if it is not available locally.
On your system, it is available because you have built it.
If you want to explicitly download the latest available image, you can execute this:

docker pull giof71/mopidy

which by default will pull the image tagged as "latest" from docker hub.

@Pentium82
Copy link

hello, you don't even need to clone the repository unless you want to build the image yourself, maybe for developing purpose. I believe considering what you are saying that you can just skip this step and directly use the compose file. You only need to create a directory, save the content to docker-compose.yaml (or .yml if you prefer) and simply run docker-compose up -d

Hello, its running now, thank you so much. Can you show me how to configure hires? I made a change in .env and compose file but not successfull

@GioF71
Copy link
Owner

GioF71 commented Nov 17, 2024

Ok, glad it worked. You should simply change

  • TIDAL_QUALITY=LOSSLESS

to

  • TIDAL_QUALITY=HI_RES_LOSSLESS

I assume you have already successfully authenticated. If so, you should just need to execute a docker-compose up -d and you should have hires.

@GioF71
Copy link
Owner

GioF71 commented Nov 17, 2024

If this does not work, try:

docker-compose down
rm data/tidal/tidal-*.json
docker-compose up -d
docker-compose logs -f

When the application has started, you should be presented with something like this:

mopidy-app | INFO     2024-11-17 11:37:31,306 [39:TidalBackend-7 (_actor_loop)] mopidy_tidal.backend
mopidy-app |   Please visit 'http://localhost:8989' or 'https://link.tidal.com/XXXXX' to authenticate

Copy and paste the second link on your browser, authenticate to Tidal, and authorize the new device. This must be done within 300 seconds.

Let me know if this works

@Pentium82
Copy link

Pentium82 commented Nov 17, 2024

After do this:
docker-compose down
rm data/tidal/tidal-*.json
docker-compose up -d
docker-compose logs -f
Just received:
WARN[0000] /root/mopidy-docker/docker-compose.yaml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion

mopidy | Starting GLib mainloop

@GioF71
Copy link
Owner

GioF71 commented Nov 17, 2024

Try to access the application at port 6680 on your browser, the logs should appear!

@Pentium82
Copy link

Ok, its logged in.
Try playing 24bit 48khz track, and check with
cat /proc/asound/card0/pcm0p/sub0/hw_params
access: RW_INTERLEAVED format: S16_LE subformat: STD channels: 2 rate: 48000 (48000/1) period_size: 480 buffer_size: 9600
Is it ok?

@GioF71
Copy link
Owner

GioF71 commented Nov 17, 2024

It seems so. Try a 24/192 album like "Moon Safari" by "Air" (always my test album)

@Pentium82
Copy link

It seems so. Try a 24/192 album like "Moon Safari" by "Air" (always my test album)

access: RW_INTERLEAVED
format: S16_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 1920
buffer_size: 38400

@Pentium82
Copy link

Do you think my sound card just play 16bit

@GioF71
Copy link
Owner

GioF71 commented Nov 17, 2024

Mine (Topping D10) shows this:

access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 1920
buffer_size: 38400

Which dac are you using?

@GioF71
Copy link
Owner

GioF71 commented Nov 17, 2024

Also check the logs, on my container I see:

mopidy-app |   Playback quality: HI_RES_LOSSLESS
mopidy-app | INFO     2024-11-17 17:29:45,068 [39:TidalBackend-7 (_actor_loop)] mopidy_tidal.playback
mopidy-app |   MimeType:application/dash+xml
mopidy-app | INFO     2024-11-17 17:29:45,069 [39:TidalBackend-7 (_actor_loop)] mopidy_tidal.playback
mopidy-app |   Starting playback of track:1477891, (quality:HI_RES_LOSSLESS, codec:FLAC, 24bit/192000Hz)

So the incoming stream is 24bit/192kHz. That's important to check. If yours shows the same, it means that the conversion happens at the alsa level.
With reference to this page, maybe you can enforce 32bit format using:

AUDIO_OUTPUT=format=S24_32LE ! alsasink device=hw:D10
or

AUDIO_OUTPUT=format=S32LE ! alsasink device=hw:D10

@Pentium82
Copy link

Mine (Topping D10) shows this:

access: RW_INTERLEAVED
format: S32_LE
subformat: STD
channels: 2
rate: 192000 (192000/1)
period_size: 1920
buffer_size: 38400

Which dac are you using?

I'm using allo digione, mpd playing 24bit's local file is normal.

@Pentium82
Copy link

Also check the logs, on my container I see:

mopidy-app |   Playback quality: HI_RES_LOSSLESS
mopidy-app | INFO     2024-11-17 17:29:45,068 [39:TidalBackend-7 (_actor_loop)] mopidy_tidal.playback
mopidy-app |   MimeType:application/dash+xml
mopidy-app | INFO     2024-11-17 17:29:45,069 [39:TidalBackend-7 (_actor_loop)] mopidy_tidal.playback
mopidy-app |   Starting playback of track:1477891, (quality:HI_RES_LOSSLESS, codec:FLAC, 24bit/192000Hz)

So the incoming stream is 24bit/192kHz. That's important to check. If yours shows the same, it means that the conversion happens at the alsa level. With reference to this page, maybe you can enforce 32bit format using:

AUDIO_OUTPUT=format=S24_32LE ! alsasink device=hw:D10 or

AUDIO_OUTPUT=format=S32LE ! alsasink device=hw:D10

I will try these setting when i back home. Thanks for all support.

@Pentium82
Copy link

Also check the logs, on my container I see:

mopidy-app |   Playback quality: HI_RES_LOSSLESS
mopidy-app | INFO     2024-11-17 17:29:45,068 [39:TidalBackend-7 (_actor_loop)] mopidy_tidal.playback
mopidy-app |   MimeType:application/dash+xml
mopidy-app | INFO     2024-11-17 17:29:45,069 [39:TidalBackend-7 (_actor_loop)] mopidy_tidal.playback
mopidy-app |   Starting playback of track:1477891, (quality:HI_RES_LOSSLESS, codec:FLAC, 24bit/192000Hz)

So the incoming stream is 24bit/192kHz. That's important to check. If yours shows the same, it means that the conversion happens at the alsa level. With reference to this page, maybe you can enforce 32bit format using:

AUDIO_OUTPUT=format=S24_32LE ! alsasink device=hw:D10 or

AUDIO_OUTPUT=format=S32LE ! alsasink device=hw:D10

I checked the logs, its fine 24bit. But as you said, some thing happens at alsa conversion. The card just show 16bit, I assume gstreamer has because mpd playing 24bit fine.

@GioF71
Copy link
Owner

GioF71 commented Nov 18, 2024

There are lots of resources online about the allo digione, some say that is requires S24_3LE instead of S24_LE and/or S32_LE, but I don't know exactly how to force that as I don't have the same device.
One thing you might try is to use "plughw" instead of "hw", this might allow alsa to convert to the supported format.
Also if mpd work, can you verify how the alsa output is configured? Maybe post "/etc/mpd.conf"

@Pentium82
Copy link

One thing you might try is to use "plughw" instead of "hw", this might allow alsa to convert to the supported format. Also if mpd work, can you verify how the alsa output is configured? Maybe post "/etc/mpd.conf"

You are awesome, everything worked perfectly. Exactly need to use "plughw"

@GioF71
Copy link
Owner

GioF71 commented Nov 18, 2024

awesome! glad it worked!
Can we close the issue?

Please star the repo if you like the work!

@Pentium82
Copy link

awesome! glad it worked! Can we close the issue?

Please star the repo if you like the work!

Yeah, sure

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

3 participants