commit 07926be5cfb76d0e2ed00ee3a6dcd4a5a0ad9b99 from: Omar Polo date: Tue Sep 22 17:10:22 2020 UTC new post!!! 3-day streak! woooo-hooooo! commit - e7cfc653352a880d94a807c8d7800c32e1016908 commit + 07926be5cfb76d0e2ed00ee3a6dcd4a5a0ad9b99 blob - /dev/null blob + 444064543ec5898958701e23efc810b5bd6648c9 (mode 644) --- /dev/null +++ resources/posts/sndio-over-network.md @@ -0,0 +1,51 @@ +Like I said in the [previous entry](/post/openbsd-tethering.html) I +don't like to write _howtos_: the information tend to rot away if not +carefully updated, and I don't have all that stamina. Anyway, I felt +like writing this, and so here we are. + +Due to events that are outside the scope of this entry, I moved my +computer in a place where I cannot comfortably attach a jack to it. +(I realized this only after the rearrangement, shame on me!) + +While any sane person would just have bought a longer jack cable (that +I should have somewhere anyway) I decided that was the right time to +test the network capabilities of `sndio`, the audio server of my OS of +choice. + +I have to admit that while at a first glance sending audio over the +network may seem complicated, I was surprised by how easy it was. + +The plan™ was to route all the audio from my OpenBSD workstation to a +raspberry pi through the LAN. Why a raspberry? Because I had one +spare that was accumulating dust. + +So, I installed void linux on the raspberry (OpenBSD should run on the +raspberries, but for the installation you need to use the serial, and +I don't have an adapter). The setup was really quick: + +```sh +# xbps-install sndio +# xbps-install alsa-utils # for alsamixer +# echo 'OPTS="-L-"' > /etc/sv/sndiod/conf +# ln -s /etc/sv/sndiod /var/service/ +``` + +(the `-L-` is to tell `sndiod` to accept connection from anywhere.) + +And for the pi that's all. (except that I still have to increase the +volume with `alsamixer` after every boot). Now, back on the +workstation I added this to my `.xsession` + +```sh +export AUDIODEVICE=snd@192.168.1.12/0 +``` + +(You probably want to change the ip address, and only that! `snd@` +**IS NOT** a username. The same goes for the `/0`: it's the device +number, not some CIDR notation.) + +Now all the audio is transparently sent through the network to my pi, +and from there to my headphones via my (short) jack cable. Awesome. + +That's really all. Now the bad news: you could have same some time by +reading the FAQ on the OpenBSD website instead of this post :P blob - a437affa467a77dfeb45eda56eb62681602041ee blob + 1f9504cb6a8ffcd97c2e8a6186348ec7d9c76de4 --- resources/posts.edn +++ resources/posts.edn @@ -1,4 +1,9 @@ -[{:title "Automatic USB Tethering on OpenBSD" +[{:title "sndio over the network" + :slug "sndio-over-network" + :date "2020/09/22" + :tags #{:OpenBSD} + :short "why searching for a longer cable when you could use the network? /s"} + {:title "Automatic USB Tethering on OpenBSD" :slug "openbsd-tethering" :date "2020/09/21" :tags #{:OpenBSD}