Cover photo
Brian Swetland
Works at Playground Global
1,960 followers|912,416 views


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!
Dan Morrill's profile photoMathias Agopian's profile photo
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.

David Given's profile photoVladimir Pantelic's profile photoChristopher Friedt's profile photoNishanth Menon's profile photo
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:
5 comments on original post
Christopher Tate's profile photoDan Johnson's profile photoMarc MERLIN's profile photoKeith Deacon's profile photo
+Dan Johnson indeed, try this link instead:
Add a comment...

Brian Swetland

Shared publicly  - 
Dear Google,

This thing in docs, etc where the "create new x" action is a plus-in-a-circle in the lower right corner of the UI, directly opposite the action menu cluster that contains all the other actions is really obnoxious.  Would you consider also leaving a "new x" menu item in with everything else for those of us who are used to the radical concept of all the controls clustered together in one easy to find place?

Matias Duarte's profile photoMathias Agopian's profile photoJeff Bush's profile photoBrian Swetland's profile photo
+Matias Duarte Please don't move all the other controls to the lower right too!  Just in case somebody thinks that might help...
Add a comment...

Brian Swetland

Shared publicly  - 
So, I'm confused.  The body of is not even cold yet and Google's launching which is about "fully featured" private git repositories on the google cloud platform.  Though there does not seem to be any type of code review system or ACLs to manage shared access (like one would say use gerrit or github for), or really any significant feature to make it more useful than just hosting git behind ssh, which you can do for free, trivially, anywhere... but there's a built in editor and java debugger. 

And there's a Free Trial!  But Google needs your billing information.  And the FAQ explains that when the trial ends "Your instances will be paused, and you'll have the option to upgrade to a paid account. You must upgrade within 30 days of your trial ending or we won’t be able to restore your instances."  So that seems like a GCE free trial.

Anyway, I'm confused.  Who's this for?  What problem is it supposed to be solving?

Okay you can add members that can either view or edit, so that's something I guess...

Looks like commandline push/pull access requires use of google cloud tools auth infrastructure instead of just ssh rsa keys...
Google Cloud Source Repositories are fully-featured Git repositories hosted on Google Cloud Platform.
Graydon Saunders's profile photoDan Morrill's profile photoKeith Deacon's profile photo
It figures I'm too late - I do have a tendency to get lost down a rabbit hole for a bit and only come up for food or air.
Add a comment...

Brian Swetland

Shared publicly  - 
Well said.
Apple and Privacy, Just like Google

One thing that really annoys me about Apple is how it is using its reality distortion field to twist the message about privacy. Only a week ago, Tim Cook said this:

”I’m speaking to you from Silicon Valley where some of the most prominent and successful companies have built their businesses by lulling their customers into complacency about their personal information. They’re gobbling up everything they can learn about you and trying to monetize it. We think that’s wrong. And it’s not the kind of company that Apple wants to be. So we don’t want your data. “

“We don’t think they’re worth have your email or your search history or now even your family photos data-mined and sold-off for God-knows-what advertising purpose.”

And then, at the WWDC Keynote, they announced the new Apple News app. What does this app do? Well… I quote from their product page:

”The stories you really care about. The more you read, the more personalized the News app becomes, refining the selection of stories delivered to your screen so they are relevant to you. Easily share articles with others and save them to read offline. News stays on top of the stories you’re interested in. So you can, too.”

So… how can Apple learn what it is that you are interested in, and deliver that information to you without tracking people?

Granted, at the keynote, Craig Federighi also displayed a slide pointing out the privacy features for Apple News. These included:

Not associated with Apple ID
Random identifier
Not linked to other Apple services
Not shared with third parties
You’re in control

Clearly pointing their fingers at Google.

First of all, this is a weird way of doing things. Not having the news targeting data linked to your Apple ID means that it can’t be used across devices. Your iPhone and your iPad won’t know which is which. And if you buy a new iPhone, you will have to teach your news app all over again from scratch.

What’s the point of that? That’s not a privacy issue. That’s just terrible UX. 

It’s also not linked to other Apple services, meaning that Apple won’t be able to show you news from where you are in Apple Maps, compared to your personal interests. That seems like a weird limitation, and again, poor UX.

Finally, we have the “Not shared with third parties”.

It’s so annoying. Why, because neither is Google
It’s the same thing. Google isn’t sharing anything. No advertiser sees any user data, ever.

