Showing posts with label OBS. Show all posts
Showing posts with label OBS. Show all posts

Monday, June 22, 2026

Making a NDI Hotspot with Dicaffeine

 RasPi box that sends AND recieves NDI streams. I didn't believe it at first, but works damn well with minimal latency. 

Big ups to @TheKillerBeeRelayTeam for finding this, check out his website at www.hivemindsynthesis.com.

Also, check us out at the Hive Discord. Lot's of like minded synth-heads all helping each other out, myself included!


NOTE: All of this info is available and sourced from and on Dicaffeine's site for Raspian setup, just parsing it here for my Hive friends to understand some beginner things/not fully familar with RasPi setup! All rights reserved, I do not claim anything here as my own work, it's just what I had to do to get it working for me, and then hopefully them. If you are part of the Hive and you get stuck, DM me with where you are stuck and I will try to help you through.

I tested this with a RasPi 3 B+ with Bookworm 64-bit, and got some good results with it. I wouldn't recommend any lower. But you do you, boo. 

Get a 16+GB MicroSD card, plug it into your computer. Get the RasPi OS Imager and set that up, as you would.


Image your OS




Opening the Imager software, select your device. Like I said before, 3 B+ or higher for this.


The suggested OS, based on the Dicaffeine site, is Bookworm 64-bit, so you will need to find it in the legacy section of the setup. Scroll down till you get "Raspberry Pi OS (Legacy, 64-bit)".
All you need is the OS and Desktop enviroment. This would be a good time to get those settings it asks you for straightend out. Remember what you name it on hostname, it might help you later on finding it on the network. In this walkthrough, we are going to have "doughndi" as the RasPi's name, cause that's what I fucking named it. Tell it where you reside in time. Give it a username and password. Remember the username and password your setup here as well. In this walkthrough, we are going to have "djdoughy" as the username. Why? Cause that's what I fucking named it. And setting up the WiFi for it now would be benificial, and turn on SSH while you are at it.  Write that to the SDcard. Yes, this will take quite a few minutes, grab a beer/coffee/tea, and relax man. Chill out... Come back here when it's done.

Boot your Pie
Slap that MicroSD card into the pi, and power it on. It should be connected to a screen and keyboard/mouse by now, I hope. Let it boot to the desktop, and get connected to the internet. You set that WiFi up earlier, yeah? First boot's will take a bit, let it cook. Open the web browser, ONLY CLICK IT ONCE. Seriously, it will open, give it a break. You might get prompted with a keychain password? I don't know, I did. I just put a really simple password in, you don't need the browser but only for downloading 2 files. Get the Yuri2 and Dicaffeine downloads at the guys page directly, as it seemed to be the easiest to get to: 
https://dicaffeine.com/raspbian
A lot of things will not load on the chromium browser on RasPi's from my experience. I got the site to load after putting in the keychain password. If it doesn't work, perhaps updating the chromium would work? I'll note it later at bottom
Once those are in your Downloads folder, close that window out. Good time to run updates on the GUI, if you want. When you are done, reboot that bad boy.

Now if you are comfy doing the next part on the RasPi, open a terminal from the desktop and continue on after this next bit (Setting up Dicaffeine). Or, you can SSH into it and carefully copy and paste commands. Use PuTTY, or if you are on Windows, open PowerShell/Terminal. I used Terminal. At the prompt type ssh <the username you chose>@<the hostname you gave it> and push enter. Like so:
If it can't find the hostname, use the IP from the RasPi


Read the screen, type yes to accept the finger print, and then type the password you made eariler to log in.

The rest of this walkthrough will be done in the terminal, either through SSH or the terminal app on the pi.


Setting up Dicaffeine

Good time to maybe do some updates, I am not an expert at the RasPi by any means, but its always safe to update. The following command should be ran to update all the installed packages.

sudo apt update

Once that is done, give the pi a reboot
sudo reboot now

Once rebooted, open terminal,
At the prompt type this:
cd ~/Downloads
This puts us in the downloads folder where the packages from earlier should reside.

Were going to install the packages. The commands listed here are going to be 'generic' as the version numbers can change. Quick way to type these out is when you get to the file name, type the first few letters and push tab, it should auto fill the rest of the file name, then add the '-y' to auto accept the install. Run these seperatly, agree to any licenses after reading them. 
sudo apt install ./yuri2-2.8.0-xxx.deb -y
sudo apt install ./dicaffeine-xxx.deb -y

