Author Archives: stump

An alsamixer surprise

TIL not only that alsamixer supports hotplugging, but also that it quotes poetry if the device it’s currently pointing to goes away.

Nice surprises like this make me feel better after all the sound-system wrestling I detailed earlier.

(Also, mumble has been added to the audio-application mix. Thankfully it’s willing to do its output via PulseAudio while it does its input via direct ALSA, so I can use a USB mic with it, which is the only type I currently possess. Three guesses how I discovered the previous statement about alsamixer.)

X-forwarding is fun!

Protip: don’t download things in Firefox that has been X-forwarded through a slow SSH connection. Because when the downloads are finished and the little “Downloads complete” thing tries to slide into view, it takes a couple seconds for each pixel of movement in each direction, and the forwarded Firefox window itself becomes just about unusable during this time. (Yes, I had SSH compression turned on.)

Why I was even resorting to this is a story for another day.

The joy of sound systems… oh, wait…

GNU/Linux desktop sound systems, that is.

Experimenting with DJing and music production using only Free Software has resulted in some modifications to how audio is handled on my laptop. This post is to talk a little bit about some of the tradeoffs involved, and some of the problems that came up, including those I still haven’t dealt with.

I had been running a subset of GNOME 3, with awesome for my window manager, with default-configuration PulseAudio (and libasound2-plugins, to expose this to ALSA-only programs) for sound, on Debian testing. This setup has served me well for many years. In April I began using Mixxx to engage in some DJing, as opposed to just playing songs as-is (usually using sox), for my show on WJHU; because PulseAudio adds too much latency for this, I merely disabled autospawn and remembered to do a “pulseaudio -k” before starting Mixxx, and a “pulseaudio –start” after I was finished, and used my device directly via ALSA from Mixxx, which worked very well. Until the production part entered the picture, this is the only PulseAudio configuration change I ever needed to make.

Starting to play with production led me, naturally, to Ardour 3. This required me to set up JACK. It’s getting that working with everything else where the problems begin to arise. (Notably, though, very few of these problems are actually JACK’s fault, as you’ll soon see.)

JACK can mix multiple application streams into one output, just like PulseAudio. libasound2-plugins has a plugin for exposing JACK to ALSA-only programs. This suggests that PulseAudio should go, especially since I never use PulseAudio’s application-specific volume control and don’t rely on transferring active streams on hotplug, which are really the only major features I’d lose by doing that.

But there’s plenty of stuff I use day-to-day that specifically wants PulseAudio. Solution: reconfigure PulseAudio to run on top of JACK. (This also preserves my ability to turn PulseAudio’s volume above 100%, which I semi-regularly find myself doing when confronted with watching a video whose audio track is far quieter than it should be.)

Problem: The volume control keys only affect PulseAudio. (Remember, this is a laptop, so there is no physical volume control slider or knob.) For anything directly using JACK, I have to instead open up alsamixer, point it at the real audio device (since it comes up pointed at PulseAudio), and adjust the volume that way, then either do it again or adjust PulseAudio to compensate when I’m finished with the direct-JACK program. The volume control keys are currently handled by gnome-settings-daemon, which nowadays only supports changing PulseAudio’s volume. I’ll have to have something else handle those keys if I want to change the volume of the actual audio device directly (which would be much better).

There’s also MIDI to deal with. I had to get MIDI through JACK for Ardour, which I initially did with a2jmidid (because old documentation came up first when I searched for a solution), but now do with “-X seq” at the end of my .jackdrc (invoking JACK’s built-in implementation), as I didn’t like having to remember to start yet another daemon. Since every MIDI application I care about running uses PortMIDI, I don’t have to worry about JACK’s exclusive use of the underlying devices, as everything can access it through JACK. I also blacklisted the snd_seq_dummy kernel module so as not to get a virtual MIDI Thru port, which has often annoyed me and which JACK makes completely redundant. It’s nice to see that this setup supports hotplugging of MIDI devices, meaning I don’t have to dig around in qjackctl after plugging or unplugging an instrument or (for DJing) my newly-acquired Numark Mixtrack, or starting or killing TiMidity.

Speaking of TiMidity, I can’t just leave it running under this setup, as much as I would like to, since JACK will hold the virtual MIDI ports TiMidity creates perpetually open, causing it to spend a non-trivial amount of CPU time synthesizing silence. So I just start it by hand when I need it, and kill it afterward. I don’t often need MIDI software synthesis, so I just accept this. (I kind of wish it supported creating its ports within JACK rather than within ALSA. Maybe I should see what it would take to do that.)

Finally, there’s the issue of cuing in Mixxx under this setup, which I haven’t had to deal with yet because JACK only entered the picture after summer break started (and therefore WJHU-season ended). Before I set up JACK so I could start playing with Ardour, I acquired a cheap USB audio device so I had an independent audio output I could use for song cuing while DJing with Mixxx. Because I already had two independent audio outputs, I purchased a Mixtrack rather than springing for a Mixtrack Pro, which contains independent audio outputs of its own but is otherwise exactly the same as the Mixtrack. But JACK seems to strongly discourage (with very good reasons) use over multiple audio interfaces, and even if you try, doesn’t handle hotplugging particularly gracefully. (Sure, there’s alsa_out, but that would add latency, and it’s essential that the mix output and the cuing output have exactly the same amount of latency.) I want JACK involved in the main output to open up the possibility of doing call-ins with a VoIP program with the caller able to hear what’s going on. The logical thing is to just use the USB device directly (sans JACK) for the cuing, but Mixxx currently requires all audio I/O to be done through the same API, so I can’t direct the mix to JACK and the cuing output to the USB device via ALSA.

