Profile

Cover photo
Brian Swetland
Works at Playground Global
1,977 followers|948,949 views
AboutPostsPhotos

Stream

Brian Swetland

Shared publicly  - 
 
An experiment in fire-and-forget PCB fabrication and assembly.

I put together a tiny little board, using all "house parts" (no additional placement fees), except for the little STM32F042 MCU (U1), to try out https://macrofab.com/

Oops.  Looks like I failed at the BOM editor and managed to use the same p/n regulator as their "house" part but didn't match, so that's costing me more too.  Fixed the BOM and future boards will be $0.70 cheaper!

It's a tiny STM32F042 (cute part, super cheap Cortex M0 with no-crystal-needed USB client support) test board and/or USB<->Serial adapter (modulo firmware), but I threw some LEDs and a pushbutton on too, because why not...
16
Travis Geiselbrecht's profile photoEric Brombaugh's profile photoChristopher Hoover's profile photoErik Gilling's profile photo
43 comments
 
For those interested, I made a board to try out macrofab as well: https://plus.google.com/u/0/+ErikGilling/posts/VzWAN541UCX
Add a comment...

Brian Swetland

Shared publicly  - 
 
New G+.... kinda weird. Not sure why it has to pop up this postcard to write in instead of just doing it inline. Also typing in here feels laggy, probably due to it busily cycling comments rather than showing multiple comments below posts.

Is it my imagination or are the columns thinner? There's a lot of dead gray space in my browser...

5
Brian Swetland's profile photoGraydon Saunders's profile photoMichael Powell's profile photo
14 comments
 
Home hasn't been chronological in years. This is one of the major reasons why I consider filtering by circles to be so indispensable.
Add a comment...

Brian Swetland

Shared publicly  - 
 
Dear Lazy Plus,

Let's pretend I have Ubuntu 15.10 installed on a shiny new Thinkpad X250, and further that I use WindowMaker as my window manager because I an nostalgic for the mid-90s and Unity makes my eyes bleed.

Now, this hypothetical laptop has a higher density display than before, such that I'd like to have gnome/gtk apps to honor the system settings to scale the UI up a bit so things are easier to read.  If I wanted the various settings daemons to run so this stuff worked but still use WindowMaker, is there some sane way to make that happen?

