Select codec for the Snapcast Server in hydra.private.json
Medel opened this issue · 5 comments
I use an ESP32 as Snapcast client, but it has only the opus codec.
Can you try to get it running by changing
https://github.com/mariolukas/HydraPlay/blob/master/src/hydraplay/config/templates/mopidy.conf.j2#L21
and/or
https://github.com/mariolukas/HydraPlay/blob/master/src/hydraplay/config/templates/mopidy.conf.j2#L18
Maybe it would work with:
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! opusenc ! tcpclientsink host=127.0.0.1 port={{ tcp_port |int + stream_id |int }}
I will add codec selection to the config if you can confirm that it works.
The codec has to be change in snapcast.conf
This change in snapcast.conf works with ESP32 opus codec without hydraplay:
...
# Default transport codec
# (flac|ogg|opus|pcm)[:options]
# Type codec:? to get codec specific options
codec = opus
...
Ok fine. Can you prove if it works when you use it here
https://github.com/mariolukas/HydraPlay/blob/master/src/hydraplay/config/templates/snapserver.conf.j2#L89
Your first recommendation does not work
output = audioresample ! audioconvert ! audio/x-raw,rate=48000,channels=2,format=S16LE ! opusenc ! tcpclientsink host=127.0.0.1 port={{ tcp_port |int + stream_id |int }}
But the second one works