It’s like when you advertise in a newspaper. You pay the newspaper to display the ad in the right section. But as an advertiser, you have no clue as to who it reaches. You just know it has been targeted right.

That’s how Google Adwords work.

More to the point, tools like Google Analytics work almost exactly like Apple News. It too is anonymous, not associated with people’s Google IDs, uses randomized identifiers, not linked to other Google services, nor is it shared with third parties. 

Granted, you can add aggregated demographic data to this as well, in which case it does link to Google Adwords, but it’s still anonymous, and you have no way to track that on an individual level.

I get so annoyed by this. Apple is promoting itself as the savior of privacy online, bashing Google and others with vaguely misleading statements along the way.

That said, there are genuine concerns about privacy as well.

For instance, there is a real problem around the whole industry of data brokers. These are companies who are buying and selling user data to the highest bidder, from anywhere. For instance, when you go into Target to buy a t-shirt, they will end up knowing your age, income, social status, your food preferences, and sometimes even your medical history. 

Similarly, when I then go into another store a week later, then they suddenly also know that I bought a T-shirt.

That’s not right. That’s terrible! It should be illegal for companies to buy/sell/share their data. (and indeed it is in my country).

If I go into a store, whatever I do and whatever I buy in this store should be kept between the store and me. It is a massive violation of trust when that store sells this information to others. 

That is a real privacy problem.

This also extends to websites. If I visit a newspaper, what I read should not be bought and sold by other companies. That is an interaction purely between me and the newspaper. 

The newspaper can target me all it wants based on the interaction that has taken place between us. But when I then visit another newspaper, they shouldn’t be allowed to know what topics of articles I read elsewhere. 

This is the whole concept of privacy. 

Apple is doing this right because what it tracks is kept within Apple. Which is good. And that is also how Google works. Whatever you do on Google, stays with Google.

But the rest of Apple PR bashing about privacy is just that, PR.

Look at Apple Music, which will be available on iPhone, iPad, Mac, Windows and Android. Here you can create your own playlists, follow artists, like, comment and share things.

The only way they can do that is by linking your actions to your Apple ID. How else would it be able to show you the playlist on your phone that you just created on your Mac? How else would it be able to keep track and notify you across devices when there is an update to something you engage with?

So, Apple is using your data, just like everyone else. As Apple says on their site (about Apple Music)

“Enjoy recommendations handpicked just for you or explore everything they find that’s new and noteworthy in the world of music. It’s all yours.”

“Even with a library this massive, finding the music you’re looking for is easy. The intelligent search engine remembers whether you’re looking in your local library or the Apple Music library, so you get results from the place you expect. You can also browse music you’ve looked for previously, and see what searches are trending.”

”Tell us what you like. Discover something you’ll love. When you tell us the genres and bands you’re into, we’ll bring you more suggestions from our experts who know and love music. They’re out at the big shows and the small gigs, combing scenes to bring you emerging artists and deep cuts, and creating playlists that feel like they’re coming from a friend who knows exactly what you want to hear.”

”The more you listen, the better we hear you. When we make recommendations, we consider what you tell us you like. Whether you love a song or not, your feedback helps our suggestions get better and better. But we also pay attention to what you actually play. So if you’re an EDM fan with a secret affinity for big band music, we’ll find you more stuff that swings. And drops the beat.”

How is this not exactly the same as what Google is doing with their services?

Oh, you say. But Apple isn’t using this to sell advertising. Really? 

Here is the description of ad targeting for the Apple News app:

”Monetization of Apple News Format content is simple with iAd, Apple’s advertising platform. When monetizing with iAd, you’ll have access to iAd’s segmentation capabilities, so your advertisers can reach just the right audience within your content. iAd targeting is accurate and scalable, and based on registration data from hundreds of millions of validated Apple users.”

So, when Apple said that Apple news was anonymous, not associated with Apple ID, uses a random identifier, nor linked to other Apple services, that apparently only applies to all the things that aren’t iAds. Because with iAds, they can accurately target your content to millions of Apple users.

Again, just like Google.

Add that Apple recently announced they will support ad blockers in Safari on the iPhone, thus blocking newspapers from earning money that way. While iAds does work in their own news app... well...

This is why I get so annoyed when I hear Apple’s PR machine talk about privacy. First, we have Tim Cook saying: “They’re gobbling up everything they can learn about you and trying to monetize it. We think that’s wrong. And it’s not the kind of company that Apple wants to be. So we don’t want your data.“

Then they launch two new services; Apple Music and Apple News, both featuring individual targeting, tracking and tailoring. Including integration to iAds.

