Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small OS for Raspberry Zero Clients #143

Closed
bjwelker opened this issue Nov 25, 2016 · 26 comments
Closed

Small OS for Raspberry Zero Clients #143

bjwelker opened this issue Nov 25, 2016 · 26 comments

Comments

@bjwelker
Copy link

This is a feature request ;) @badaix
Issn´t it possible to build a small Distri for the Raspberry Zero so more people without the knowledge about Linux and so on can use Snapcast at home ? I think snapcast is enough for the most ppl not everyone needs sonos and snapcast works perfectly.

@badaix
Copy link
Owner

badaix commented Nov 25, 2016

Hi, I also think that it would be cool to have a small distri.
But this is out of scope now (at least for me. Contributions are always welcome).
Even with a preconfigured distribution you can only serve the nerds and geeks who are knowing that a Raspberry Pi is not food and know how to flash an SD card, setup a WiFi on a Linux console, ...
Regarding the WiFi: it would be an interesting project to build some WiFi-setup-over-BT-framework.
A distribution for Raspi 3 (with build-in BT module) could be paired with a smartphone to get the WiFi-SSID and password pushed from an app.
Next problem is the MPD setup/fine-tuning. Maybe for a prebuild distribution it would be ok to have Spotify, AirPlay and UPnP.
Easiest one: A Snapcast Android server that could be installed on FireTV, but it's hard run something like mpd on Android or to redirect Android audio (only possible on some rooted devices).

Snapclients are easy - they only have the problem of the WiFi configuration.

BTW: It seems that there are wireless speakers that are using Snapcast:
https://www.axiomaudio.com/boards/ubbthreads.php/topics/419543/Does_the_AA_use_Snapcast_for_s

@macmpi
Copy link

macmpi commented Nov 26, 2016

Volumio2 will provide a decently small & music oriented distribution when snapcast is fully integrated in it I guess...
It seems in the plan: can't wait for that!

@axelsimon
Copy link
Contributor

Has anyone tried DietPi? it seems to target this sort of use case.

@bjwelker
Copy link
Author

bjwelker commented Nov 30, 2016

Just try it on a Raspberry Zero.
Boot fast and you can use the .deb package so no need for recompile or packing like piCore.
You can flash the SD Card and on the first boot the system can do a unattended install incl. Snapclient.

Maybe a small Webinterface to switch sound output and set WLAN and Hostname and this can be a nice Client OS

root@DietPi:~# df -h
Dateisystem Größe Benutzt Verf. Verw% Eingehängt auf
/dev/root 1,8G 581M 1,1G 35% /
devtmpfs 237M 0 237M 0% /dev
tmpfs 242M 0 242M 0% /dev/shm
tmpfs 242M 4,4M 237M 2% /run
tmpfs 5,0M 0 5,0M 0% /run/lock
tmpfs 242M 0 242M 0% /sys/fs/cgroup
tmpfs 10M 1,2M 8,9M 12% /DietPi
tmpfs 20M 36K 20M 1% /var/log
tmpfs 242M 0 242M 0% /tmp
/dev/mmcblk0p1 63M 23M 41M 36% /boot

@badaix
Copy link
Owner

badaix commented Nov 30, 2016

sounds promising 😃

DietPi

@1337sup3rh4x0r
Copy link

What about your efforts of using piCore @bjwelker ?
Did you experience any downsides?
I have a couple of piCore based Snapcast clients running on some pis in my house and it is all working rather good!

I like the idea of the system not using the SD at all card after boot and the extremely fast boot time

@bjwelker
Copy link
Author

bjwelker commented Dec 1, 2016

@1337sup3rh4x0r no not any downsides only one maybe that you have to build a new tcz everytime for the clients. Not that fast like the .deb you can get here and install it.
I have 2 piCore Snapclients running, build a webinterface and a easy install script for it but maybe i want something less time consuming ...

For what i have read the DietPi issnt using the SD Card all the time too.

@badaix
Copy link
Owner

badaix commented Dec 4, 2016

Just a high level comment on this: a rock solid system should mount the sdcard read-only

@bjwelker
Copy link
Author

bjwelker commented Dec 4, 2016

