GioF71 / upmpdcli-docker

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

[QUESTION] /waiting #423

Closed fr2lancer closed 2 weeks ago

fr2lancer commented 2 weeks ago

Describe the bug Actually it might not a bug. I more likely I want to know this.

I have setup this docker on top of the moode audio. And let uprcl read my local(same as moode audio resides) directory's sound files and activate upnp renderer on moode audio. And it seems to working fine with mconnect. (good!)

And there is playlist remains in the UI of moode after playing. and it displays as

image

It is okay as moode audio dropped function of browsing of upnp.

However I wanted to know where '/waiting' url has been given to moode audio? I can't find it in the source code of moode audio and I also can't find in it.

python3 /usr/share/upmpdcli/cdplugins/uprcl/uprcl-app.py inside of the docker.

I made connection 9090 through docker by opening port in docker-compose and UPRCL_HOSTPORT=localhost:9090 in it. when I test it with curl localhost:9090. it was able to check networking was going in it.

Is that a protocol of upnp?

or uprcl didn't complete the implementation of all of upnp(if it needed)?

Thank you.

% I found this after this ticket - 'cache/metacache' file has this content. where this xml came from ..?


cache/metacache:http://192.168.1.23:9090/waiting=<?xml version%3D"1.0" encoding%3D"utf-8"?><DIDL-Lite xmlns:dc%3D"http://purl.org/dc/elements/1.1/
" xmlns:upnp%3D"urn:schemas-upnp-org:metadata-1-0/upnp/" xmlns%3D"urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dlna%3D"urn:schemas-dlna-org
:metadata-1-0/"><item id%3D"mpdid:16427" parentID%3D"0" restricted%3D"1" searchable%3D"0"><dc:title>Initializing...</dc:title><orig>mpd</orig><upn
p:class>object.item.audioItem.musicTrack</upnp:class><res>http://192.168.1.23:9090/waiting</res></item></DIDL-Lite>

Operating system(please complete the following information):

GioF71 commented 2 weeks ago

Hello, can you post your docker-compose file or docker-run command? Thank you

GioF71 commented 2 weeks ago

From what I see without the compose file, it looks to me that "UPRCL_HOSTPORT=localhost:9090" is not ok, because probably a request with the ip address would not be served. Maybe replace it with your "192.168.1.23:9090"

fr2lancer commented 2 weeks ago
version: "3"                                                                                                                                      
services:                                                                                                                                         
  upmdcli:                                                                                                                                        
    image: giof71/upmpdcli                                                                                                                        
    container_name: upmpdcli-library                                                                                                              
    network_mode: host                                                                                                                            
    environment:                                                                                                                                  
    - PORT_OFFSET=0                                                                                                                               
    - PUID=1000                                                                                                                                   
    - PGID=1000                                                                                                                                   
    - RENDERER_MODE=BOTH                                                                                                                          
    - UPRCL_ENABLE=yes                                                                                                                            
    - UPRCL_USER=upmmpdcli-library                                                                                                                
    - UPRCL_AUTOSTART=1                                                                                                                           
    - UPRCL_HOSTPORT=localhost:9090                                                                                                               
    ports:                                                                                                                                        
    - "9090:9090"            #it seems to not useful when  network_mode: host                                                                                                    
    volumes:                                                                                                                                      
    - ./cache:/cache                                                                                                                              
    - ./log:/log                                                                                                                                  
    - /media/103F0F09103F0F09/:/uprcl/mediadirs/                                                                                                  
#- ./config/uprclconfdir:/urpcl/confdir                                                                                                           
#- ./config/upmpdcli/additional-radio.txt:/user/config/additional-radio.txt                                                                       
    labels:                                                                                                                                       
    - com.centurylinklabs.watchtower.enable=false                                                                                                 
    restart: unless-stopped 

/usr/share/upmpdcli/cdplugins/uprcl/uprcl-app.py : seems like listing 9090 port

UPRCL_HOSTPORT=localhost:9090 -> UPRCL_HOSTPORT=192.168.1.23:9090 I tried this :

curl 192.168.1.23:9090/waiting -> 404
curl 192.168.1.23:9090/

->
<html>                                                                                                                                            
<head>                                                                                                                                            
    <title>Upmdcli Media Server Ready</title>                                                                                                     
    <link rel="stylesheet" type="text/css" href="static/style.css">                                                                               