You might get some notices about issues (usually lil messages with a N: in front of them), but as long as it isn't throwing actual errors (E's or W's), they should install fine. The 2 things we installed was Yuri, a video processing framework, and Dicaffeine, which is the web interface and NDI host.
Speaking of NDI, now Dicaffine needs the libraries installed, run these 2 commands seperately. The dudes site said the second one was optional? I didn't get anything to work without it though, YMMV.
dicaffeine_get_ndi5 install aarch64-rpi4-linux-gnueabi
dicaffeine_get_ndi_hx install aarch64-rpi4-linux-gnueabi

Now we need to change the config of the RasPi itself so it can see audio. Open the RasPi config
sudo raspi-config
Navigate to "Advanced Options" then "Audio Config"
Change configuration to "PulseAudio". Navigate to finish and close the configuration. 

Next, we need to change something with the GUI interface. The following command will hide the 'taskbar' so the HDMI out will be full screen.
echo -e "autohide=true\nautohide_duration=500" >> ~/.config/wf-panel-pi.ini

Once that is done, plug a webcam in to test it here in a bit, then give the pi a reboot
sudo reboot now





And THAT should be it. Go to a computer on your network, type the "<hostname>/" in your browser and you should hopefully get the main page. "admin" is the default password. Poke around, have fun, if you break it, just start over!

Tuesday, January 30, 2024

StreamElements Overlay Chat - Top Down display!

 Okay, this seems silly to make a post like this, but I wish I had found a page that told me this before wasting a few hours trying to figure it out!

For a while, I have been wanting my chatbox overlay in OBS to display newest messages at top and move down. Googling the issue only brought me newbie posts of "How to put your chat on your OBS!" and "One Billion and One overlay designs!"

Default chat boxWhat I wanted to happen
(What I had versus what I wanted)

Now, this might not be for everyone, but my chat is pretty slow on stream, and having it just a couple messages just appear in the middle of my screen off to the side was weird and just looked tacky. Having text appear at top, and get moved down and then fade out after a set time looked A LOT neater in my opinion.

Yeah, you can make your own custom chatbox by learning now to use the CSS and connections and what have you, but I like the layout and simplicity of StreamElements chat overlay feature (albeit, too simple somtimes). I have seen others with this type of layout, but its always been some other service, and I like to keep everything centralized to one service (that does emote walls, notifications,etc.), so it's always been a dead end.

So finally, I just sat down and dug into the CSS of the StreamElements chat preview and made some live edits to see what got me my results, and it boiled down to this:

.layout-column {
  flex-direction: column-reverse; }

That... That's it. Copy that into your chat overlay source in OBS under the Custom CSS feild, and it will display your chats starting at the top, and move the text down for each message.

I hope this post will help someone in the future who uses StreamElements chat overlay and wants text to appear at top and move down.


Monday, October 2, 2023

DIY "StreamDeck"

 OK, so it's far from being an ACTUAL StreamDeck, but here's what I did to make a old external 10-key Numpad with PS/2 plug into a keypad that can do macro's over USB HID.



It started when I found a very unique 10key in a recycle pile. It had mechanical keys, and they were VERY clicky. Only issue was, it was PS/2. Ya know, the 5 pin barrel thing from back in the day? Yeah there's adapters for it, but really I didn't need a external numpad. In all honesty, I was just gonna make it a fidget thing cause I liked the clicky nature of it.

That is, until I started learning how some Arduino boards can be setup to be recognized as a HID device. Basically, when you plug it into a computer, it will recognize it as an interface device, and not an arduino board.



So that got me thinking. Yeah, I could make it USB instead of PS/2. But would it be possible for a computer to recognize it as a seperate input? So I can maybe setup hotkeys in OBS?

Well, no...not exactly

But what about translating the keypresses to something else?... Maybe?

I dug into the device to see what I could find. A bunch of pcb and a chip that has no datasheet filed anywhere online.

Welp, there went that idea of maybe tapping some pins to use the standard matrix style key project that can be found in many arduino starter packs. 

I went on to a couple Discord servers to chat/prod for help on this crazy lil idea I had, and someone suggested "Why not just have it use some extended keys?"

Yeah... Why not?

I already knew that keyboard standards accepted things like media hot keys and what have you, as well as function keys beyond the F12 of the standard keyboard. Why not have this do F13-F24? That's plenty of keys for using as macro hotkeys. I broke out my Arduino Leoardo, which I found can do HID nativly, and started looking up coding examples.

With the help of 'chaosfool' from Syd Heresy's crew on discord, I was able to put together a Arduino sketch that was able to take the scan code of the key press, then add a set number of however many keys above that was to make it equal to the scancode of the higher function keys. Wired up the PS/2 wires VC to 5V, GND to GND, Clock to SCL, and DATA to an open data pin on a Arduino Leonardo breakout board, then pushed the sketch over.

Viola! I have data! And the scan codes are pushing the right key presses! 0-9 with period and enter are showing up as F13-F24

Of course, there are still some issues.

The code worked TOO well. As you can see in the video, when I press a key and release it, it sends 2 signals. This is how PS/2 is supposed to work! But, when the Leo translated it to USB via my sketch, it would send the signal twice. Which would cause the keypress to happen twice. And even then, it was sending the signal so fast, applications out of focus of the main window would not see the keypresses. After beating my head over it, I decided to shove it asside and see if I could make this even work independently without it in pieces.





In comes the DFRobot Beetle!

This lil thing is a bit bigger than a quarter and is basically a stripped down Leonardo. Perfect for what I am needing it for! 



The numpad thankfully used a header to connect to the PS/2 cable, so I was able to unplug the cable, snip the end with the header connection, and then strip some wires back to solder to the Beetle. PS/2 Vcc and GND went to 5V out and GND pads respectivly. Clock wire went to the SCL pad (ie, IRQ pin 3) and DATA wire went to Digital Data pin/pad 11.





Electrical taped it sealed, folded the wires over that and it fits perectly in the space above the PCB of the numpad! Had a super long MicroUSB so that fit in the wire hole and under the board of the keypad to the Beetle
Then I pushed the code again, and now I am back at where I was before. Double pressing of keys when I push it once, unable to use it with out of focus applications. At least it looked nice?
Was able to make key lables using a DYMO LabelManager 280 with the durable white on black lables. Being that the printer can connect via USB, I could make nice lil emote style covers.

The project sat for months while I hem and hawed over what to do about the code. I am a complete n00b when it came to C++, but then I decided I need to finish it. Otherwise, it was just getting in the way.

Long story short, fought with it a few days, then came across some information from some help on Reddit. The library I was using had some variables I didn't think of. Once those were in place, it worked like a charm! The sketch is below:

//NUMPAD to extended function keys (f13-f24)
//Converts PS/2 numpad to function as extended function keys over USB HID
#include <PS2KeyAdvanced.h> //required for higher function keys
#include <Keyboard.h>

PS2KeyAdvanced ps2kb;

#define DATAPIN 11 
#define IRQPIN 3 //SCL pin on Beetle

uint16_t c;

void setup( ) { 
   ps2kb.begin( DATAPIN, IRQPIN );
   ps2kb.setNoBreak(1);
   ps2kb.setNoRepeat(1);
   if ( ps2kb.available ( ) ) {
     c = ps2kb.read();
    }
  }

void loop( ) {
  if ( ps2kb.available( ) ) {
    c = ps2kb.read( );
    if ( c > 0 ) {
      uint16_t fkey = c + (PS2_KEY_F13 - PS2_KEY_KP0); // translate number key to function key
      char hidkey = KEY_F13 + (fkey - PS2_KEY_F13); // convert to hid key code
      if((c>>8)!=80);{ // send to computer
        Keyboard.press(hidkey);
        delay(50);
        Keyboard.release(hidkey); 
        } 
      }
    }
  }
(big up to http://hilite.me/ for its awesome html maker for code blocks!)

It basically now sends the keypress for 50 ms and then releases it. Super fast and instant. Once I got this running, all I needed to do was set the hotkeys in OBS. Now I am able to switch scenes and even mute input/outputs without needing to switch focus of applications! I'm sure it could be used for anything elses outside of OBS, but for now, I am happy with the result! Hope someone out there will find this and be able to do the same.

Total cost of this was $11 for the Beetle and some time. Well worth it seeing how stream decks are around $100. 



Making a NDI Hotspot with Dicaffeine

 RasPi box that sends AND recieves NDI streams. I didn't believe it at first, but works damn well with minimal latency.  Big ups to @The...