Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .editorconfig
100755 → 100644
Empty file.
33 changes: 2 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@ LABEL maintainer="thespad"
ENV DEBIAN_FRONTEND="noninteractive" \
TMPDIR="/run/piper-temp"

RUN --mount=type=bind,source=/patch,target=/patch \
RUN \
apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
cmake \
git \
pkg-config \
patch \
python3-venv && \
if [ -z ${PIPER_VERSION+x} ]; then \
PIPER_VERSION=$(curl -sL https://pypi.python.org/pypi/wyoming-piper/json |jq -r '. | .info.version'); \
Expand All @@ -36,34 +31,10 @@ RUN --mount=type=bind,source=/patch,target=/patch \
nvidia-cufft-cu12 \
nvidia-curand-cu12 \
onnxruntime-gpu \
piper-tts \
"wyoming-piper==${PIPER_VERSION}" && \
if [ -z ${PIPER_BIN_VERSION+x} ]; then \
PIPER_BIN_VERSION=$(curl -sL "https://api.github.com/repos/rhasspy/piper/commits/master" \
| jq -r .sha); \
fi && \
mkdir -p /tmp/piper-build /usr/share/piper && \
curl -sL -o \
/tmp/piper.tar.gz -L \
"https://github.com/rhasspy/piper/archive/${PIPER_BIN_VERSION}.tar.gz" && \
tar xzf \
/tmp/piper.tar.gz -C \
/tmp/piper-build --strip-components=1 && \
cd /tmp/piper-build && \
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=install && \
cmake --build build --config Release && \
cmake --install build && \
cp -dR /tmp/piper-build/install/* /usr/share/piper && \
patch /lsiopy/lib/python3.12/site-packages/wyoming_piper/__main__.py < /patch/__main__.patch && \
patch /lsiopy/lib/python3.12/site-packages/wyoming_piper/process.py < /patch/process.patch && \
printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \
echo "**** cleanup ****" && \
apt-get purge -y \
build-essential \
cmake \
git \
pkg-config && \
apt-get autoremove -y && \
apt-get clean -y && \
rm -rf \
/var/lib/apt/lists/* \
/tmp/*
Expand Down
4 changes: 2 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ pipeline {
PR_DOCKERHUB_IMAGE = 'lspipepr/piper'
DIST_IMAGE = 'ubuntu'
MULTIARCH='false'
CI='false'
CI='true'
CI_WEB='false'
CI_DELAY='120'
CI_DOCKERENV=''
CI_DOCKERENV='PIPER_VOICE=en_US-lessac-medium'
CI_AUTH=''
CI_WEBPATH=''
}
Expand Down
Empty file modified LICENSE
100755 → 100644
Empty file.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ Find us at:
[![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/piper.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/piper)
[![Docker Stars](https://img.shields.io/docker/stars/linuxserver/piper.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/piper)
[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-piper%2Fjob%2Fgpu%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-piper/job/gpu/)
[![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2Fpiper%2Fgpu%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/piper/gpu/index.html)

[Piper](https://github.com/rhasspy/piper/) is a fast, local neural text to speech system that sounds great and is optimized for the Raspberry Pi 4. This container provides a Wyoming protocol server for Piper.

Expand Down Expand Up @@ -94,11 +95,12 @@ services:
- PGID=1000
- TZ=Etc/UTC
- PIPER_VOICE=en_US-lessac-medium
- LOCAL_ONLY= #optional
- PIPER_LENGTH=1.0 #optional
- PIPER_NOISE=0.667 #optional
- PIPER_NOISEW=0.333 #optional
- PIPER_SPEAKER=0 #optional
- PIPER_PROCS=1 #optional
- STREAMING= #optional
volumes:
- /path/to/piper/data:/config
ports:
Expand All @@ -115,11 +117,12 @@ docker run -d \
-e PGID=1000 \
-e TZ=Etc/UTC \
-e PIPER_VOICE=en_US-lessac-medium \
-e LOCAL_ONLY= `#optional` \
-e PIPER_LENGTH=1.0 `#optional` \
-e PIPER_NOISE=0.667 `#optional` \
-e PIPER_NOISEW=0.333 `#optional` \
-e PIPER_SPEAKER=0 `#optional` \
-e PIPER_PROCS=1 `#optional` \
-e STREAMING= `#optional` \
-p 10200:10200 \
-v /path/to/piper/data:/config \
--restart unless-stopped \
Expand All @@ -137,11 +140,12 @@ Containers are configured using parameters passed at runtime (such as those abov
| `-e PGID=1000` | for GroupID - see below for explanation |
| `-e TZ=Etc/UTC` | specify a timezone to use, see this [list](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones#List). |
| `-e PIPER_VOICE=en_US-lessac-medium` | The [Piper voice](https://huggingface.co/rhasspy/piper-voices/tree/main) to use, in the format `<language>-<name>-<quality>` |
| `-e LOCAL_ONLY=` | If set to `true`, or any other value, the container will not attempt to download models from HuggingFace and will only use locally-provided models. |
| `-e PIPER_LENGTH=1.0` | Voice speaking rate, 1.0 is default with < 1.0 being faster and > 1.0 being slower. |
| `-e PIPER_NOISE=0.667` | Controls the variability of the voice by adding noise. Values above 1 will start to degrade audio. |
| `-e PIPER_NOISEW=0.333` | Controls the variability of speaking cadence. Values above 1 produce extreme stutters and pauses. |
| `-e PIPER_SPEAKER=0` | Speaker number to use if the voice supports multiple speakers. |
| `-e PIPER_PROCS=1` | Number of Piper processes to run simultaneously. |
| `-e STREAMING=` | Setting to `true`, or any other value, will enable support for streaming audio on sentence boundaries. |
| `-v /config` | Local path for piper config files. |
| `--read-only=true` | Run container with a read-only filesystem. Please [read the docs](https://docs.linuxserver.io/misc/read-only/). |

Expand Down Expand Up @@ -307,6 +311,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64

## Versions

* **29.08.25:** - Add streaming support & support for local only mode.
* **26.11.24:** - Add GPU branch.
* **18.07.24:** - Rebase to Ubuntu Noble.
* **25.11.23:** - Initial Release.
4 changes: 2 additions & 2 deletions jenkins-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ repo_vars:
- PR_DOCKERHUB_IMAGE = 'lspipepr/piper'
- DIST_IMAGE = 'ubuntu'
- MULTIARCH='false'
- CI='false'
- CI='true'
- CI_WEB='false'
- CI_DELAY='120'
- CI_DOCKERENV=''
- CI_DOCKERENV='PIPER_VOICE=en_US-lessac-medium'
- CI_AUTH=''
- CI_WEBPATH=''
14 changes: 0 additions & 14 deletions patch/__main__.patch

This file was deleted.

12 changes: 0 additions & 12 deletions patch/process.patch

This file was deleted.

4 changes: 3 additions & 1 deletion readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ param_ports:
# optional container parameters
opt_param_usage_include_env: true
opt_param_env_vars:
- {env_var: "LOCAL_ONLY", env_value: "", desc: "If set to `true`, or any other value, the container will not attempt to download models from HuggingFace and will only use locally-provided models."}
- {env_var: "PIPER_LENGTH", env_value: "1.0", desc: "Voice speaking rate, 1.0 is default with < 1.0 being faster and > 1.0 being slower."}
- {env_var: "PIPER_NOISE", env_value: "0.667", desc: "Controls the variability of the voice by adding noise. Values above 1 will start to degrade audio."}
- {env_var: "PIPER_NOISEW", env_value: "0.333", desc: "Controls the variability of speaking cadence. Values above 1 produce extreme stutters and pauses."}
- {env_var: "PIPER_SPEAKER", env_value: "0", desc: "Speaker number to use if the voice supports multiple speakers."}
- {env_var: "PIPER_PROCS", env_value: "1", desc: "Number of Piper processes to run simultaneously."}
- {env_var: "STREAMING", env_value: "", desc: "Setting to `true`, or any other value, will enable support for streaming audio on sentence boundaries."}
readonly_supported: true
# application setup block
app_setup_block_enabled: true
Expand Down Expand Up @@ -85,6 +86,7 @@ init_diagram: |
"piper:gpu" <- Base Images
# changelog
changelogs:
- {date: "29.08.25:", desc: "Add streaming support & support for local only mode."}
- {date: "26.11.24:", desc: "Add GPU branch."}
- {date: "18.07.24:", desc: "Rebase to Ubuntu Noble."}
- {date: "25.11.23:", desc: "Initial Release."}
14 changes: 10 additions & 4 deletions root/etc/s6-overlay/s6-rc.d/svc-piper/run
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,25 @@ for dir in "${NVIDIA_PACKAGE_DIR}"/*; do
fi
done

unset UPDATE_MODELS

if [[ -z ${LOCAL_ONLY} ]]; then
UPDATE_MODELS=true
fi

LD_LIBRARY_PATH="/lsiopy/lib/python3.12/site-packages/onnxruntime/capi:$LD_LIBRARY_PATH"

exec \
s6-notifyoncheck -d -n 300 -w 1000 -c "nc -z localhost 10200" \
s6-setuidgid abc python3 -m wyoming_piper \
--piper '/usr/share/piper/piper' \
--uri 'tcp://0.0.0.0:10200' \
--length-scale "${PIPER_LENGTH:-1.0}" \
--noise-scale "${PIPER_NOISE:-0.667}" \
--noise-w "${PIPER_NOISEW:-0.333}" \
--speaker "${PIPER_SPEAKER:-0}" \
--voice "${PIPER_VOICE}" \
--max-piper-procs "${PIPER_PROCS:-1}" \
--data-dir /config \
--download-dir /config --update-voices \
--cuda
--download-dir /config \
--use-cuda \
${UPDATE_MODELS:+--update-voices} \
${STREAMING:+--streaming}