</head>                                                                                                                                           
<body>                                                                                                                                            

<div id="fade"></div>                                                                                                                             
<div id="results">                                                                                                                                

<h3>UpMpd-mediaserver is Ready</h3>                                                                                                               
<form action="" method="post">                                                                                                                    
<input type="submit" name="what" value="Refresh Status"><br/>                                                                                     
<input type="submit" name="what" value="Update Index"><br/>                                                                                       
<input type="submit" name="what" value="Reset Index"                                                                                              
       onclick="return confirm('Rebuilding the index may take a long time. Confirm ?');"><br/>                                                    

</div>                                                                                                                                            
</div>                                                                                                                                            

</body>                                                                                                                                           
</html> 
GioF71 commented 2 weeks ago

Hello, I have reviewed the compose file. Here:

---
version: "3"

services:
  upmpdcli:
    image: giof71/upmpdcli
    container_name: upmpdcli-library
    network_mode: host
    environment:
      - PORT_OFFSET=0
      - PUID=1000
      - PGID=1000
      - MEDIA_SERVER_FRIENDLY_NAME=Moode Library
      - RENDERER_MODE=NONE
      - UPRCL_ENABLE=yes
      - UPRCL_USER=upmpdcli-library
      - UPRCL_AUTOSTART=1
      - UPRCL_HOSTPORT=192.168.1.23:9090
    volumes:
      - ./cache:/cache
      - ./log:/log
      - /media/103F0F09103F0F09:/uprcl/mediadirs
    labels:
      - com.centurylinklabs.watchtower.enable=false
    restart: unless-stopped 

You probably get that "waiting" response because uprcl is indexing your files. How many files are in that drive? Anyway you can access a small page that allows you to monitor the library indexing status opening the url http://192.168.1.23:9090 on your browser. It should look like the following:

image

Consider the following:

UPRCL_HOSTPORT This is optional, the value is calculated automatically by the startup script by default, in your (and my) case it should not be needed and the page should be available anyway, allowing you to avoid to add an IP number to your compose file. I removed it in my file and I confirm that it worked.

RENDERER_MODE=NONE you already have the Moode's built-in upmpdcli operating as a renderer, so you probably won't need another one fighting for the same mpd instance. Unless you want to create an additional mpd install, but in that case you would have to specify MPD_HOST and/or MPD_PORT.

You can optionally set a MEDIA_SERVER_FRIENDLY_NAME. In my example I set it to "Moode Library".

And yes, exposing ports has no effect when using host networking. This is required for upmpdcli in order to allow the media server and/or renderer to be discoverable over the network.

With this configuration (just changed the path for music) I was able to stream to moode itself as well as another renderer. Let me know if this helps.

GioF71 commented 2 weeks ago

One more thing (cit.), you should map the uprcl config directory in order to persist the library database.

---
version: "3"
services:
  upmpdcli:
    image: giof71/upmpdcli
    container_name: upmpdcli-library
    network_mode: host
    environment:
      - PORT_OFFSET=0
      - PUID=1000
      - PGID=1000
      - MEDIA_SERVER_FRIENDLY_NAME=Moode Library
      - RENDERER_MODE=NONE
      - UPRCL_ENABLE=yes
      - UPRCL_USER=upmpdcli-library
      - UPRCL_AUTOSTART=1
      - UPRCL_HOSTPORT=192.168.1.23:9090
    volumes:
      - ./cache:/cache
      - ./log:/log
      - /media/103F0F09103F0F09:/uprcl/mediadirs
      - ./uprclconfdir:/uprcl/confdir
    labels:
      - com.centurylinklabs.watchtower.enable=false
    restart: unless-stopped 

I am referencing a ./uprclconfdir from the path of the compose file, but you can put it where you want or use a docker volume. If you mount a directory, be careful with its permissions, it must be readable/writable by user with uid=1000 and gid=1000 considering the values in your compose file. Mind the spelling of "uprcl" :-)

GioF71 commented 2 weeks ago

Hello, did this work for you?

fr2lancer commented 2 weeks ago

Hi yes it is working now. Thank you so much.

GioF71 commented 2 weeks ago

Good to know, thank you. I have added the uprcl configuration here so other users might find it easier to implement. Please consider starring the repo if you like the work!