Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
4bc5fa8
Initial commit: installer + pinout + docs
Feb 9, 2026
6cdca90
update
Feb 9, 2026
a29efb8
Update README.md
xtreamx2 Feb 9, 2026
2f4b7a8
Update configure_camilladsp.sh
xtreamx2 Feb 9, 2026
436b050
Update install_packages.sh
xtreamx2 Feb 9, 2026
9c26695
Update install_python.sh
xtreamx2 Feb 9, 2026
62e1652
Update install.sh
xtreamx2 Feb 9, 2026
500413a
update
Feb 9, 2026
50aef48
update
Feb 9, 2026
5fc09d7
update
Feb 9, 2026
104afc6
update
Feb 9, 2026
01e589c
update
Feb 9, 2026
421e80e
update
Feb 9, 2026
96e00d0
update
Feb 9, 2026
fdb7cfa
update
Feb 9, 2026
87935d4
update
Feb 9, 2026
4aa0977
update
Feb 9, 2026
a195a67
update
Feb 9, 2026
9861af8
update
Feb 9, 2026
433e4f7
update
Feb 9, 2026
2e78817
update
Feb 9, 2026
47123f3
update
Feb 9, 2026
3f79bd4
update
Feb 9, 2026
494748e
update
Feb 9, 2026
f5b92bd
update
Feb 9, 2026
b09c8b8
update
Feb 10, 2026
d561692
update
Feb 10, 2026
317925a
update
Feb 10, 2026
42aa61b
update
Feb 10, 2026
ab66b60
update
Feb 10, 2026
8e33bcf
Update install.sh
xtreamx2 Feb 10, 2026
6f7be72
OLED fix
Feb 10, 2026
3b00088
OLED fix
Feb 10, 2026
035ea4a
Installer fix
Feb 10, 2026
b758250
Installer fix
Feb 10, 2026
fc23f7a
Installer fix
Feb 10, 2026
c22a271
encoder fix
Feb 10, 2026
d53ac92
encoder fix
Feb 10, 2026
c86865f
add MPD
Feb 10, 2026
c841d4c
add menu OLED
Feb 10, 2026
926a4b8
add menu OLED
Feb 10, 2026
74e086b
fix font
Feb 10, 2026
f3badc5
fix font
Feb 10, 2026
60814ab
fix encoder and oled
Feb 10, 2026
738dd0b
fix encoder and oled
Feb 10, 2026
456a3d9
fix encoder and oled
Feb 10, 2026
fe6d6c1
fix encoder and oled
Feb 10, 2026
bf99ff7
Update config-radio.json
xtreamx2 Feb 10, 2026
5896995
add web server
Feb 10, 2026
481ad06
Update install_python.sh
xtreamx2 Feb 10, 2026
f42323c
Update app.py
xtreamx2 Feb 10, 2026
8fcb34d
Update install.sh
xtreamx2 Feb 10, 2026
2155bf6
Update install.sh
xtreamx2 Feb 10, 2026
ad22a0a
Update install.sh
xtreamx2 Feb 10, 2026
a60d118
Update install.sh
xtreamx2 Feb 10, 2026
3f052d2
Update install.sh
xtreamx2 Feb 10, 2026
3f3e9f1
Update oled.py
xtreamx2 Feb 10, 2026
e363295
Update config-radio.json
xtreamx2 Feb 10, 2026
6970416
fix bug
Feb 11, 2026
d5f2781
Add EQ
Feb 11, 2026
22fd0ac
Add EQ
Feb 11, 2026
7c9c0b0
Add EQ
Feb 11, 2026
1d2a9ac
Add EQ
Feb 11, 2026
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
39 changes: 39 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Changelog — Raspberry Pi Audio Streamer

