I’ve written a tutorial introduction to the ELF and GELF API set in FreeBSD -current. Reviews would be much appreciated.

http://people.freebsd.org/~jkoshy/download/libelf/article.html

This a small recipe for converting MIDI files to the more ‘portable’ CD audio format. The recipe is useful when you would like to show off your musical compositions and don’t want to lug your FreeBSD system around. :)


  1. Audio tracks on an audio CD are stored in 16-bit signed PCM format. So the first step is to ‘render’ your MIDI composition into this format. I have found that timidity++ (in the FreeBSD Ports collection) works reasonably well for ‘rendering’ piano pieces:

    % timidity -Or1slS -o foo.pcm foo.mid
    

    Here the –Or option selects ‘raw’ output, and the subsequent modifiers select 16-bit signed (1s) linear (l), stereo (S) PCM. The -o option selects the output file.

    timidity++ offers a very large number of options to control the MIDI rendering process; do be sure to skim its manual page.

  2. Once you have rendered your MIDI files, the next step is to burn the rendered PCM files to CD. This turns out to be simple:

    % sudo burncd -f /dev/acd0 audio foo1.pcm foo2.pcm foo3.pcm fixate
    

    burncd is part of the FreeBSD base system (i.e., a standard tool).

In my experience CD-RW media doesn’t work well in commercial CD players. The CD-R media I had with me seemed to work. YMMV.


References:


Libelf is now in -current

15. November 06

-lelf is now in -current.

Work continues on the libelf test suite in Perforce.


If anyone wants to write BSD-licensed equivalents of GNU binutils (nm, strip, etc.) for FreeBSD, -lelf should help ease the effort.

UltraSparc 10 donation

22. August 06

Thanks to Steve Quirk, Chandra V., and the folks at donations@ I now have an UltraSparc 10 for working on hwpmc support.

In addition to hwpmc work, I intend to use the machine to ensure that the my ports run on the Sparc64. Further, this architecture is a very good one for catching inadvertent assumptions about byte ordering and address alignment in one’s code. So I’m very pleased that I have a Sparc box to work on.

First though, it appears that Bangalore might just be too hot for the machine. The machine is showing symptoms of overheating (cache errors, watchdog timeouts and the like). Perhaps improving the airflow inside the machine will help. On the positive side, it does boot reliably to the OpenFirmware prompt so further exploration of the problem is at least possible. There isn’t much of a Sparc ecosystem in Bangalore left (unlike a decade ago), so repairs will need to be in D-I-Y mode.

Libelf Status Page

10. August 06

Wiki page http://wiki.freebsd.org/LibElf/ImplementationStatus now contains a short summary of the state of the LibElf project.

LibElf

05. June 06

pmcstat(8) today suffers from a number of limitations because of its reliance on gprof(1) for the final presentation step when reporting profiling information:

  • gprof cannot analyse calls that cross executable objects (for example, between a main program and a shared library).

  • gprof isn’t cross platform capable: it cannot analyse non-native binaries.

One of the ways to solve these issues is to make either one of pmcstat or gprof smarter. It turns out that an ELF parsing library that allows both these tools to be written in an architecture independent way is useful. In addition to pmcstat and gprof, there are a small number of tools in the base system that implement ad-hoc ELF parsers for their own use. These too would become more robust by using a standard API.
I didn’t find a BSD-licensed ELF parsing library that implemented the libelf(3) API used by Solaris and other SysV-like systems. So I’ve started an implementation. The wiki page http://wikitest.freebsd.org/LibElf tracks this effort.

I’ve updated the PmcTools wiki page to include more information about the project. The wiki site now lists known bugs, the current plan of work and future directions for hwpmc(4) and related tools.

Please do take a look.

A test post, on flz@’s new blog site for FreeBSD developers.

Log-In | Wordpress | Cappuccino