Just manually running gnome-session and unity-settings-daemon after starting my session did not quite work (and something took over the desktop and intercepted WindowMaker's root menu... boo)
1
Benjamin Staffin's profile photoDaniel Egnor's profile photoBrian Swetland's profile photo
16 comments
 
xsettingsd looks promising
Add a comment...

Brian Swetland

Shared publicly  - 
 
Human Resource Machine is an adorable visual assembly language programming game, designed to be playable by non-programmers.  The game very gently introduces the player to the concepts, little by little, but the underlying "processor" under the cute visualizations is pretty realistic.
http://tomorrowcorporation.com/humanresourcemachine
http://store.steampowered.com/app/375820/

There's probably 3-5 hours of gameplay for somebody with programming background (I wrapped up the game and most of the optional levels in a bit over 3 hours, but some of those later optional levels are work and some levels I could really stand to optimize a bit), and it'd probably take longer for somebody learning along the way.

The UI is clearly designed to be tablet-friendly, and apparently tablet versions will launch in a couple weeks.  Today it's available for PC and OSX on Steam.

I think it could actually be a decent tool for teaching assembly language level programming (including concepts of memory, pointers, indirect access, etc).

By the end of the game you have an instruction set that consists of:
read-input (to A)
write-output (from A, A = NIL)
load (to A)
store (from A)
add (A = A + mem)
sub (A = A - mem)
inc (mem++, A = mem)
dec (mem--, A = mem)
jump
jump-if-zero
jump-if-negative

and the memory operations support indirect addressing

That's a pretty "real" (if minimal) instruction set, and is less nonsensical than many.

The big difference from most real machines is that values can be A-Z 0-9 or NIL and reading NIL, writing NIL, or doing math on values of different types causes a fault. 
15
1
Michael Andrews's profile photoKiki Jewell's profile photoMichael Powell's profile photoKeith Deacon's profile photo
11 comments
 
Just picked this up tonight. Spent a couple hours, and got to the point where it just starts to get hard. I just completed the Fibonacci level.

Mind you, the way I play these games, I don't really consider myself to have beat a level until I've hit all the goals, and I need to go down all the side paths. So this'll likely take me a lot more than 5 hours to finish.

But I'm enjoying the hell out of it!
Add a comment...

Brian Swetland

Shared publicly  - 
 
My current vote for GOTY 2015 is UNDERTALE, an awesome, quirky, cleverly designed indie JRPG with fun characters and monsters, a catchy soundtrack, and some unique mechanics and storytelling.  It's not an expensive ($10) game or a long (5-7 hours maybe) one.  It's definitely worth playing without spoilers if you can.

Website: http://undertale.com/
Steam: http://store.steampowered.com/app/391540
Trailer: https://www.youtube.com/watch?v=1Hojv0m3TqA
Soundtrack: http://tobyfox.bandcamp.com/

I strongly advise avoiding spoilers and going in cold for the most enjoyable experience.  I'm not usually a completionist with RPGs, but this is one that has me starting my third play-through to experience some additional different choices...

About This Game:
Welcome to UNDERTALE. In this RPG, you control a human who falls underground into the world of monsters. Now you must find your way out... or stay trapped forever.

Features:
- Killing is unnecessary: negotiate out of danger using the unique battle system.
- Time your attacks for extra damage, then dodge enemy attacks in a style reminiscent of top-down shooters.
- Original art and soundtrack brimming with personality.
- Soulful, character-rich story with an emphasis on humor.
- Created mostly by one person.
- Become friends with all of the bosses!
- At least 5 dogs.
- You can date a skeleton.
- Hmmm... now there are 6 dogs...?
- Maybe you won't want to date the skeleton.
- I thought I found a 7th dog, but it was actually just the 3rd dog.
- If you play this game, can you count the dogs for me...? I'm not good at it.

Reviews:
“The puzzles aren't particularly impressive.”
10/10 – Destructoid

“I have a couple of issues with the user interface.”
10/10 – PCInvasion

“If there’s a criticism to be had, it’s that sometimes Toby Fox doesn’t know when to let a joke go.”
10/10 – The Jimquisition
9
1
Anisse A.'s profile photoPeter Burns's profile photoJason Juang's profile photoDan Sandler's profile photo
5 comments
 
OK, did a second playthrough and am glad I did. Not quite GOTY for me, just because I like NecroDancer so much, but it's up there.
Add a comment...

Brian Swetland

Shared publicly  - 
 
An Adventure in USB Debugging

I recently migrated my m3debug project (host tools and device firmware for ARM MCU debugging using SWD, a lighter-than-JTAG interface modern ARM MCUs speak) from a smaller MCU supporting "full speed" (12Mbps) USB to "high speed" (480Mbps).

The new part had a much fancier (and more complex) USB Device Controller, which took a bit of mucking about with to get working.  Then I spent time using the facilities of the new MCU to achieve much better throughput between the host and the debugged target, which was cool.  Then I ran into baffling failures where things would just hang forever.

There were a lot of moving parts here -- new MCU, new UDC, rewritten code to do SWD faster and better, etc, etc.  After a bit of tracing the hang was isolated to the point where the firmware responds to the host.  The protocol used is really simple -- the host sends a buffer of SWD transactions to execute, the device firmware executes these, then sends a summary of the results (or read-back data) in reply.  The host does a simple a. assemble packet, b. send packet, c. read response, d. parse response, and the device sits in a loop doing a. read packet, b. process packet, c. send response.  The device is stuck at C.

Digging into the state of the UDC, the response packet had been queued to the controller (capable of processing linked lists of transactions), but was still marked as active -- not completed or failed.  Hmmm.

The host on the other hand (after a bit of tracing there) was definitely receiving the expected response, then turning around and eventually timing out when the device never responded to the next packet it sends.

More frighteningly the reproducibility of this varied depending on what USB port and what cable I used...

And then I went back and reviewed how USB works "on the wire" and it was enlightened.

USB "transactions" are composed up of smaller packets which the host and device exchange.  In the case of reading data from the device (what USB calls an "IN" transaction), the host sends an IN Token Packet, which if the device receives it successfully and has data ready to send, it will reply with a DATA Packet (otherwise it'll send a NAK).  If the host successfully receives the DATA Packet, it completes the transaction with an ACK.

Now it became pretty clear that the failure case was a situation where the host received the data, sent the ACK, and went on its merry way, but the client did not receive the ACK (or it was corrupted).  The client is now stuck forever waiting for the transaction to finish and the host eventually gives up because the client isn't receiving the new request it's trying to send.

The problem is that both sides are doing naive send-command/wait-response and wait-command/send-response cycles.  If either side goes a bit more asychronous the problem will go away, because if the host requests the next IN packet, the data toggle handshake used for Bulk requests will result in it receiving a retransmit of the last one, ACKing it (but ignoring it), and then being ready to receive the next packet.

So either:
1. The host can receive in a thread or with asynch queued reads, so it'll always be looking for the next packet (and thus ensuring that any packet that missed an ack will complete rapidly).
or
2. The client can allow for one response to be outstanding (queueing it but not waiting for it to complete until it's time to queue the next response), so that it can read the next request, allowing the host to start reading the next response ensuring that the previous one completes.

(I opted for #2 for the moment because it was the easiest to implement, but plan to migrate to #1 as I prefer to keep the complexity on the host side of things.)
4
1
Daniel Egnor's profile photoErik Gilling's profile photoBrian Swetland's profile photoKeith Deacon's profile photo
7 comments
 
Well both #1 and #2 protect vs lost/corrupted ACK packets, it's just a matter of is it the responsibility of the client or the host...

Technically, a most-optimal (performance-wise) solution will want both sides to always have a transfer queue'd in each direction if possible, in which case you get best reliability too.
Add a comment...
Have them in circles
1,977 people
aung min's profile photo
Ben Shapiro's profile photo
남박준상's profile photo
ade tarmono's profile photo
Eldon Edwards's profile photo
juniawan damanik's profile photo
Ina Stephens's profile photo
Robert Burns (burnsra)'s profile photo
Brian Fitzpatrick's profile photo

Brian Swetland

Shared publicly  - 
 
Here's something I'd like to be able to do in my editor...

Say I have three, call them "panes", side-by-side (let's label them A, B, C, left to right) showing three source files.  I'd like to open a new source file (be it for the first time or be it recalling an already open buffer) such that that file shows up in pane A, pane B displays what was previously in pane A, and pane C displays what was previously in pane B.

Sorta operating like a stack where the most recent file I pull up is always in the primary pane and everything pushes down.  Shortcuts to swap B or C (or D...) with A would be nice, as would a way to lock one of the secondaries so it doesn't move (say I want foo.c in B even if I pull it up in A, etc).

I'd love to be able to do this with gvim but the vim scripting stuff is pretty horrific.  Does any existing editor (for Linux) do this sort of thing or are there some plugins/extensions for vim or whatnot?
5
Christopher Tate's profile photoOmari Stephens's profile photoNaseer Ahmed's profile photoBrian Swetland's profile photo
12 comments
 
+Daniel Egnor well even when I used xemacs primarily, vim was my quick-edit-in-terminal-or-remote goto editor.  But yeah, I'm also wary of becoming dependent on closed/commercial software for something so fundamental.

I really don't want to write my own editor, that's like the ultimate rathole which I've avoided thus far.  I wish vim/gvim were just a bit less crufty.
Add a comment...

Brian Swetland

Shared publicly  - 
 
The office now features a pancake-making-machine...
26
Daniel Egnor's profile photoJack Palevich's profile photoKiki Jewell's profile photoMathias Agopian's profile photo
15 comments
 
For some reason this reminds me of the Cornballer ;-) keep it safe guys!
Add a comment...

Brian Swetland

Shared publicly  - 
 
This weekend's nifty indie game: Duskers
"Pilot drones into derelict spaceships to find the means to survive and piece together how the universe became a giant graveyard."
http://duskers.misfits-attic.com/
http://store.steampowered.com/app/254320/

Some gameplay video: https://www.youtube.com/watch?v=SSzKjcbBDQY

The interface is pretty much entirely keyboard / console, which works well to evoke the feeling of remote operating your squad of drones exploring these broken, abandoned, and often alien-infested ships.

(screenshots are from the game's Steam Store page)
7
1
David Given's profile photoFredrik Holmqvist's profile photo
 
Scott Manley did a piece on it: https://www.youtube.com/watch?v=aKmo85U9HNg

It looks really cool.
Add a comment...

Brian Swetland

Shared publicly  - 
 
Yay, Google Photos added metadata editing (can fixup those no-date-stamp pictures of which I have a TON from years ago)...

Boo, you have to do it ONE PICTURE AT A TIME...

C'mon Google.  Throw me a bone here!
7
Dan Morrill's profile photoMathias Agopian's profile photo
2 comments
 
That in 2015 there are still software that's designed without bulk manipulation of data KILLS me. It's nuts. You see this is many apps: music, contacts, chat, photos, etc... This infuriates me, actually.

When I worked at Be, someone told me "if it's on screen, then it's selectable. Period". I feel like the same goes for list; if its a list, then you can manipulate several items in that list. Period.
Add a comment...

Brian Swetland

Shared publicly  - 
 
Augh.  Device Tree is such a steaming pile of shit.  Yeah, a giant maze of runtime-bound-by-string-match, untyped, undocumented mess that needs to be "compiled" into a binary format and bundled somewhere because the kernel won't usefully boot without it is such an improvement over board files and platform data.

Unbelievable.
19
3
David Given's profile photoVladimir Pantelic's profile photoChristopher Friedt's profile photoNishanth Menon's profile photo
15 comments
 
Bear in mind that it could be worse - see FEX, for example.
Add a comment...

Brian Swetland

Shared publicly  - 
 
Very cool.
 
The Museum of Communication in Seattle is a rare view into old mechanical phone switches. Super cool to see.

The Living Computer Museum is also quite good and worth a visit if you're in Seattle

Blog post:
http://marc.merlins.org/perso/trips/post_2015-08-17_Seattle-Museum-of-Communication-and-Living-Computer-Museum.html
5 comments on original post
11
1
Christopher Tate's profile photoDan Johnson's profile photoMarc MERLIN's profile photoKeith Deacon's profile photo
5 comments
 
+Dan Johnson indeed, try this link instead:  https://goo.gl/photos/UuRJ18AmnVpSfsxV8
Add a comment...
People
Have them in circles
1,977 people
aung min's profile photo
Ben Shapiro's profile photo
남박준상's profile photo
ade tarmono's profile photo
Eldon Edwards's profile photo
juniawan damanik's profile photo
Ina Stephens's profile photo
Robert Burns (burnsra)'s profile photo
Brian Fitzpatrick's profile photo
Work
Occupation
Building Awesome Stuff
Employment
  • Playground Global
    Writes the Codes, 2015 - present
  • Google, Inc
    Senior Staff Software Engineer, 2005 - 2014
    Android Kernel Engineer / Platform Architect / Systems Team Lead
  • Android, Inc
    Senior Robot Wrangler, 2004 - 2005
    Android Engineering Team. Platform prototyping.
  • Danger, Inc
    Senior Kernel Engineer, 2000 - 2004
    Hiptop OS, Virtual Machine, and Core Libraries.
  • Be Inc.
    Kernel Engineer, 1998 - 2000
    SCSI subsystem and drivers. USB stack and drivers. Misc kernel engineering.
  • Neoglyphics Media Corp
    Software Engineer, 1996 - 1998
    Web backend glue.
  • NCSA SDG
    Software Engineer, 1995 - 1996
    X/Mosaic
Story
Tagline
Writing the Codes
Links
Contributor to
Links