Equalizing HUMP NF01 USB Speakers in Linux

Posted: October 15th, 2010 | Author: | Filed under: Linux, Tools and Gadgets | Tags: , , , | 2 Comments »

I recently purchased a set of Unique Hardware HUMP NF01 USB speakers from Think Geek, where they sell them under the name “Crystal USB Desktop Speakers.” What was wrong with the name HUMP, I couldn’t guess. Dan’s Data posted a good review of these speakers, in case you are unfamiliar with the NF01.

Out of the box, the speakers that come with the NF01 sound muffled to me when listening to music. I don’t currently have access to a calibrated microphone in order to plot their frequency response, but I felt I could improve their sound somewhat with a bit of qualitative equalizing.

I’m running Debian Testing on my Samsung N510. For reference, the versions of my kernel, ALSA, and MPD are as follows:

win@taco:/home/win> uname -a
Linux taco 2.6.35.7 #1 SMP PREEMPT Fri Oct 8 12:43:49 PDT 2010 i686 GNU/Linux
win@taco:/home/win> cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.23.
win@taco:/home/win> mpd --version
mpd (MPD: Music Player Daemon) 0.16~git

On my system, the NF01 USB audio interface unit was detected immediately upon connection, and was configured as the second ALSA device according to a quick test using aplay:

win@taco:/home/win> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: NVidia [HDA NVidia], device 0: ALC269 Analog [ALC269 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: NVidia [HDA NVidia], device 3: NVIDIA HDMI [NVIDIA HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

My usual music player software is MPD. Currently, MPD doesn’t implement any EQ filtering, leaving that task up to whatever audio component sits downstream on the audio chain, be it a special ALSA or PulseAudio plug-in module, etc. My approach was to create a virtual ALSA device utilizing mbeq (a LADSPA equalization plugin) and to configure MPD to use that virtual device.

I added the following stanza to my /etc/asound.conf file:

pcm.hump_eq {
type ladspa
slave.pcm "plughw:1,0";
path "/usr/local/lib/ladspa/";
plugins [{
label mbeq
id 1197
input {
# filter gain values (range: -70 to 30)
# band center frequencies (Hz):
# 50,100,156,220,311,440,622,880,1k25,1k75,2k5,5k0,10k0,20k0
controls [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ] # change these to your liking
}
}]
}

pcm.hump {
type plug
slave.pcm "hump_eq";
}

Note that the mbeq plugin is installed in /usr/local/lib/ladspa/ on my system. Your LADSPA plugin location may be different. Also, remember that the string “plughw:1,0″ represents the second ALSA device in the system. Your card may not appear using the same device number depending on the other hardware installed in your system.

I was able to test the new virtual device with another quick test using aplay to listen to a recording of pink noise. By the way, in order to use the new virtual device, I did not need to restart ALSA or perform any other actions after updating my asound.conf:

win@taco:/home/win> aplay -D hump pinknoise.wav
Playing WAVE 'pinknoise.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono

In order for MPD to use the new virtual device, I added a new section to my /etc/mpd.conf file:

audio_output {
type "alsa"
name "HUMP NF01 USB Speakers"
device "hump"
mixer_device "hw:1"
}

After restarting MPD, I was able to verify the existence of this new audio output using mpc. Note that if the new output is disabled, it can be enabled by using a command like “mpc enable 2″, where, in this example, “2″ is the output corresponding to the NF01:

win@taco:/home/win> mpc outputs
Output 1 (HDA NVidia) is enabled
Output 2 (HUMP NF01 USB Speakers) is enabled
Output 3 (FIFO) is enabled

At this point, with the new MPD output enabled, playing music with MPD should be working and equalized according to the gain values entered in /etc/asound.conf. If the values are adjusted, you will need to restart MPD for those changes to take effect. Enjoy!

Oh, you wanted to know how the system sounds after equalization? Let me get back to you on that. In the mean time, if you have any questions or comments on this article, please let me know!


2 Comments on “Equalizing HUMP NF01 USB Speakers in Linux”

  1. 1 Edward said at 8:13 am on December 26th, 2010:

    These speakers sadly didn’t auto-detect on my system (Lenovo X100e running CrunchBang Statler x64). I won’t be returning them to ThinkGeek as my mom can use them instead, but was curious if there were any possible ideas you had if I were to try making them work in the future? I really do like them, and it’s a shame I couldn’t get them to work on my system =( If I can figure out something in the future I think I’ll likely end up going for them again, as the sound quality is rather impressive given the size of the speakers.

  2. 2 win said at 12:39 pm on December 26th, 2010:

    Hi Edward. You get internet service in your igloo? I’m impressed!

    I’m not running #!, but the stock x86 Debian distribution has a kernel which includes support for USB audio devices. Try looking at your kernel config to see if the following options are enabled:

    CONFIG_SND_USB=y
    CONFIG_SND_USB_AUDIO=m

    If they aren’t, then any ‘class compliant’ USB audio device won’t work with your kernel. #! tends to be a light weight distro, so they may have these options disabled. You could try burning yourself a “live CD” of a mainstream Linux distribution to boot and see if it detects the speakers.

    Assuming the kernel modules are not the issue, check the contents of /proc/asound/cards to see if ALSA detects the hardware. You can also get a list of devices ALSA ‘knows about’ with the command “aplay -l”

    Feel free to e-mail me on this. It’d be a shame not to get those little bad boys running, especially when Linux has pretty solid support for ‘generic’ USB audio devices. Cheers!


Leave a Reply