https://github.com/banool/amaranta_record
https://github.com/banool/amaranta_record
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/banool/amaranta_record
- Owner: banool
- Created: 2021-01-25T07:18:19.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-04-10T21:28:23.000Z (about 3 years ago)
- Last Synced: 2025-03-14T23:43:22.296Z (over 1 year ago)
- Language: Python
- Size: 28.3 KB
- Stars: 0
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Amaranta Record
Code and configs related to our record player setup at Amaranta.
Read on for a guide on how to set this up.
## Install dependencies
First, install these:
- Python 3.7 (pip and virtualenv)
- ices2
- icecast
```
sudo apt install python3-pip python3-venv ices2 icecast2
```
If prompted, do not configure icecast2, we will use our own files.
## Copy code into server
You can copy this full repo over into the server like this:
```
./copy.sh dport@pi
```
## Set up virtual env
In the server:
```
cd /opt/amaranta_record
python3 -m venv myvenv --system-site-packages
. myvenv/bin/activate
pip install -r requirements.txt
```
We use `--system-site-packages` because on the Raspberry Pi, some packages are already installed at the system level, e.g. gpiozero.
## Copy configs
Move the following files in `configs/` into place:
- ices.xml -> /etc/ices.xml
- icecast.xml -> /etc/icecast2/icecast.xml
- amaranta_record.service -> /etc/systemd/system/amaranta_record.service
- icecast.service -> /etc/systemd/system/icecast.service
## Update configs
You'll have to update `/etc/ices.xml` to use the correct audio input. So instead of `hw:1,0` it might be `hw:3,0`. You can figure it out by using this command: `aplay -l`.
## Start the service
Do this once you've copied all the config files in.
```
sudo mkdir -p /var/log/icecast2
sudo mkdir -p /var/log/ices
sudo chown nobody:nogroup /var/log/icecast2/
```
```
sudo systemctl daemon-reload
```
```
sudo systemctl enable amaranta_record
sudo systemctl start amaranta_record
```
```
sudo systemctl enable icecast
sudo systemctl start icecast
```
Done!
---
This section contains helpful tips for debugging / production.
## Discovering cast destinations
To find cast destinations do this. First, open up a python shell in the virtual environment. Then:
```
import pychromecast
services, browser = pychromecast.discovery.discover_chromecasts()
```
## Production
To check what's going on (look at the logs) run these:
```
# ices2
cat /var/log/ices/ices.log
# icecast
sudo journalctl -u icecast -f
# amaranta_record script
sudo journalctl -u amaranta_record -f
```