GioF71 / mopidy-docker

Run Mopidy in Docker
MIT License
1 stars 0 forks source link

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

Open Andy-Voigt opened 1 month ago

Andy-Voigt commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

which user are you using? try:

id

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

Andy-Voigt commented 1 month ago

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

GioF71 commented 1 month ago

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 commented 1 month ago

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

GioF71 commented 1 month ago

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 commented 1 month ago

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 commented 1 month ago

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