News for hackers. Stuff that matters.
Re:Raspberry Pi 4 can finally boot directly from USB by umvi on Friday September 18, 2020 @04:10PM (#24521374)
> Now I have a whole bunch of Pi 3's and 4's scattered around my home with no local storage at all doing cool things

Elaborate? I have a single pi3 as a Plex server, looking for more ideas.

Re:Raspberry Pi 4 can finally boot directly from USB by LeoPanthera on Friday September 18, 2020 @04:23PM (#24521506)
Two play music, one into my hifi, one into my home audio distribution system.

One is setup for RetroPie. One has LibreELEC installed, showing TV from my HDHomeRun. One has a GPS hat and is a local NTP server.

And one boots into an Amiga emulator because I'm very old and nostalgic.

Re:Raspberry Pi 4 can finally boot directly from USB by fredley on Saturday September 19, 2020 @03:46AM (#24525887)
Surprised not to see Pi Hole on that list!
Re:Raspberry Pi 4 can finally boot directly from USB by LeoPanthera on Saturday September 19, 2020 @01:15PM (#24528930)
My router runs pfSense so I don't need Pi Hole, I can use pfBlockerNG instead, which is built in.
Re:Raspberry Pi 4 can finally boot directly from USB by ukyrgf on Saturday September 19, 2020 @12:53PM (#24528754)
Any old SBC can run that reliably on it's own, the parent is talking about swapping out the OS with netboot on the fly.
Re:Raspberry Pi 4 can finally boot directly from USB by enobrev on Friday September 18, 2020 @05:29PM (#24522068)
Can I ask what software you're using for music on your home audio system? I have an HTD system with speakers throughout and while Chromecast Audio was great for a while, stability has been an issue that I'm no longer interested in hassling with.

(Also looking forward to researching this netboot solution you speak of)

Re:Raspberry Pi 4 can finally boot directly from USB by hanklazard on Friday September 18, 2020 @06:53PM (#24522632)
Not the parent but I have a similar setup. I use volumio music software on 4 raspberry pi 3b+, each with a hifiberry amp to drive speakers. If you couple these with snapcast, you have a diy whole house sonos-like setup. Works well and I control volumes through home assistant.

Not familiar with netbooting, but will be looking into it!

Re:Raspberry Pi 4 can finally boot directly from USB by enobrev on Saturday September 19, 2020 @04:46AM (#24526110)
I had been considering a similar setup and then got a notification for a barely used htd lync12 with amps on Craigslist at an insanely good price and hopped right on it. I've spent the past year or so wiring up the house a room at a time, which has been painful and sometimes stressful. But I've become such a huge fan of the simplicity and stability of a wired setup that it's all been absolutely worth it.

Thanks for the recommendation. I'll give volumio a closer look.

Re:Raspberry Pi 4 can finally boot directly from USB by richajak on Sunday September 20, 2020 @12:18PM (#24534866)
Also not the parent. For me, I want my speaker, position 4 meters away, to play some music from my phone or laptop. First, I tried to use use youtube feature to beam the video to my android smart tv connected to the speaker. However, it is a waste of resources to do that. Later, I found some scripts on the internet for my Pi 3 to play the sound via Bluetooth. It is a better solution than my original idea, I can use any app, not just youtube. However I recently found an even better way, by buying a Bluetooth transmitter dongle that can be connected to my speaker. It only costs me less than $2. I can ask my Pi 3 to do something else more important than this task.
Re:Raspberry Pi 4 can finally boot directly from USB by LeoPanthera on Friday September 18, 2020 @07:16PM (#24522791)
I use Moode Audio. https://moodeaudio.org
Re:Raspberry Pi 4 can finally boot directly from USB by enobrev on Saturday September 19, 2020 @04:40AM (#24526091)
This looks great. Thank you
Re:Raspberry Pi 4 can finally boot directly from USB by entropie on Friday September 18, 2020 @06:24PM (#24522456)
Re:Raspberry Pi 4 can finally boot directly from USB by enobrev on Saturday September 19, 2020 @04:39AM (#24526087)
Yes. I have a lot of respect for the HA project, but I stopped using it last year. It changed far too much for me too much keep up at the time, and I ran into too many issues with the zwave support at the time.

Thanks for the link.

Re:Raspberry Pi 4 can finally boot directly from USB by silicon2401 on Friday September 18, 2020 @05:11PM (#24521911)
do you have a blog about this, or willing to share any more info? This sounds like something I'd like to start working towards
Re:Raspberry Pi 4 can finally boot directly from USB by LeoPanthera on Friday September 18, 2020 @05:16PM (#24521946)
I haven't documented it, but it's very simple.
Re:Raspberry Pi 4 can finally boot directly from USB by thisisbrians on Friday September 18, 2020 @05:42PM (#24522167)
I, too, would appreciate a brief Google Doc or Pastebin on this if you can spare the time. I've never setup netboot before, but have been interested for years... reply
Re:Raspberry Pi 4 can finally boot directly from USB by pbalau on Friday September 18, 2020 @06:28PM (#24522475)
Unless you are running your own router, like the op, most likely his setup won't help you. You should start by understanding all the components of the system and then figure out how to make it fit in your environment and maybe what changes you need to make. Start here [0]

0. https://en.wikipedia.org/wiki/Preboot_Execution_Environment

Re:Raspberry Pi 4 can finally boot directly from USB by LeoPanthera on Friday September 18, 2020 @07:17PM (#24522799)
The Pi doesn't use PXE. It's different, but documented here:

https://www.raspberrypi.org/documentation/hardware/raspberry...

Re:Raspberry Pi 4 can finally boot directly from USB by pbalau on Friday September 18, 2020 @07:47PM (#24523020)
You probably should read that link, section "DHCP Request / Reply". Virtually the entire world uses PXE.

Anyway, I find it funny that we are arguing about the proper name for network boot in a thread about usb boot.

Re:Raspberry Pi 4 can finally boot directly from USB by vlowther on Saturday September 19, 2020 @01:23PM (#24529024)
The issue is that the Pi does something that is almost-but-not-quite PXE. In particular, the RPI firmware does not send anything that identifies itself as an RPI so that the DHCP server can determine what packet to send in response -- the option 60 string it sends in the DISCOVER packet claims to the DHCP server that it is an X86 server running in legacy BIOS mode. The only way the RPI will boot is if you send it that extra magic option 43. For those of us that write DHCP servers that try to be intelligent about how to respond to PXE requests, the plethora of stupid not-exactly-PXE mechanisms the various ARM SBC hobbyist boards are annoying as fuck. At least the server class ARM stuff usually has a UEFI implementation that adheres to the UEFI extensions to the PXE spec and properly identifies itself with options 60, 93, and 94.
Re:Raspberry Pi 4 can finally boot directly from USB by LeoPanthera on Friday September 18, 2020 @08:26PM (#24523387)
OK sure. :) I guess what I meant was, if you're setup for booting Pis, you can't also boot arbitrary PCs without extra work.
Re:Raspberry Pi 4 can finally boot directly from USB by laumars on Saturday September 19, 2020 @04:54AM (#24526137)
Not much extra work I’d have thought. You might need to hardcode the Pis MAC address in your preferred DCHP server but the rest of the config should be equivalent.

I’ve already got isc-dhcpd running with PXE booting for x86 / AMD64 machines so might add some rules in for the Pis too.

Thanks for the heads up by the way. I hadn’t realised you could network boot Raspberry Pis.

Re:Raspberry Pi 4 can finally boot directly from USB by sambf on Saturday September 19, 2020 @06:07AM (#24526365)
Emby also offers the ability to control and play stuff on other Emby devices on the same network. LibreELEC/Kodi + the Emby plugin [0] on a Pi makes it appear as an Emby device on other devices. Been using that for more than a year an it works like a charm. Plus the data is fetched from the Emby server and not device to device, so you can play something from your phone to your TV, then continue to control from your tablet while your phone is off.

[0] http://kodi.emby.media/

Re:Raspberry Pi 4 can finally boot directly from USB by joshspankit on Friday September 18, 2020 @04:31PM (#24521593)
(If you’re able to play to both simultaneously) Do the music playback devices stay in sync?
Re:Raspberry Pi 4 can finally boot directly from USB by rainbowzootsuit on Friday September 18, 2020 @07:30PM (#24522882)
I successfully used shareport-sync and forked-daapd back a while ago with PogoPlugs and USB audio interfaces for multiroom audio. It worked without too much effort.

https://github.com/mikebrady/shairport-sync

http://ejurgensen.github.io/forked-daapd/

Re:Raspberry Pi 4 can finally boot directly from USB by blibble on Friday September 18, 2020 @06:05PM (#24522335)
I actually tried this and it turned out to be quite a bit more complicated than predicted, due to clocks on the pis being slightly different

"I'll just sling udp multicast of the PCM samples around the network, can't be that hard right?"

ended up using MPD with pulseaudio over TCP, and they get out of sync after a few minutes, but good enough

Re:Raspberry Pi 4 can finally boot directly from USB by joshspankit on Friday September 18, 2020 @06:42PM (#24522562)
The different clocks is a real hurdle.

I have to give credit to Apple on this one, as they had the genius idea to make the buffer >1s, and send control messages independent of the audio stream.

There’s gotta be a way to do it with PTP and the same ideas but clearly it’s either an extremely difficult problem, too niche, or both.

Re:Raspberry Pi 4 can finally boot directly from USB by loxias on Saturday September 19, 2020 @01:18PM (#24528963)
Correct. You use PTP+NTP, the RT_PREEMPT patches, and then you have to deal with a constantly varying resampling ratio (!!) And not only that, but if you don't want nasty artifacts, the a LOT of thought also has to go into your filter design. It's hazy, but I remember using a pair of orthonormal time-varying allpass IIR QMF filters, with extra black magic I'm blanking on that allowed me to reduce the complexity of finding the coefficients for, and computing the filters by at least a factor of 4. Fun stuff. I think half the coefficients in the EQMF were zero, and of the other half, half were the reciprocal of another, which led to a fast implementation.

But yeah! I've done that. Kept audio streams to within a few samples of alignment for more than 24 hours. It was fun, and yes, somewhat hard. "will more than happily do it again for money". :)

Re:Raspberry Pi 4 can finally boot directly from USB by tinus_hn on Saturday September 19, 2020 @02:22PM (#24529440)
Why would you send samples? If you do any kind of compression you’re going to convert to frequencies anyway and it isn’t that much of a hassle to expand that.
Re:Raspberry Pi 4 can finally boot directly from USB by m463 on Saturday September 19, 2020 @04:48PM (#24530222)
That sounds like a better solution - I'd guess most a/v systems are used for pre-recorded video that could deal with more delay during stop/start/pause but giving you more synchronization.

To really do it right though I think it would be cool to tune everything somehow. So have a microphone + photodiode sensor you put in your chair, then run a test and have it synchronize all audio and video sources together. (maybe it could even be pointed to your bluetooth headset and do that delay too)

I think with that setup, you could not only get good synchronization, you could probably tune the delay to the minimal value (maybe you could still do stuff like something live)

Re:Raspberry Pi 4 can finally boot directly from USB by MisterAV on Friday September 18, 2020 @08:23PM (#24523358)
What is the requirement for synched audio? milliseconds, microseconds, nanoseconds,...

I'm currently working on devices that synchronises themselves wirelessly indoor over a large area and I'm now wondering if music could be an application I haven't though about...

Re:Raspberry Pi 4 can finally boot directly from USB by londons_explore on Friday September 18, 2020 @09:55PM (#24524164)
10 ms is fine. 100ms works but you get odd echoes like a speaker system in a big building.

You need some way to compensate for clock drift between different playback devices. Even good clocks will drift 10ms in a few hours.

Re:Raspberry Pi 4 can finally boot directly from USB by loxias on Saturday September 19, 2020 @01:18PM (#24528972)
1ms is barely "ok". with 1ms you'll still hear ugly comb filter effects. (see my other comments)
Re:Raspberry Pi 4 can finally boot directly from USB by joshspankit on Friday September 18, 2020 @09:57PM (#24524177)
At most 10ms. Sub 1ms would be awesome.

And yes, definitely. If you can build in a “chromecast receiver” so that a user could cast to multiple synced speakers (at full quality), you’d definitely have my attention

Re:Raspberry Pi 4 can finally boot directly from USB by Dylan16807 on Saturday September 19, 2020 @03:23AM (#24525813)
It's worth noting that for two speakers playing the same audio, a 5ms offset will move the point of perfect sync by less than a meter. Going below a millisecond is definitely overkill territory.
Re:Raspberry Pi 4 can finally boot directly from USB by magnetised on Saturday September 19, 2020 @08:57AM (#24527118)
In 1ms sound travels just over 30cms - so just moving around a reasonable room affects the offsets between two well spaced speakers by 5-10ms. I use my own multi room audio system at home - http://strobe.audio - and although the sync isn’t perfect by any means the effect of moving around your house usually the problem. Eg if you have the volume in another room loud enough that it’s louder than the music from the room you’re in you get the weird echo effect. Otherwise nothing.

Turns out our brains are really good at compensating for relatively large offsets

Re:Raspberry Pi 4 can finally boot directly from USB by loxias on Saturday September 19, 2020 @12:34PM (#24528616)
I beg to differ: a good rule of thumb is that an (audio) sample takes about 8mm (44.1k). By the time you're a full 1ms late, that's a 44 sample difference between the two (or that's as though the speakers were about a third a meter apart.

And that distance, you're gonna hear some uncomfortable comb filtering. A third of a meter corresponds to a frequency of about 1khz, which is right smack dab in the middle of a critical band, so you WILL hear the constructive and destructive interference around ~1khz.

(and _5ms_? That means the speakers are now ~220 samples out of sync, so I'd expect any lows around 200hz to have some destructive interference, making the music sound hollow.)

1ms of sync is FAR less than adequate. It took effort, but I was able to get a distributed set of raspis to within about 5 samples at 44.1k, and I think I can do better.

Why do I know this or care? :) I've done (and still do) a lot of research (and inventions) in the field of microphone array processing and audio source localization -- tracking objects purely by their sound. With cheap commodity equipment I can generally get a resolution of 5cm, and with lots of fine tuning I was able to do sub-cm tracking.

Re:Raspberry Pi 4 can finally boot directly from USB by Dylan16807 on Saturday September 19, 2020 @02:48PM (#24529614)
All those problems happen even if your speakers are perfectly in sync. These aren't headphones. If you have a couch for listening, the difference between sitting on the left and sitting on the right is just as big or bigger. You get the same interference, yet it isn't a problem.
Re:Raspberry Pi 4 can finally boot directly from USB by m463 on Saturday September 19, 2020 @04:53PM (#24530252)
I think his thinking is still valid.

If you sit on the left or right the sound should still come from "center stage" or (x,y,z)=(0,0,0) without being shifted or drift.

Re:Raspberry Pi 4 can finally boot directly from USB by Dylan16807 on Saturday September 19, 2020 @05:40PM (#24530490)
Depends on whether you have a stage. If you're playing audio to go with a TV you don't want it drifting much. But when the scenario is playing music over an area you end up with a bunch of mutually-contradictory centers and it doesn't matter if they shift over a little. And music over an area is what sparked this talk.
Re:Raspberry Pi 4 can finally boot directly from USB by vinw on Saturday September 19, 2020 @03:07AM (#24525753)
Take a look at snapcast if you want to fix your out-of-syncness

https://github.com/badaix/snapcast

Re:Raspberry Pi 4 can finally boot directly from USB by MegaDeKay on Saturday September 19, 2020 @12:38PM (#24528636)
"Typically the deviation is below 0.2ms." Impressive!
Re:Raspberry Pi 4 can finally boot directly from USB by LeoPanthera on Friday September 18, 2020 @04:33PM (#24521604)
No they're independent. But if I want multiroom audio I just use my very low-tech home audio system. Most rooms have ceiling speakers that are all wired back to the garage where one of the Pi's lives.
Re:Raspberry Pi 4 can finally boot directly from USB by cbzbc on Saturday September 19, 2020 @04:38PM (#24530183)
How do you serve up images to the retropie box?
Re:Raspberry Pi 4 can finally boot directly from USB by Abishek_Muthian on Saturday September 19, 2020 @01:30AM (#24525390)
>looking for more ideas

1. MotionEye can help set your own local security camera setup.

2. PiHole with Unbound can help setup network wide ad blocking and DNS over TLS.

3. SDR (DVB-T dongle) with rtl_433 can receive 433Mhz communication from your sensors like Fire Alarm, Gas Sensor, Car key etc. and notify you.

4. MQTT server on a Pi can act as a local notification server, MQTT client on your phone can receive notifications.

Of course, the possibilities with a SBC are endless, but I included just those projects which I feel can be implemented without much effort but provides huge lifestyle/cost-benefit improvements.

Re:Raspberry Pi 4 can finally boot directly from USB by 3np on Saturday September 19, 2020 @04:43AM (#24526099)
On 4, what MQTT broker(s) would you recommend? I’be been reading up a bit on different alternatives[0] for something lightweight with not too many dependencies to run clustered/HA and haven’t figured out which one to try yet.

[0] https://github.com/hobbyquaker/awesome-mqtt

Re:Raspberry Pi 4 can finally boot directly from USB by herbcso on Saturday September 19, 2020 @06:50AM (#24526537)
Mosquitto seems to be the de-facto "standard" choice for a Pi. Easy to set up and definitely lightweight.
Re:Raspberry Pi 4 can finally boot directly from USB by Abishek_Muthian on Saturday September 19, 2020 @08:45AM (#24527040)
Yes, Mosquitto from default repo works as it should without any trouble.

As for android client, I recommend this[1] but it requires Tasker Autonotification plugin to display notifications.

[1]https://play.google.com/store/apps/details?id=in.dc297.mqttc...

Re:Raspberry Pi 4 can finally boot directly from USB by threentaway on Friday September 18, 2020 @04:18PM (#24521454)
https://github.com/badaix/snapcast this seems really cool, although I haven't got around to doing it myself.
Re:Raspberry Pi 4 can finally boot directly from USB by geekuillaume on Friday September 18, 2020 @05:25PM (#24522031)
Snapcast is really cool, Johannes did an awesome job! I used it for a long time at home on multiple RaspberryPis. I've been working for some time on a more user-friendly and cross-OS alternative. It's available here: https://github.com/geekuillaume/soundsync

I think I'm going to try to integrate net-boot in Soundsync this weekend. It would be awesome to be able to install Soundsync on any computer on the network, turn on an option and then just start the rPi to get it to play music.

Re:Raspberry Pi 4 can finally boot directly from USB by bane on Saturday September 19, 2020 @12:45AM (#24525163)
Does anybody know of something that will serve up tracker and game music files (e.g. .mod, .xm, .it, and .spc, .nsf, etc.)? I'd really love to be able to use one of my Pis as a compact music server with a web interface that will on-the-fly transcode and stream these old formats. I have literally tens of thousands of these sorts of files and outside of converting them all to TBs of mp3s wouldn't mind at all to serve these up from their smaller original formats.
Re:Raspberry Pi 4 can finally boot directly from USB by menybuvico on Saturday September 19, 2020 @02:02AM (#24525510)
MOC will play mods as well as other audio, and since it can be controlled over the console, you can probably hook it up to a web page too, if you're prepared to tinker with it.
Re:Raspberry Pi 4 can finally boot directly from USB by 3np on Saturday September 19, 2020 @04:44AM (#24526103)
mopidy/mpd
Re:Raspberry Pi 4 can finally boot directly from USB by bane on Saturday September 19, 2020 @08:47AM (#24527053)
Woah, this might be it. Thanks!
Re:Raspberry Pi 4 can finally boot directly from USB by boneitis on Friday September 18, 2020 @09:40PM (#24524063)
Not related to the rest of the thread, but this popped up the other week and, honestly to my shock, worked well on my Pi3.

https://news.ycombinator.com/item?id=24441112

You may or may not get some latency with video. Seemed to vary for me.

Re:Raspberry Pi 4 can finally boot directly from USB by MayeulC on Saturday September 19, 2020 @06:32AM (#24526450)
I thought this was going to be about NymphCast, an open source alternative to chromecast

http://nyanko.ws/product_nymphcast.php

https://github.com/MayaPosch/NymphCast

Re:Raspberry Pi 4 can finally boot directly from USB by boneitis on Saturday September 19, 2020 @02:17PM (#24529403)
Oh, yes!

I should have remembered this one, since I am particularly interested in it.

But, I have not actually tried it myself. I wish I had the immediate chops to contribute to the project.

Re:Raspberry Pi 4 can finally boot directly from USB by OnACoffeeBreak on Friday September 18, 2020 @09:47PM (#24524116)
pihole works really well for me as a LAN-wide ad blocker.