Skip to content

Commit

Permalink
Merge pull request #14 from pssc/next
Browse files Browse the repository at this point in the history
Instances to 4
  • Loading branch information
pssc authored Jun 22, 2024
2 parents 0572884 + 09fbfc9 commit aa3a68d
Show file tree
Hide file tree
Showing 24 changed files with 880 additions and 0 deletions.
65 changes: 65 additions & 0 deletions squeezelite2/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
## [0.0.19] 2024-05-28
### Changes
- debian base to 7.3.3
- squeezelite to commit 0e85ddfd79337cdc30b7d29922b1d790600bb6b4
- addon config to yaml

## [0.0.18] 2024-01-24
### Changes
- debian base to 7.3.1
- squeezelite to commit 6de9e229aa4cc7c3131ff855f3ead39581127090

## [0.0.17] 2023-08-01
### Changes
- debian base to 7.1.0

## [0.0.16] 2023-07-17
### Changes
- squeezelite to commit 575b59398dd19945d2038474062240fc527407fb
- debian base to 7.0.0

## [0.0.15] 2023-01-29
## Changes
- squeezelite to commit 71832fb3db447b8b89e08ce907247219a18da509
- Trial resample on pulse build (does not work)

## [0.0.14] 2022-04-03
### Changes
- debian base update
- nice -10 default scheduling.

## [0.0.13] 2021-11-18
### Changes
- Better logging options for squeezlite and addon

## [0.0.12] 2021-11-08
### Add
- nice -5 default scheduling.
- Config option for nice value.
- Add extra capacbilties for nice and memory locking for alsa build.
- Add support for pathcing squeezelite and local source

## [0.0.11] 2021-11-01
### Changes
- Improve output, reorder and include device informationi, client name and arch

### Fixes
- Pulse audio build rather than Port Audio
- Squeezelite build options.

### Added
- Support for different builds Port Audio(pa), Pulse Audio(pulse) and Alsa

## [0.0.10] 2021-10-25
### Fixes
- none

### Changes
- Bump to squeezelite to 1.9.9-1391
- Bump to debian addon version 4.2.3

### Added
- Support for alsa and Pulse Audio builds

## [0.0.09] 2021-06-24

64 changes: 64 additions & 0 deletions squeezelite2/DOCS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Squeezelite player for Logitech Media Server on Home Assistant

## Description
Runs the [Squeezelite][squeezelite] player on home assistant.

Squeezelite requires a Logitech Media Server in your network \
Please visit [Logitech Media Server][Logitech Media Server Addon] page to install the server \
(if required).

## Install
1. Add this url to your hass.io addons repos: \
`https://github.com/pssc/ha-hassio-squeezelite`
2. Update addons list.
3. Install Squeezelite.

## How to use
1. Install add-on.
2. Run
3. Update the config with your own options change name in Logitech Media Server.
4. Check add-on logs for possible outputs and supported parameters.

## Direct Hardware Output
1. Run in Protection mode disabled.
2. Run and look in the logs of the addon-on at the audio output list. Note the name of the output you want to use start with the sysdefault:CARD=X
3. On the config tab "Select Show unused optional configuration options"
for output insert the name noted there.
4. Restart addon and check log output

## Config parameters

Default/required Config: none

### Option (optional): `name`
Override name for the player (only English Ascii chars are supported)

### Option (optional): `output`
Audio output device. Please check the log after startup for a list of possible outputs \
defult will typically be the HA pulse audio. Using this option casues the addon to use the alsa build \
rather than the pulse audio build.

### Option (optional): `clientmac`
A "dummy mac" to make the player unique otherwise a random one is generated per install.

### Option (optional): `server`
Host or IP to for squeezelite player to connect otherwise autodiscover will be used.

### Option (optional): `log_level`
Only "none(warn)|warn|notice|info|debug|trace" are valid. These are mapped through to loglevels for squeezelite

### Option (optional): `build`
Selects the squeezelite build to use (overrides switch to alsa on output option use).
Only "pa|pulse|alsa" are valid.

### Option (optional): `nice`
Nice value to start squeezelite with defaults to `-10`.

### Option (optioal): `options`
Passed to squeezelite on startup after above options are processed