I have no Clou how i Can make the Image feom picore with snapcast build in :-(
I Can make the tcz and the Webinterface but not the Image....

@P-D-G
Copy link

P-D-G commented Dec 8, 2016

Maybe a good starting point would be Buildroot. Main difficulties would be adding snapcast in the application tree and offering easy network configuration. Bonus would be that the solution could be compiled on all platforms supported by buildroot.

@bjwelker
Copy link
Author

Maybe @nickaknudson Can Show how to make a Small Client Image with his pull request for buildroot.

@nickaknudson
Copy link
Contributor

Buildroot supports raspberry pi zero out of the box:

https://git.busybox.net/buildroot/tree/board/raspberrypi/readme.txt#n27

Just shallow clone buildroot from the latest release tag:

BUILDROOT_VERSION=2016.11.2
git clone --branch $BUILDROOT_VERSION --depth=1 git://git.buildroot.net/buildroot

And then run make:

cd buildroot
make raspberrypi0_defconfig

If that is successful then follow my instructions to integrate Snapcast:

https://github.com/badaix/snapcast/blob/master/doc/build.md#buildroot-cross-compile

@bjwelker
Copy link
Author

@nickaknudson did you use it as Client or Server ?
For Client i think you neues to add alsa and some Soundard drivers

@nickaknudson
Copy link
Contributor

nickaknudson commented Jan 30, 2017

I've not actually tried it - just trying to give buildroot noobs a place to start. But yes, you would also need to add some other libraries to your buildroot .config such as ALSA.

The soundcard drivers should get built into the linux kernel automatically as buildroot sources from the raspberry pi linux distro:

https://github.com/raspberrypi/linux/blob/rpi-4.4.y/arch/arm/configs/bcmrpi_defconfig

I may have time to try it later this week and if so can add it to the guide.

@bjwelker
Copy link
Author

That would be very nice. Then WE Can build very fast clients

@nickaknudson
Copy link
Contributor

It builds for raspberry pi.

Tested on raspberry pi zero.

https://github.com/nickaknudson/snapcast-pi

@bjwelker
Copy link
Author

Sorry I had no Time to test but I will do

@badaix
Copy link
Owner

badaix commented Feb 5, 2018

last weekend I managed to merge some PRs, especially #212 that added CMake support.
Great thanks to @joerg-krause !
Based on that, it was easy to make a first buildroot integration "SnapOS"
Feel tree to try it out. I'm happy about your feedback!

@palitu
Copy link

palitu commented Feb 5, 2018 via email

@jaecksch
Copy link
Contributor

jaecksch commented Feb 6, 2018

Thanks to @badaix for his great work for snapcast as well as for snapos. I tried it it works fine. Boot time to audible audio is about 20sec. I'm also trying around with buildroot for a while to build a simple client system for snapclients. If you are interested please have a look to snapcastbox.

@1337sup3rh4x0r
Copy link

Is it also planned to extend the support for SnapOS to OpenWRT/LEDE capable devices?

@nickaknudson
Copy link
Contributor

nickaknudson commented Feb 7, 2018

You should consolidate changes between these two folders:

Right now you have duplicated code.

When I initially made the buildroot contribution, I had intended for https://github.com/badaix/snapcast/tree/master/buildroot/package/snapcast to be a buildroot overlay as well. Note that with buildroot you can have multiple overlays.

@jaecksch
Copy link
Contributor

jaecksch commented Feb 11, 2018

I also would suggest to seperate snapcast package from the buildroot distro. You will have full flexibility and you are still able to configure the package in the way you want. Even patching for distro needs is possible. E.g. in my trials I replaced the startup script, resolving an issue which is relevant in this environment only.

@badaix
Copy link
Owner

badaix commented Feb 13, 2018

@1337sup3rh4x0r I've created an openwrt directory with a Makefile for the snapcast package in the SnapOS project. It will need some cleanup and some more dependencies and it should switch from using make to cmake.

@nickaknudson fully agree, it's work in progress. Thanks a lot for your contributions to the buildroot support!

@badaix badaix closed this as completed Mar 2, 2020
@Sieboldianus
Copy link

Sieboldianus commented Apr 8, 2021

Wanted to add: I had to remove alsa-lib from snapcast.mk in order to make with buildroot. Otherwise, I got a dependency warning

alsa-lib is in the dependency chain of snapcast that has added it to its _DEPENDENCIES variable without selecting it or depending on it from Config.in

[Edit] Well, it was more complicated. In any case, I wrote down the process for buildroot 2021.02.1 and SnapOS0.20.0

@foxy82
Copy link

foxy82 commented Jun 4, 2021

Sorry for posting on an old topic but not an easy way to pass the info on.

I've raised a PR against DietPi to add snapcast client as one of their standard software packages: MichaIng/DietPi#4465

If you want a small distro for a Pi Zero W but are intimidated by the SnapOS building then that might be a good compromise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests