PCIe For Hackers: External PCIe And OCuLink

We’ve seen a lot of PCIe hacks on Hackaday, and a fair few of them boil down to hackers pulling PCIe somewhere it wasn’t meant to be. Today, we routinely can find PCIe x1, x2 and x4 links sitting around in our tech, thanks to the proliferation of things like NVMe SSDs, and powerful cheap SoCs that make PCIe appear at your fingertips.

In the PCIe For Hackers series, we’ve talked about PCIe and how cool it is, all the benefits it has for hackers, gave you layout and interconnection rules, and even went into things like PCIe switches and bifurcation. However, there’s one topic we didn’t touch much upon, and that’s external PCIe links.

Today, I’d like to tell you about OCuLink – a standard that hackers might not yet know as an option whenever we need to pull PCIe outside of your project box, currently becoming all that more popular in eGPU space. Essentially, OCuLink is to PCIe is what eSATA is to SATA, and if you want to do an eGPU or an external “PCIe socket”, OCuLink could work wonders for you.

Respectable Capabilities

Just like any high-speed standard, PCIe has some tight requirements when things get fast. Even though PCIe is known to be not as sensitive to lower-quality links due to its link training and generation downgrade abilities, at higher link speeds, even through-hole vs SMD sockets can make a difference. So, if you want to go high-throughput, you want proper cabling and connectors, intended for out-of-chassis use – and OCuLink gives you all of this, at a low price.

Continue reading “PCIe For Hackers: External PCIe And OCuLink”

The Trans-Harmonium Is A Strange Kind Of Radio-Musical Instrument

Pianos use little hammers striking taut strings to make tones. The Mellotron used lots of individual tape mechanisms. Meanwhile, the Trans-Harmonium from [Emily Francisco] uses an altogether more curious method of generating sound — each key on this keyboard instrument turns on a functional clock radio.

Electrically, there’s not a whole lot going on. The clock radios have their speaker lines cut, which are then rejoined by pressing their relevant key on the keyboard. As per [Emily]’s instructions for displaying the piece, it’s intended that the radio corresponding to C be tuned in to a local classical station. Keys A, B, D, E, F, and G are then to be tuned to other local stations, while the sharps and flats are to be tuned to the spaces in between, providing a dodgy mix of static and almost-there music and conversation.

It’s an interesting art piece that, no matter how well you play it, will probably not net you a Grammy Award. That would be missing the point, though, as it’s more a piece about “Collecting Fragments of Time,” a broader art project of which this piece is a part.

We do love a good art piece, especially those that repurpose old hardware to great aesthetic achievement.

Continue reading “The Trans-Harmonium Is A Strange Kind Of Radio-Musical Instrument”

Radio Station WWV: All Time, All The Time

Of all the rabbit holes we technical types tend to fall down, perhaps the one with the most twists and turns is: time. Some of this is due to the curiously mysterious nature of time itself, but more has to do with the various ways we’ve decided to slice and dice time to suit our needs. Most of those methods are (wisely) based upon the rhythms of nature, but maddeningly, the divisions we decided upon when the most precise instrument we had was our eyes are just a little bit off. And for a true time junkie, “a little bit off” can be a big, big problem.

Luckily, even the most dedicated timekeepers — those of us who feel physically ill when the clock on the stove and the clock on the microwave don’t match — have a place to go that’s a haven of temporal correctness: radio station WWV. Along with sister stations WWVB and WWVH, these stations are the voice of the US National Institutes for Standards and Technology’s Time and Frequency Division, broadcasting the official time for the country over shortwave radio.

Some might say the programming coming from these stations is a bit on the dry side, and it’s true that you can only listen to the seconds slip by for so long before realizing that there are probably better things to do with your day. But the WWV signals pack a surprising amount of information into their signals, some of it only tangentially related to our reckoning of time. This makes these stations and the services they provide essential infrastructure for our technological society, which in turn makes it worth your time to look into just how they do it.

Continue reading “Radio Station WWV: All Time, All The Time”

DIY Tachistoscope Feeds Your Hunger For Popcorn And Propaganda

You’ve probably heard of subliminal advertising — the idea is that behaviors can be elicited by flashing extremely brief messages on a movie or TV screen. “BUY POPCORN NOW” is the canonical example, with movies containing such subconscious messaging supposedly experiencing dramatic increases in popcorn sales.

Did it work? Maybe, maybe not, but the idea is intriguing enough to at least explore using this subliminal tachistoscope. [Roni Bandini] seems to have taken this project on as a sort of cautionary tale about brainwashing techniques, not only in motion pictures and TV but in printed media too; he goes pretty hard on the Peronistas’ use of not-so-subliminal messages to mold young Argentinian minds back in the 1940s and 50s.

The tachistoscope [Roni] presents is a little more sophisticated than those ham-fisted propaganda attempts. The Raspberry Pi-powered device downloads a video from YouTube and automatically replaces random frames with a propaganda message inspired by those used by the Peronistas, with the modified video piped to a composite video output for display on a TV.

A digital counter on the tachistoscope keeps track of the total time viewers have been propagandized. For extra fun, the machine has a switch to enable ChatGPT-created political messages to be inserted into the stream; we shudder to think what those might look like. Watch the video below for a sample of the brainwashing, but don’t blame us if you fall in love with [Evita].

We understand that this is more of a statement on the power of propaganda than an actual tool for mind control, but if [Roni] is serious about his brainwashing, some small mods might make it more effective. Thanks to the full frame of text on a black background, the subliminal messages aren’t very subliminal; they might be more subtle if the text was overlaid on the target frame rather than replaced completely. Seems like that should be possible with ffmpeg or something similar.

Continue reading “DIY Tachistoscope Feeds Your Hunger For Popcorn And Propaganda”

LED Art Project Is Geometrically Beautiful

There is no shortage of companies on the Internet willing to sell you expensive glowing things to stick on your walls. Many hackers prefer to make their own however, and [Chris] is no exception. His LED wall art is neat, tidy, and stylish, all at once.

Wanting a geometric design, [Chris] decided to have his layout designed by a random number generator. He created his own tool that would generate a design using preset segment lengths arranged in a random fashion. Once he found a layout that worked for him, he designed a set of plastic adapters that would let him connect pre-cut lengths of aluminium channel together so he could assemble his design.

With the frame complete, he then laid the LED strips into the channels, after mapping out how he would connect the full circuit of addressable LED strips. He enlisted a Raspberry Pi Zero W as the brains of the operation, responsible for commanding the strips to light in the colors of his desire.

In a nice aesthetic touch, he sanded the whole frame and painted it a uniform grey color. This hid the joins between the 3D-printed parts and the aluminium channels, and gave it a more finished look. He also went to the trouble of graphing out the locations of the various LEDs in the frame, and used this data as the basis for animations that race between points on the frame. It’s somehow more compelling than the usual simple color fades and flashes of typical commercial products.

It’s a tidy build, and a level more artful than some of the off-the-shelf products out there. For his investment of time and money, [Chris] has netted an excellent piece of wall art in the process.

Voyager 1 In Trouble As Engineers Scramble To Debug Issue With Flight Data System

Recently the team at JPL responsible for communication with the Voyager 1 spacecraft noticed an issue with the data it was returning from the Flight Data System (FDS). Although normally the FDS is supposed to communicate with the other subsystems via the telecommunications unit (TMU), this process seems to have broken down, resulting in no payloads from the scientific instruments or engineering sensors being returned any more, just repeating binary patterns. So far the cause of this breakdown is unknown, and JPL engineers are working through potential causes and fixes.

This situation is not unlike a similar situation on Voyager 2 back in 2010 when the returned data showed a data pattern shift. Here resetting the memory of the FDS resolved the garbled data issue and the engineers could breathe a sigh of relief. This time the fix does not appear so straightforward, as a reset of the FDS on Voyager 1 did not resolve the issue with, forcing the team to consider other causes. What massively complicates the debugging is that each transmission to and from the spacecraft takes approximately 22.5 hours each way, making for an agonizing 45 hour wait to receive the outcome of a command.

We wish the JPL engineers involved all the luck in the world and keep our collective appendages crossed for Voyager 1.

X86 ENTER: What’s That Second Parameter?

[Raymond Chen] wondered why the x86 ENTER instruction had a strange second parameter that seems to always be set to zero. If you’ve ever wondered, [Raymond] explains what he learned in a recent blog post.

If you’ve ever taken apart the output of a C compiler or written assembly programs,  you probably know that ENTER is supposed to set up a new stack frame. Presumably, you are in a subroutine, and some arguments were pushed on the stack for you. The instruction puts the pointer to those arguments in EBP and then adjusts the stack pointer to account for your local variables. That local variable size is the first argument to ENTER.

The reason you rarely see it set to a non-zero value is that the final argument is made for other languages that are not as frequently seen these days. In a simple way of thinking, C functions live at a global scope. Sure, there are namespaces and methods for classes and instances. But you don’t normally have a C compiler that allows a function to define another function, right?

Turns out, gcc does support this as an extension (but not g++). However, looking at the output code shows it doesn’t use this feature, but it could. The idea is that a nested function can “see” any local variables that belong to the enclosing function. This works, for example, if you allow gcc to use its extensions:

#include <stdio.h>

void test()
{
   int a=10;
   /* nested function */
   void testloop(int n)
   {
      int x=a;
      while(n--) printf("%d\n",x);
   }
   testloop(3);
   printf("Again\n");
   testloop(2);
   printf("and now\n");
   a=33;
   testloop(5);
}

void main(int argc, char*argv[])
{
   test();
}

Continue reading “X86 ENTER: What’s That Second Parameter?”