Format zgodny z [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
Wersjonowanie zgodne z `0.xxx` (pre‑alpha).

---

## [0.011a] - 2026-02-11
### Dodano
- EQ
- Web server na porcie 8080

###
- nadal problemy z Enkoderem i EQ

## [0.010a] — 2026‑02‑10
### Dodano
- Utworzono pełną strukturę projektu (`audio/`, `ui/`, `hardware/`, `utils/`, `scripts/`).
- Dodano instalator `install.sh` z wyborem trybu (instalacja/aktualizacja).
- Dodano logger z przełącznikiem `ENABLE_LOGGER`.
- Dodano inteligentne wykrywanie sprzętu (DAC, OLED, BT, Wi‑Fi).
- Dodano bezpieczne restartowanie usług (tylko jeśli istnieją).
- Dodano komplet skryptów instalacyjnych w `scripts/`.

### Zmieniono
- kompletnie przebudowano projekt od nowa
- Uproszczono logikę instalatora — jedno pytanie na start.
- Ujednolicono komunikaty instalatora (OK / WARN / ERROR).

### Znane problemy
- Brak pełnej konfiguracji CamillaDSP (placeholder).
- Brak usługi OLED (zostanie dodana po implementacji UI).

---

## [0.000] — 2026‑02‑01
### Start projektu
- Utworzenie repozytorium.
- Wstępne założenia funkcjonalne.
24 changes: 19 additions & 5 deletions Docs/Pinout.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Pinout – Streamer v0.07a1 (wersja minimalna)
# Pinout – Streamer v0.010a1 (wersja minimalna)

## Raspberry Pi – sygnały krytyczne

Expand All @@ -8,19 +8,33 @@
| I2C SCL (OLED) | 3 | 5 | I2C | jw. |
| GND | — | 6 | Masa | Wspólna masa |
| 1-Wire (DS18B20) | 4 | 7 | 1-Wire | Czujniki temperatury |
| Enkoder A | 17 | 11 | GPIO | Enkoder 1 – sygnał A |
| Enkoder B | 27 | 13 | GPIO | Enkoder 1 – sygnał B |
| Enkoder SW | 22 | 15 | GPIO | Klik enkodera |
| Enkoder A | 24 | 18 | GPIO | Enkoder 1 – sygnał A |
| Enkoder B | 23 | 16 | GPIO | Enkoder 1 – sygnał B |
| Enkoder SW | 13 | 33 | GPIO | Klik enkodera |
| IR odbiornik | 25 | 22 | GPIO | TSOP / VS1838B |
| GND | — | 9/14/20/25 | Masa | Użyj kilku dla stabilności |

Pin GPIO Funkcja
29 GPIO5 BTN_POWER
31 GPIO6 BTN_STOP
32 GPIO12 BTN_PLAY/PAUSE
35 GPIO19 BTN_NEXT
37 GPIO26 BTN_PREV


Pin GPIO Kolor
36 GPIO16 LED_R
38 GPIO20 LED_G
40 GPIO21 LED_B
Każdy kolor przez rezystor 150–330 Ω.

## OLED
- Magistrala I2C (SDA/SCL)
- Adres: 0x3C

## MPD
- Standardowa konfiguracja `/etc/mpd.conf`
- Upewnić się, że `/etc/default/mpd` zawiera:
- Upewnić się, że `/etc/default/mpd` zawiera:
`MPDCONF=/etc/mpd.conf`

## Rezerwa
Expand Down
4 changes: 2 additions & 2 deletions Docs/Roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Ten dokument opisuje plan rozwoju projektu w kolejnych etapach wersjonowania.
Każda główna gałąź wersji ma jasno określony cel, zakres oraz oczekiwany poziom stabilności.

v0.07a1 – aktualny etap
v0.010a1 – aktualny etap
Pierwsza faza implementacji funkcjonalności wejściowych.
W tej wersji pojawia się obsługa enkodera (A/B/SW), integracja z MPD oraz stabilizacja OLED.

Expand Down Expand Up @@ -164,4 +164,4 @@ finalized enclosure,

complete documentation.

This is the first public release of the project.
This is the first public release of the project.
38 changes: 24 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<<<<<<< HEAD
# Streamer Audio – Raspberry Pi I2S DAC + OLED

Streamer Audio to otwarto‑źródłowy projekt odtwarzacza audio opartego na Raspberry Pi, z obsługą:
Expand Down Expand Up @@ -62,22 +61,33 @@ Projekt jest rozwijany z naciskiem na:
### Instalacja przez `curl`

```bash
curl -s https://gitlab.com/aloisy/streamer/-/raw/master/start_install.sh -o install.sh
curl -s https://raw.githubusercontent.com/xtreamx2/streamer/Second/install.sh | bash | tee install.log
chmod +x install.sh
./install.sh


streamer/
├── config/
│ └── gpio.json
├── logs/
│ └── install.log
├── media/
│ └── test.wav
├── installer/
│ └── start_install.sh
├── change_log
└── README.md
/streamer
├── main.py # główny loop
├── config.py # ustawienia
├── audio/
│ ├── player.py # MPD/Spotify/BT/Radio
│ ├── dsp.py # EQ, loudness, filtry (CamillaDSP/ALSA)
│ └── volume.py # głośność (PCM5122 + soft)
├── ui/
│ ├── display.py # OLED
│ ├── menu.py # logika menu
│ └── encoder.py # enkoder + przyciski
├── hardware/
│ ├── relays.py # przekaźniki/tyrystory
│ ├── rtc.py # DS3231 (później)
│ └── power.py # standby, mute, itp.
└── utils/
└── logger.py # logi


Projekt składa się z trzech warstw licencyjnych:
Expand Down Expand Up @@ -119,7 +129,7 @@ Already a pro? Just edit this README.md and make it your own. Want to make it ea

```
cd existing_repo
git remote add origin https://gitlab.com/aloisy/streamer.git
git remote add origin https://raw.githubusercontent.com/xtreamx2/streamer/Second/install.sh
git branch -M main
git push -uf origin main
```
Expand Down
90 changes: 90 additions & 0 deletions audio/dsp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# streamer/audio/dsp.py

import json
import time
import subprocess
from pathlib import Path

BASE = Path(__file__).resolve().parents[1]
EQ_CONFIG = BASE / "config" / "config-eq.json"
CAMILLA_CONFIG = Path("/etc/camilladsp/streamer.yml")


def load_cfg():
return json.loads(EQ_CONFIG.read_text())


def write_camilla_yaml(text):
CAMILLA_CONFIG.write_text(text)


def reload_camilla():
subprocess.run(["systemctl", "reload", "camilladsp"], check=False)


def render_yaml(cfg):
mode = cfg["mode"]
presets = cfg["presets"]
c2 = cfg["custom2_profiles"]
c5 = cfg["custom5_profiles"]
loud = cfg["loudness"]

if mode == "preset":
gains = presets[cfg["selected_preset"]]

elif mode.startswith("custom2"):
key = mode[-1]
gains = {
"60": c2[key]["bass"],
"230": c2[key]["bass"],
"910": 0,
"3600": c2[key]["treble"],
"14000": c2[key]["treble"]
}

elif mode.startswith("custom5"):
key = mode[-1]
gains = c5[key]

else:
gains = presets["FLAT"]

# YAML – uproszczony, pipeline dopasujesz później
out = ["filters:"]
for f, g in gains.items():
out.append(f" peq_{f}:")
out.append(" type: Peq")
out.append(f" freq: {float(f)}")
out.append(" q: 1.0")
out.append(f" gain: {g}")

if loud["enabled"]:
out.append(" loud_low:")
out.append(" type: Lowshelf")
out.append(" freq: 80")
out.append(" q: 0.7")
out.append(f" gain: {loud['strength'] / 10}")

out.append(" loud_high:")
out.append(" type: Highshelf")
out.append(" freq: 8000")
out.append(" q: 0.7")
out.append(f" gain: {loud['strength'] / 15}")

return "\n".join(out) + "\n"


def main():
last = None
while True:
cfg = load_cfg()
if cfg != last:
yaml = render_yaml(cfg)
write_camilla_yaml(yaml)
reload_camilla()
last = cfg
time.sleep(1)


if __name__ == "__main__":
main()
14 changes: 14 additions & 0 deletions audio/player.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from mpd import MPDClient

class Player:
def __init__(self):
self.client = MPDClient()
self.client.connect("localhost", 6600)

def play_radio(self, url):
self.client.clear()
self.client.add(url)
self.client.play()

def stop(self):
self.client.stop()
9 changes: 9 additions & 0 deletions audio/volume.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from mpd import MPDClient

class Volume:
def __init__(self):
self.client = MPDClient()
self.client.connect("localhost", 6600)

def set(self, value):
self.client.setvol(value)
16 changes: 16 additions & 0 deletions config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
RADIO_STREAM = "http://stream.rcs.revma.com/ypqt40u0x1zuv"
OLED_I2C_ADDR = 0x3C

GPIO_ENCODER_A = 24
GPIO_ENCODER_B = 23
GPIO_ENCODER_SW = 13

GPIO_BTN_POWER = 5
GPIO_BTN_STOP = 6
GPIO_BTN_PLAY = 12
GPIO_BTN_NEXT = 19
GPIO_BTN_PREV = 26

GPIO_LED_R = 16
GPIO_LED_G = 20
GPIO_LED_B = 21
5 changes: 5 additions & 0 deletions config/config-dsp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"eq_5band": [0, 0, 0, 0, 0],
"eq_2band": [0, 0],
"active_eq": "5band"
}
29 changes: 29 additions & 0 deletions config/config-eq.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"mode": "preset",
"selected_preset": "ROCK",

"custom2_profiles": {
"A": { "bass": 0, "treble": 0 },
"B": { "bass": 3, "treble": -2 }
},

"custom5_profiles": {
"A": { "60": 0, "230": 0, "910": 0, "3600": 0, "14000": 0 },
"B": { "60": 4, "230": 2, "910": -1, "3600": 3, "14000": 5 }
},

"presets": {
"ROCK": { "60": 4, "230": 2, "910": -1, "3600": 3, "14000": 5 },
"JAZZ": { "60": -2, "230": 1, "910": 3, "3600": 2, "14000": 1 },
"DANCE": { "60": 6, "230": 4, "910": 0, "3600": 2, "14000": 3 },
"POP": { "60": 3, "230": 1, "910": 0, "3600": 2, "14000": 4 },
"VOCAL": { "60": -1, "230": 0, "910": 2, "3600": 4, "14000": 3 },
"CLASSIC":{ "60": -3, "230": -1, "910": 1, "3600": 2, "14000": 1 },
"FLAT": { "60": 0, "230": 0, "910": 0, "3600": 0, "14000": 0 }
},

"loudness": {
"enabled": false,
"strength": 50
}
}
7 changes: 7 additions & 0 deletions config/config-oled.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"eq_mode": "5band",
"screensaver_dim_after": 10,
"screensaver_dim_level": 10,
"screensaver_off_after": 30,
"brightness_default": 100
}
36 changes: 36 additions & 0 deletions config/config-radio.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"stations": [
{
"name": "FIP \u00c9lectro",
"url": "https://icecast.radiofrance.fr/fipelectro-midfi.mp3",
"favorite": true,
"tags": [
"electronic",
"aac"
]
},
{
"name": "FIP Groove",
"url": "https://icecast.radiofrance.fr/fipgroove-midfi.mp3",
"favorite": false,
"tags": [
"groove",
"aac"
]
},
{
"name": "Dance Classics Radio",
"url": "http://vriezenet.nl:11051/dcflac",
"favorite": false,
"tags": [
"Classic Dance"
]
},
{
"name": "TNM Radio",
"url": "http://stream.tnm-radio.eu/ultra",
"favorite": false,
"tags": []
}
]
}
5 changes: 5 additions & 0 deletions config/config-system.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"hostname": "streamer v0.010a",
"i2s_card": "hifiberry-dac",
"bluetooth_enabled": false
}
Loading