## Urls
[Add-on link](https://github.com/pssc/ha-addon-squeezelite/) \
[Logitech Media Server Addon](https://github.com/pssc/ha-addon-lms/) \
[Squeezelite](https://github.com/ralph-irving/squeezelite)

109 changes: 109 additions & 0 deletions squeezelite2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
ARG BUILD_FROM=ghcr.io/hassio-addons/debian-base/aarch64:7.3.3
# hadolint ignore=DL3006
FROM ${BUILD_FROM} AS base

# Set shell
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# Set correct environment variables
ENV DEBIAN_FRONTEND="noninteractive"
ENV LC_ALL="C.UTF-8"
ENV LANG="en_US.UTF-8"
ENV LANGUAGE="en_US.UTF-8"

# Upgrading the operating system inside the container
RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::="--force-confold" && apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

FROM base AS builder
ARG SL_COMMIT=0e85ddfd79337cdc30b7d29922b1d790600bb6b4

# Install Squeezelite
RUN apt-get -qq -y update && \
apt-get --no-install-recommends --no-install-suggests -qq -y install \
alsa-utils \
libasound2-plugins \
libasound2-data \
portaudio19-dev \
libasound2-dev \
libvorbis-dev \
libmad0-dev \
libmpg123-dev \
libfaad-dev \
libsox-dev \
libsoxr-dev \
libavformat-dev \
liblirc-dev \
libssl-dev \
libopusfile-dev \
libflac-dev \
libpulse-dev \
faad \
git \
build-essential
COPY squeezelite /src/
RUN cd /src && if [ ! -r squeezelite/Makefile ]; then git clone https://github.com/ralph-irving/squeezelite && cd squeezelite && git checkout ${SL_COMMIT};fi
COPY patches /src/patches
RUN for i in /src/patches/*.patch;do if [ -r $i ];then patch -d / -p1 -i $i;fi ;done

RUN cd /src/squeezelite && OPTS="-DVISEXPORT -DDSD" make -f Makefile.pa && mv /src/squeezelite/squeezelite-pa /src/squeezelite.pa
RUN cd /src/squeezelite && make clean
RUN cd /src/squeezelite && OPTS="-DVISEXPORT" make -f Makefile.pulse && mv /src/squeezelite/squeezelite-pulse /src/squeezelite.pulse
RUN cd /src/squeezelite && make clean
RUN cd /src/squeezelite && OPTS="-DDSD -DRESAMPLE -DVISEXPORT" make -f Makefile
#RUN cd /tmp && git clone https://github.com/ralph-irving/squeezelite && cd squeezelite && make -f Makefile OPTS="-DDSD"
#RUN if [ -x /tmp//tmp/squeezelite/squeezelite-pa ];then mv /tmp/squeezelite/squeezelite-pa /tmp/squeezelite/squeezelite;fi
# -DOPUS -DALAC -DRESAMPLE -DVISEXPORT -DDSD -DIR -DGPIO -DRPI -DUSE_SSL -DLINKALL -I./include -I./include/opus -I./include/alac

FROM base

ARG BUILD_ARCH
ARG BUILD_DATE
ARG BUILD_REF
ARG BUILD_VERSION

RUN apt-get -qq -y update && \
apt-get --no-install-recommends --no-install-suggests -qq -y install \
openssl \
alsa-utils \
libasound2-plugins \
libasound2-data \
libportaudio2 \
libasound2 \
libvorbis0a \
libmad0 \
libmpg123-0 \
libfaad2 \
libsox3 \
libsoxr0 \
libavformat59 \
liblirc-client0 \
libssl3 \
libopusfile0 \
libflac12 && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /var/run/*

COPY rootfs /
COPY --from=builder /src/squeezelite/squeezelite /usr/local/bin/squeezelite.alsa
COPY --from=builder /src/squeezelite.pulse /usr/local/bin/squeezelite.pulse
COPY --from=builder /src/squeezelite.pa /usr/local/bin/squeezelite.pa

# Labels
LABEL \
io.hass.name="Squeezelite Player" \
io.hass.description="Squeezelite HA Addon player" \
io.hass.arch="${BUILD_ARCH}" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION} \
maintainer="Phillip Camp <[email protected]>" \
org.opencontainers.image.title="Squeezelite" \
org.opencontainers.image.description="Squeezelite HA Addon player" \
org.opencontainers.image.vendor="pssc" \
org.opencontainers.image.authors="Phillip, Adrian & Ralph" \
org.opencontainers.image.licenses="Multiple" \
org.opencontainers.image.url="https://github.com/pssc/ha-addon-lms/" \
org.opencontainers.image.source="https://github.com/pssc/ha-addon-squeezelite/squeezelite/" \
org.opencontainers.image.documentation="https://github.com/pssc/ha-addon-squeezelite/blob/master/squeezelite/DOCS.md" \
org.opencontainers.image.created=${BUILD_DATE} \
org.opencontainers.image.revision=${BUILD_REF} \
org.opencontainers.image.version=${BUILD_VERSION}

33 changes: 33 additions & 0 deletions squeezelite2/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Home Assistant Community Add-on: Squeezelite player

A complete and easy way to run the [Squeezelite][squeezelite] player for [LMS the Lyrion Music Server, formerly the Logitech Media Server on home assistant][lms].

[![Open your Home Assistant instance and show the add add-on repository dialog with a specific repository URL pre-filled.](https://my.home-assistant.io/badges/supervisor_add_addon_repository.svg)](https://my.home-assistant.io/redirect/supervisor_add_addon_repository/?repository_url=https%3A%2F%2Fgithub.com%2Fpssc%2Fha-addon-squeezelite%2F) or use the following addon repo manually https://github.com/pssc/ha-addon-squeezelite/ in the supervisor addon tab following the stacked triple dots and selecting repositories.

![Release][release-shield] ![Project Stage][project-stage-shield] ![Project Maintenance][maintenance-shield]<br>
![Supports i386 Architecture][i386-shield] ![Supports amd64 Architecture][amd64-shield] ![Supports armhf Architecture][armhf-shield] ![Supports armv7 Architecture][armv7-shield] ![Supports aarch64 Architecture][aarch64-shield]

The [Home Assistant Squeezelite Add-on](https://github.com/pssc/ha-addon-squeezelite) allows you to run a [Squeezelite][squeezelite] player local on your home assistant install. \
This addon supports direct hardware acccess of the sound hardware.

[Squeezelite][squeezelite] requires a [Logitech Media Server][lms] in your network \
Please visit [Logitech Media Server Add-on](https://github.com/pssc/ha-addon-lms/) page to install the server (if required).

## Support
Create an [issue on github][issues], or if its a general query ask on the [home assistant thread][forum]

[maintenance-shield]: https://img.shields.io/maintenance/yes/2024.svg
[project-stage-shield]: https://img.shields.io/badge/project%20stage-beta-yellow.svg
[release-shield]: https://img.shields.io/badge/version-v0.19-yellow.svg

[amd64-shield]: https://img.shields.io/badge/amd64-yes-green.svg
[i386-shield]: https://img.shields.io/badge/i386-yes-yellow.svg
[armhf-shield]: https://img.shields.io/badge/armhf-yes-green.svg
[armv7-shield]: https://img.shields.io/badge/armv7-yes-green.svg
[aarch64-shield]: https://img.shields.io/badge/aarch64-yes-green.svg

[squeezelite]: https://github.com/ralph-irving/squeezelite
[lms]: https://forums.slimdevices.com/
[forum]: https://community.home-assistant.io/t/home-assistant-community-addon-logitech-media-server-lms/338137
[issues]: https://github.com/pssc/ha-addon-squeezelite/issues
[discord]: https://discord.me/hassioaddons
9 changes: 9 additions & 0 deletions squeezelite2/build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"build_from": {
"aarch64": "ghcr.io/hassio-addons/debian-base/aarch64:7.3.3",
"amd64": "ghcr.io/hassio-addons/debian-base/amd64:7.3.3",
"armhf": "ghcr.io/hassio-addons/debian-base/armhf:7.3.3",
"armv7": "ghcr.io/hassio-addons/debian-base/armv7:7.3.3",
"i386": "ghcr.io/hassio-addons/debian-base/i386:7.3.3"
}
}
39 changes: 39 additions & 0 deletions squeezelite2/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Squeezelite Clone 2
version: 0.0.19
slug: squeezelite2
description: Squeezelite player for LMS the Lyrion Music Server, formerly the Logitech Media Server on home assistant
url: https://github.com/pssc/ha-addon-squeezelite
startup: services
arch:
- aarch64
- armhf
- armv7
- amd64
- i386
map:
- config:rw
boot: auto
init: false
hassio_api: true
hassio_role: default
apparmor: false
privileged:
- SYS_PTRACE
- SYS_ADMIN
- SYS_NICE
- IPC_LOCK
host_network: true
udev: true
audio: true
full_access: true
stage: experimental
options: {}
schema:
log_level: list(error|warning|notice|info|debug|trace)?
build: list(pa|alsa|pulse)?
server: str?
output: str?
name: str?
nice: int?
options: str?
clientmac: str?
Binary file added squeezelite2/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added squeezelite2/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file added squeezelite2/patches/.gitignore
Empty file.
13 changes: 13 additions & 0 deletions squeezelite2/rootfs/etc/services.d/squeezelite/finish
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/command/with-contenv bashio
# shellcheck shell=bash
# ==============================================================================
# Take down the S6 supervision tree when service fails
# s6-overlay docs: https://github.com/just-containers/s6-overlay
# ==============================================================================

if [[ "$1" -ne 0 ]] && [[ "$1" -ne 256 ]]; then
bashio::log.warning "Halt add-on"
exec /run/s6/basedir/bin/halt
fi

bashio::log.info "Service restart after closing"
Loading

0 comments on commit aa3a68d

Please sign in to comment.