I call shenanigans. 

Both Apple and Google track what you do. Both companies use that information. And both companies that keep information within themselves, thus ensuring your privacy stays intact. 

There is nothing wrong with that. In fact, as they both show, doing this creates much better products for you and me.

Let’s instead focus on the much more important issue of data brokers, and how data from one site is sold or given to others, thus causing one company to know what you did in another store. 

That is the real issue we should be dealing with. Not how data is used between us and the individual companies that we have chosen to be a part of.
143 comments on original post
Nicolas Klein's profile photoJeff Yaksick's profile photo
Add a comment...
Have them in circles
1,960 people
David Scheltema's profile photo
Alice Morgan's profile photo
Chris Ball's profile photo
Danny Lambert's profile photo
John Affaki's profile photo
Anurag M's profile photo
Ted Feng's profile photo
Regan Parks's profile photo
marius lazar's profile photo

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.


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.

- 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.

“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
Anisse A.'s profile photoPeter Burns's profile photoJason Juang's profile photoDan Sandler's profile photo
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).
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.)
Daniel Egnor's profile photoErik Gilling's profile photoBrian Swetland's profile photoKeith Deacon's profile photo
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...

Brian Swetland

Shared publicly  - 
I've found the Logic16 handy from time to time and recently decided to pick up one of the fancy new Logic 8 Pros.  It showed up this today while I was taking pictures of some SWD (ARM serial wire debug protocol) transactions, so I hooked up the 8 Pro to see how it stacked up.

The 50Ms/s obviously doesn't give as fine a picture as the 1Gs/s capture from my desk scope, but it's still pretty neat.  My interest in the 8Pro was more about higher sample rates from the digital channels -- the analog capture is just extra fun thrown in.

They've spiffed up the software a bit too.
Daniel Egnor's profile photoBrian Swetland's profile photoMichael Wright's profile photoNanik T's profile photo
Add a comment...

Brian Swetland

Shared publicly  - 
Why ? - short answer : Because I want to. Why ? - long answer : Computers are quite opaque, looking at them it's impossible to see how they work. What I would like to do is get inside and see what's going on. Trouble is we can't shrink down small enough to walk inside a silicon chip.
Skirmantas Tumelis's profile photoPovilas Galčius (Bomberlt)'s profile photoAinius Beriozovas's profile photoLars Hallberg (Play is life)'s profile photo
Yeah saw this last night - looks amazing! I loved the quote "This could be where the conflict in scale between the megaprocessor and my living room starts to escalate"
Add a comment...

Brian Swetland

Shared publicly  - 
Anybody know of an ARM M4 (or maybe M3) MCU with integrated high speed (480mbps) USB2?  (no external PHY needed)
Matt Roche's profile photoBrian Swetland's profile photo
I ended up using the LPC4370 since you can get a LPC Link II board with such a critter on it for $19 from digikey (intended to be used as a SWD/JTAG debug board, which is my use case as well).  It's a crazy 204MHz M4+M0+M0 part.
Add a comment...

Brian Swetland

Shared publicly  - 
You know, Google, nagging me to set up a payment instrument when I'm trying to install free software (on a secondary device with a secondary account) is never going to get me to enter a credit card number.  I'll just roll my eyes and click the SKIP button you stuck way off in the lower lefthand corner of the dialog, in smaller text, in dim gray, like the last N times I've been nagged about this.

Sonos, you, on the other hand, get a gold star today.  The latest Android Sonos Controller App is fantastic.  Fast and responsive in all the ways it never was before.  Editing playlists is now enjoyable, not an exercise in utter misery and incomprehensible levels of jank and lag.  Keep up the good work.
Chris Adams's profile photoRyan Hickman's profile photoBrian Swetland's profile photo
9.5 years at Google gave me a pretty good view of what could and could not be fixed based on my feedback internally.  It also definitely showed me that Google responds better to external customer outrage than internal engineering concerns, even when the content of such feedback is identical, and listening to the engineers would have avoided the customer outrage.
Add a comment...
Have them in circles
1,960 people
David Scheltema's profile photo
Alice Morgan's profile photo
Chris Ball's profile photo
Danny Lambert's profile photo
John Affaki's profile photo
Anurag M's profile photo
Ted Feng's profile photo
Regan Parks's profile photo
marius lazar's profile photo
Building Awesome Stuff
  • 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.
    Software Engineer, 1995 - 1996
Writing the Codes
Contributor to