I’ve really come to like JACK, and hopefully I can find good solutions to these problems that don’t make my system less convenient to use for ordinary things involving sound. Suggestions are welcomed.

DJing and CC-licensed music

So some offline friends have gotten me thinking about getting into DJing.

First a little backstory: last fall I joined WJHU, the student radio station at Johns Hopkins, as a sysadmin. A few weeks later I decided I really ought to actually use some of the equipment I was administering and started doing a show (Fridays from 23:00-01:00 US Eastern, for you curious folk). It was originally a mixed-genre whatever-I-feel-like-fest, but over time I settled into heavy usage of electronic dance music, to the point that my most recent few shows have been either all EDM or have had only one or two non-EDM songs. On a whim, I decided to try stringing together (using Audacity) some of last show’s songs with beatmatched transitions and played the result for a DJ friend from the station, who liked it. (And I’d share it, but some of the tracks in it have incompatible licenses, and I was just playing around with beatmatching and wasn’t thinking “Hey, I might want to share this later!” at that time.)

Anyway, being the free culture type of person that I am, and being a person who loves all kinds of EDM, the choice of what to aim for is clear: Creative Commons-licensed EDM mixes. For my last show (my current DJing is in the just-playing-songs-on-a-stream sense of the term), I used only CC-licensed EDM (and there’s quite a bit of really good CC EDM out there!), and a fun time was had by all.

Using CC-licensed songs, of course, brings up the question of which license I should use for any mixes I wish to publicly archive and share.

(Disclaimer since we’re about to go down a legal rabbit hole: I’m not a lawyer, and no part of this post is to be treated as legal advice. There are almost certainly flaws in my understanding of the licenses and of the laws relevant to them.)

I believe in free culture and in copyleft as a mechanism to promote it. For as long as I’ve had this particular incarnation of web presence, everything of mine on it except software source code has been BY-SA. I’d like to be able to release mixes under that or a similar license too, and I also want to ensure I fully comply with the licenses of the underlying songs. It’s all CC, so this shouldn’t be too hard, right?

But thinking about how the different CC licenses would interact with this, given the trends I noticed in how CC EDM tends to be licensed, made my brain start to melt and then made me really sad. I’ll go through condition by condition:

First we have BY (Attribution), which is a condition all of the CC licenses have. This one is not a problem at all. It’s customary to release a cuesheet (list of songs and the time each one starts and ends) alongside a DJ mix, and the attribution can be there. It’s the other three where issues arise.

It’s depressing how often ND (NoDerivs) showed up. This is not a problem for a just-playing-songs show, as the songs are used in their entirety, without any effects or other modification, distinctly separated from other songs. But these aren’t true of DJ mixes. So ND songs are right out. And I’ll bet that many of those artists didn’t completely think through the fact that ND would foreclose this kind of use.

I will consider NC (NonCommercial) and SA (ShareAlike) together, as their effects on what options I have and what decisions I have to make go hand-in-hand. NC, as you might expect for music, shows up far more often than not. And as I have said, I generally like copyleft, and many other people do too. But both BY-SA and BY-NC-SA exist, which are not compatible. As mixes are derivative enough that I don’t feel that I can use ND material, I’m inclined to believe that the SA condition would extend to the whole mix, which means I get the choice of including BY-SA material and excluding anything NC, or including BY-NC-SA material and excluding anything BY-SA. With the strong prevalence of NC over non-NC in music I want to be able to use, and the frequency with which SA shows up (usually in the form of BY-NC-SA), I feel like I have no choice but to adopt NC (which I’d rather not do, as it’s not truly free culture) in order to be able to use BY-NC and BY-NC-SA material. This means that BY-SA material, where the artist is really trying to do the right thing and has merely decided to be a little more forceful about it, gets the shaft. And that makes me really unhappy, as BY-SA is my favored CC license.

But BY-NC-SA it will (with great reluctance) have to be, then. There’s simply too much NC material out there not to. (Of course, separate BY-SA mixes are still a possibility, but I’d have a lot less to work with there.)

If I end up making and releasing any original EDM tracks, I think I might go with a BY-SA/BY-NC-SA dual license. Odd as that may sound, I want to do the right thing as much as possible but not cause problems for other DJs who feel that the NC condition has similarly been forced upon them.

On a non-license-related note, I’ve started playing around with Mixxx, a free software DJ console (you didn’t really think I was going to try to do this with anything other than an entirely free software setup, right?), but as I currently lack a secondary audio device on my laptop (a cheap USB audio device is currently on its way, hopefully to arrive by the end of the week so I can use it during my next show), I haven’t been able to meaningfully try real-time beatmatching yet, and how I do with that will probably determine whether I pursue this further. I’m really looking forward to it!

(Also, it’s totally been far too long since I wrote anything here. Hopefully I’ll remember to write stuff here more often in the future.)

I now use gpg.

I’m starting to use gpg.

This isn’t the first time that I have said to myself, “Hey, I should start using gpg!” I have had that idea twice before. And each of those times I made myself a key then just forgot about actually trying to use it and collect signatures on it. I never published those keys, and as time went by I forgot their passphrases.

I’m off to a much better start this time, as I cross-signed with my friend Asheesh today, published my key, and configured gpg integration in my MUA. So my new key will actually be seeing some use.

For those of you interested, my key ID is 9C121F46, and the fingerprint is C25D 9D2F F3F1 3D72 ADEB D54C F1DB 6C38 9C12 1F46. I uploaded my key to keys.gnupg.net and pgp.acm.jhu.edu. I will put this information on my contact page too.