1activegeek / docker-airconnect

AirConnect container for turning Chromecast into Airplay targets
228 stars 27 forks source link

Doesn't read config files #12

Closed oskarlindell closed 4 years ago

oskarlindell commented 4 years ago

I am using docker-airconnect on a Synology and have the following environmental variables set:

AIRUPNP_VAR = -x /config/airupnp.xml AIRCAST_VAR = -x /config/aircast.xml

/config is mapped to a directory outside docker where I keep the xml-files and I have verified that it's available inside the docker container.

However, on start the above xml-files don't seem to be applied. I have tried changing settings in them (changing the names of speakers for example) but nothing happens.

1activegeek commented 4 years ago

@oskarlindell

oskarlindell commented 4 years ago

Sure, here is the log from today:

1activegeek-airconnect1.csv.zip

I've only tried it today. Can get it up and running but would like to make some adjustments in the config files.

Here is the aircast config file. The only thing I've done is to change the name of the speaker:

<?xml version="1.0"?>
<aircast>
<common>
<enabled>1</enabled>
<stop_receiver>0</stop_receiver>
<media_volume>0.5000</media_volume>
<latency></latency>
<drift>0</drift>
<codec>flc</codec>
<metadata>1</metadata>
<artwork></artwork>
</common>
<main_log>info</main_log>
<cast_log>info</cast_log>
<util_log>warn</util_log>
<log_limit>-1</log_limit>
<device>
<udn>REMOVED</udn>
<name>V-rum soundbar</name>
<mac>REMOVED</mac>
<enabled>1</enabled>
</device>
</aircast>
1activegeek commented 4 years ago

I would check to validate your docker run command is correct? I don't see any issue testing the example you provided here. I first had the process provide a sample xml, then took that xml and customized the name of my Kitchen Speaker from Kitchen Speaker+ to Kitchen SPEAKER. Only thing I didn't supply below is a screenshot of the speaker showing up on my network appropriately, but this did in fact work correctly.

Sample config.xml:

<?xml version="1.0"?>
<aircast>
<common>
<enabled>1</enabled>
<stop_receiver>0</stop_receiver>
<media_volume>0.5000</media_volume>
<latency></latency>
<drift>0</drift>
<codec>flc</codec>
<metadata>1</metadata>
<artwork></artwork>
</common>
<main_log>info</main_log>
<cast_log>info</cast_log>
<util_log>warn</util_log>
<log_limit>-1</log_limit>
<device>
<udn>xxxxxxxxxxxxx</udn>
<name>Kitchen SPEAKER</name>
<mac>xx:xx:xx:xx</mac>
<enabled>1</enabled>
</device>
</aircast>

Docker create command (can use run with -d obviously):

docker create --name='airconnect' --net='host' -e TZ="America/New_York" -e HOST_OS="Unraid" -e 'AIRCAST_VAR'='-x /config/aircast.xml' -v '/mnt/user/appdata/airconfig.xml':'/config/aircast.xml':'rw' '1activegeek/airconnect'

Running service:

2020-04-20 10:42:15,807 INFO supervisord started with pid 250
2020-04-20 10:42:16,808 INFO spawned: 'airupnp-x86-64' with pid 261
2020-04-20 10:42:16,808 INFO spawned: 'aircast-x86-64' with pid 262
2020-04-20 10:42:17,923 INFO success: airupnp-x86-64 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2020-04-20 10:42:17,923 INFO success: aircast-x86-64 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)

PS Aux inside the container:

root@atlantis:/# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0    204     4 ?        Ss   10:42   0:00 s6-svscan -t0 /var/run/s6/services
root        31  0.0  0.0    204     4 ?        S    10:42   0:00 s6-supervise s6-fdholderd
root       240  0.0  0.0    204     4 ?        S    10:42   0:00 s6-supervise airconnect
root       243  0.0  0.0  20048  3468 ?        Ss   10:42   0:00 bash ./run
root       250  0.3  0.0  56452 20488 ?        S    10:42   0:00 /usr/bin/python /usr/bin/supervisord --nodaemon --configuration /etc/supervisord.conf
root       261  0.0  0.0 842280  4376 ?        Sl   10:42   0:00 /bin/airupnp-x86-64 -l 1000:2000
root       262  0.0  0.0 225720  5424 ?        Sl   10:42   0:00 /bin/aircast-x86-64 -x /config/aircast.xml
root       317  0.3  0.0  20180  3940 pts/0    Ss   10:42   0:00 bash
root       326  0.0  0.0  36076  3432 pts/0    R+   10:42   0:00 ps aux
oskarlindell commented 4 years ago

Thank you @1activegeek! Using your command line Docker create command I got it up and running and it does read the config files.

Comparing this container to the one I created earlier (using Synology's Docker GUI tools, not the command line), the only difference I can find is that the command line created the volume at "/docker/airconnect/" and Synology's GUI created it at "/docker/airconnect", that is without a trailing slash (/). Could this somehow be causing it?

1activegeek commented 4 years ago

Good to hear. I'll close this issue as resolved. Very likely that is the issue. Without looking at the specifics of your setup and diving into the details of how the Synology GUI builds the commands, I'd wager a bet it was in the run command being used. Since I had no issue, and you had no issue mimicking my command, this would lead me to conclude the command was the issue.

Enjoy AirPlaying!!