Transport strike over, working too hard
The nationwide transport strike in Nicaragua is over
I was a bit worried when it started - the US state department issued an advisory that US citizens stock up on a week's worth of food
, there were reports of violence
, and food shortages
The strike didn't have all that much effect on San Juan Del Sur, otherwise known as "gringolandia". The food shelves never emptied, and although the streets were quiet and devoid of smoking busses and drivers yelling "RivasRivasRivas" all of last week, it was more likely that if you looked like you needed a lift, someone would pull you into an alleyway and say:
"Psst. Wanna ride?".
People adapted. They hitchhiked (even more than usual), dragged old bikes out of garages, walked, or stayed on their front porches and visited with each other.
Today the taxi drivers seem more subdued than usual. They should be happy, they got their prices reduced for gasoline reduced to a little over $3 dollars a gallon (and to pay for it, non-public transport got their costs raised to $5.30 a gallon). A long term plus is the government promised to import & finance 3,000 kits to transform taxis from gasoline to LP-gas (propane).
Now I've got a week's worth of canned food to get through. Yum.
In solidarity the local "transport you to surf" business also shut down, and I got in a bad habit of working from sunup (which for me seemed to be from 10:30 or so) nearly to sunup (4-5 AM) - with a major nap from 3-6PM. Working, especially late at night, has always been a very productive thing for me, but the lack of sunlight and conciousness at crucial parts of the day really cut down on the fun I could have had. Waves were good (but it took effort to line up transport, so I didn't go), sun was good (but I was working), people were having a good time (but I was working), and my closest friend down here was closeted with his gf (and I was working). My distractions were minimal. I barely noticed the time flying by. Sometimes I'd be hungry for hours before I would get up to do anything about it.
I got a ton of work done, a brainful of code dumped, working, and outlined. It's all broken up in small enough pieces now that I hopefully won't have to do a 90 hr workweek for a while. The cooltop guys are onto something
I got a major module to proof of concept on friday morning, more on that in a minute. For "relaxation", I spent the next 24 hours hacking on a major problem in the jack audio connection kit involving some hairy problems with threading and a runaway process
. I'm on about my 7th crazy theory, but I think the one I'm on now has some legs.
I finally took a break on Saturday afternoon, whipped out my guitar, and started playing in front of my office. More than a few people stopped by to listen, and a few people that I only knew in passing borrowed my guitar and revealed themselves to be good players. I already knew my neighbor Pablo could play, but didn't know Marvin (who works for adelante in the back), did. He played and sang some great classic spanish songs and then surprised me with a pretty good rendition of "sounds of silence" - neither of us knew the words.
It was a beautiful day, I cheered up enormously by sundown. I need to play outside more often, & maybe put out a begging bowl!
Then I went back to work. All last week I'd been:
Digging into the internals of Ardour
. I plan to rip out the existing tranzport and alphatrack drivers and replace them with stuff that uses the OSC protocol as an intermediary. However, to do it, I wanted to push OSC harder than I had ever heard anyone push it before. I wanted to send out packets as big as the udp protocol would allow, with a complete snapshot of audio position, gain, and volume, for every track, every 10 ms. I wanted to multicast the data across the network, so a profusion of potential controllers would be able to respond to and control ardour remotely. (think big mixing desks, or little things like the tranzport and alphatrack, and anything in between)
The broadcast protocol is designed to be able to compensate for lost data (by sending all the data, all the time, at fixed intervals, which is kind of like how voip works), by sending EVERYTHING. Brute force has its uses, this is one of them.
It's a crazy idea, though. Really. 100 64KB packets per second is 6.4 megabytes - per second - over half of a 100Mbit per second network. It will only work at all on a switched 100MB lan or a direct wire to the box. But: 100 64KB packets per second is only 5% of a GigE network! GigE cards are in most computers now, and GigE switches are less than a 100 bucks. So, while this idea was utterly insane 4 years ago, it is actually quite doable with modern technology.
At least in this case I'm using multicast (courtesy of liblo from svn), so, even if I have dozens of devices attached to ardour - software controllers on other machines, etc - network usage is flat, only a function of the number of the tracks, not the number of controllers, and the logic inside of ardour is dirt simple stupid, pushing the required intelligence out to the controllers, which have to sort it all out. (and I mean *all* - even the stuff they aren't interested in).
So I got that working Thursday night, with a few faked up bits where I couldn't figure out the depths of the class hierarchy well enough to get the data I needed, but enough to get a proof of concept running.
Result: On my main box, Ardour doesn't even notice that it is pumping out this much data. the cpu barely registers the activity. The wired lan shrugs it off, too. but my wireless network becomes unusable - not even dhcp packets can get through while the OSC multicast is running.
Wireless is significantly slower than 100Mbit ethernet, and worse, most wireless routers are configured as bridges, not routers, so even though you may have no listeners for a given packet on the wireless lan, mine just saturates anyway. If this router ran openwrt I'd be able to make it route (or block) OSC multicast, but it doesn't so I'm not sure what to do about it yet. I'm a little concerned about what I'm doing to my upstream provider...
I coded up a little client in python - and IT killed the system - because it wrote so much data to the screen that Xwindows ate 80% of cpu. (formatted, I imagine it was over 100MB/sec) I turn off the screen writes, and it's fine, so the client side can work, too.
It is rather nice to be able to do protocol design iteratively and not to have to worry about the layout of the fields, etc. OSC makes that part easy.
I have high hopes that over the next couple weeks I'll finally get the tranzport and alphatrack doing what I want them to do. At the same time, this past week really exhausted me, I have had no brain cells since saturday.
When not heads down into ardour I was working on turning this little algorithm into verilog:
for (i = taps ; i >= offset1; i--)
exp = (ec->fir_state_bg.history[i - offset1]*factor);
ec->fir_taps16[i] += (int16_t) ((exp+(1<<14)) >> 15);
for ( ; i >= 0; i--)
exp = (ec->fir_state_bg.history[i + offset2]*factor);
ec->fir_taps16[i] += (int16_t) ((exp+(1<<14)) >> 15);
Anyway, its Sunday night. And I'm going to go have some fun. Monday I start working on extracting the alphatrack driver from deep within ardour's guts, and the send protocol.
Labels: ardour, nicaragua