A rattling good idea!

The idea

I have had an idea that has been rattling around in my head for a while now, so I have decided to get it written down for all to see and use.

Some time ago, I was trying to solve the problem of making two recordings on the same digital TV service that overlap. My idea was to create a file system that created a logical file for each recording but shared the same underlying storage files. An example of this idea is shown in Drawing 1.

Drawing 1

In the above example, the user wants to record two programmes on BBC1, The One Show that is immediately followed by EastEnders but you also want to start both recordings 5 minutes early and end both recordings 5 minutes after each programme finishes. Each logical file has details about the recording, e.g. programme title, duration, and also has links to one or more storage files.  Each storage file can be thought of in a similar way to a file system block containing the data for the media type being used, e.g. transport stream data, MP3.

Referring back to Drawing 1, recording 1 (The One Show) uses storage files 1 to 17, recording 2 (EastEnders) uses storage files 15 to 31 so storage files 15 to 17 are used twice.  The file system maintains a count of the logical files that are using each storage file, and when the number of logical files using it is 0, then it is available for use by another logical file. The size of each storage file would be adjustable but I was planning on using a size that would hold about two minutes of a single program transport stream at standard definition.

Once I had this basic idea, I also realised that by having fixed sized storage files, I could format an entire disk partition using block sizes the same size as the fixed sized storage files. This approach would prevent any wasted space on the partition although the files may not be contiguous.

Obviously, there were many technical challenges to overcome before this idea would work, so I started looking at possible solutions including seeing if anyone had done this before so I could use their work.

Has some one done this before?

After a couple of Google searches, I ended up at the Filesystem In Userspace (FUSE) project web site.  This looked very promising so I looked for similar file systems in the media file system wiki pages. The following FUSE file systems looked useful:

However, I could not find a file system that would do exactly what I wanted so I needed to think about how I would implement the new file system.

How to implement and test it?

Having decided that I would have to develop this new file system myself, I needed a name to avoid calling the project it or thingy. Having decided that FUSE was the way to go, I settled on AVFUSE (Audio Video FUSE) as no-one else seemed to have used the name before.

I also needed some way to test the final product.  More research led me to the following results:

Of the these three, the posix-test-suite seems to be some sort of industry standard, so I plan to use that one when testing AVFUSE.

Next time, I hope to have done sufficient implementation to make it worth writing up, but life has this nasty habit of distracting me from intellectual pursuits like this.

Leave a comment