Msqur 1.0 update

I added an update to msqur today. Just a small update to the landing page since it was kind of blank. Moved the settings icon to the view page instead of every page. Also fixed the readme and license files for formatting.

I get a lot of hits from Russia on that site. Actually, I get a lot of hits from Russia on all my sites. I imagine most of them are bots probing for weaknesses. A bunch are trying to manipulate GET requests, but there’s not much you can do. Surprisingly little abuse to the upload function, which I thought would have been the first thing to be attacked. Msqur receives quite more hits than my other sites. Nothing’s happened so far, but I make backups so I’m not too worried.

Anyway, some thoughts for future updates are browse filters (by engine size, compression, etc.), a search function (not sure how to distinguish it from browsing since there isn’t much plain text to search for at the moment), and pagination to the browse index. But again, it’s on the back burner so not a huge priority for me.

Find videos by FPS

I produced some videos in 60 FPS, but couldn’t remember which ones. Since, of course, I didn’t label their FPS at the time, I needed to find them in vast sea of 30 FPS videos. Rather than just use a simple grep with ffmpeg to find which ones, I thought it might be more useful to find all videos that have a certain FPS threshold.

Usage: ./60fps.sh [directory]

#!/bin/bash

SAVEIFS=$IFS
IFS=$'\n'

function fpscheck
{
  FPS=$(ffmpeg -i "$1" 2>&1 | egrep -o '([0-9]*[.])?[0-9]+ fps' | egrep -o '([0-9]*[.])?[0-9]+')
  if [ $? -eq 0 ]
  then
    TEST=$(echo "$FPS"'>'50 | bc -l)

    if [ "$TEST" -eq 1 ]
    then
      echo "$FPS: $1"
#    else
#      echo "$FPS: $1"
    fi
#  else
#    echo "Could not get fps from: $1" >&2
  fi
}

for FILE in $(find "$1" -type f -name '*')
do
#  echo "trying: $FILE..."
  fpscheck "$FILE"
done

IFS=$SAVEIFS

If I thought I’d use it more, I’d move the hardcoded FPS test value to an optional argument for the script. Instead, I’ll leave that as an exercise for the reader.

Msqur 1.0 released

As mentioned previously, I wanted to open the source to msqur up and put development on the backburner. I have added an appropriate license for it (although I do need to add library licenses/notices in there as well). It is now GPL licensed, and I have made the repository public.

Some things I added:

  • Added basic charts for the 2D tables
  • Added table header text to tables
  • Added reingest script to allow for easier MSQ cache updates
  • Fixed some of the documentation up

Known issues, mostly the same as before:

  • MS3 file support is poor
  • Constants are just blurted out without any organization
  • INI Parsing of formulas and directives not implemented yet
  • API documentation is still in infancy

I want to move on to other projects, but I may come back from time to time to update things. I intend for the near future, at least, to leave msqur.com up and keep it updated.

Msqur Update v0.72b

I dug in this past weekend and updated a few things:

  • INI Parsing revamp. Support for more tables and curves.
  • UI Update so that all this new information is somewhat organized
  • A few minor bug fixes and enhancements

Known issues:

  • MS3 file support is poor
  • Constants are just blurted out without any organization
  • INI Parsing of formulas and directives not implemented yet

I plan on opening the source code up under some kind of OSS license, after fixing a few more issues and updating the documentation.

Msqur Update v0.60b

A little while ago I updated msqur.com to 0.60b. Changes include:

  • Added engine make/code fields for uploads
  • Added view count and increment

And less visibly:

  • Finished OO refactor
  • Update API documentation (not public yet)
  • Added deployment scripts

I still haven’t finished INI file parsing 100%. There’s a bit more to do, but I’ve been busy with work and other projects. I’m thinking of releasing the project under an appropriate open-source license once I finish that, so hopefully others can join in on the fun.

Msqur Update v0.53b

I’ve rolled out the update 0.53b to msqur.com. This includes:

  • INI Parsing (i.e. better MSQ support)
  • Bug fixes and better error handling

So now it is a bit more usable. The INI Parsing turns out to be a bit more complex than I anticipated, but I rolled out a decent intermediate update in the meantime.

Before completing the INI parsing (or anything else for that matter), I’ve decided to overhaul the entire codebase. This is because I wrote the first version off the cuff, but I’ve been receiving a few feature requests and it’s turned into something that merits proper design considerations. So, I’ll be adding a much needed OO and configuration revamp to it.

Msqur Update

Well, the holidays are long over and I haven’t updated msqur.com in a while. I’m adding some configuration management to it, so nothing visible will happen for a while. What’s planned, however, is .ini file parsing so that .msq files can be parsed according to the INI file version they use. That is, I will parse the INI file for the schema to a .msq file instead of hardcoding it. This way showing a .msq from a new code version is just a .ini file upload away.

INI file parsing shouldn’t take long. PHP has exactly what I need (literally: parse_ini_file()), but I’ll have to bake my own slightly modified version since the MS format isn’t standard–if there even is a standard for INI files.

msqur.com – MSQ file sharing site

Well, I’ve only been working on it a little so far, but I suppose it’s good enough to post about at this point.

The site is msqur.com, and it’s for Megasquirt ECU users to share their tunes (from the TunerStudio MS software). You can upload (multiple) .msq files, assign some engine information to them at upload, and share them with other people for troubleshooting or tuning help. The goal is to make something easier than attaching a file to a forum post that others have to download and fire up the full tuning software suite to just view it.

msqur screenshot

Currently, as of this posting, it just shows you the VE, Spark and AFR tables from MS2 or MS2-Extra only. It might with with other firmwares but I have no expanded it yet. You can also enable or disable the table coloring, and normalize the VE table, converting any VE table to 5-250 VE for ease of comparison. I hope to expand it to view all data available from the MSQ file in a familiar format.

I only get to work a bit each week on it, since I’ve got a few other projects going. But it shouldn’t take too long to get this site to 90%. It’s also a nice break from the C code for the DRD project. So, I’ll post every now and then about any updates to it, so check the msqur tag for the latest info.

Raspberry Pi – Cross-compiling

Now that you have the hardware built and tested (although that’s not necessary), you can either use the code I’ve written–which is specific to the hardware and environment I have, or compile your own version. If you want to compile your own there are two options:

  1. Compile on the Pi itself
  2. Compile on an ARM virtual machine
  3. Cross-compile on a faster machine

The trade off? Compiling on the Pi is slow (very slow). The virtual machine is a marked improvement for compiling speed, but is complicated to setup. Cross-compiling is about the same difficulty as setting up a virtual machine but a bit faster and less “bulky”. So it depends. The virtual machine is nice if you have a lot of libraries you want to use, since you’ll have to compile all of them to be available for linking. If any of them have poor autoconfig support, it might be a pain to fix if you weren’t already on the target machine. But, since I just needed one or two popular libraries, I decided to setup cross-compiling from my host (x86_64) machine.

The last time I setup cross-compiling it was on Gentoo, and it wasn’t pleasant. However, after a little bit of research it looks like the crosstool-ng project is pretty popular and useful. I only had to patch one tiny thing.

Here’s the overall process:

  1. Install crosstool-ng
  2. Configure a cross toolchain with it
  3. Try and build the toolchain
  4. Use the toolchain to build your Pi code

Continue reading