After my survey of the possibilities for USB surround sound in Linux, I ended up ordering a Creative X-fi Surround USB. As you could read there, there is a helpful webpage that includes e.g. ready made .asoundrc files.
Windows XP
On my netbook, without installing any special drivers, playing a song on an otherwise unoccupied Windows XP utilizes about 20% CPU, minus the almost 5 % that somehow seem to be there almost always...
I've read reports that there are clicking sounds, which I can imagine well with a heavy system load. I've heard them at first after plugging it in, but by now they disappeared. It sounds crisp on my Sennheiser headphones and the base is noticeably better than my onboard sound, obviously, but that doesn't say much.
Now let's see how it fares in Linux...
Reboot. Plug. Play. It could hardly be easier. All I had to do was to tell mplayer which device to use (mplayer -ao alsa:device=hw=S51). Then it happily started playing over my new external sound card. The sound is as excellent as under Windows. But better than Windows: Surround sound works out of the box in my Kubuntu 9.10 system.
The combination of AC-3 surround with VAAPI accelerated 720p movie on my netbook utilizes around 10-12 % CPU. There is no stuttering in Linux, even with heavier load. Just playing music hardly seems to have any impact -- maybe around 5 % CPU. I'll have to let the Phoronix suite benchmark all this sometime. In Windows even just playing music in VLC and increasing the volume setting with the knob on the device can create stutters.
Right now for some reason the slightly dusty Chromium version on this netbook keeps bringing the system into a hard stutter making characters appear slowly on the screen up to a second after I type and the mouse does not move smoothly. But the sound plays smoothly in the background. Just plain wonderful.
Resume
I can definitely recommend the sound card for USB (surround or stereo) sound in Linux. I'm not sure if I would use it for Windows. Let's see after I installed the drivers, which will probably drive me mad.
But be aware that there are clicking sounds when the card is first intialized. If you want to use it for e.g. system sounds, you may not be very happy with that. They also seem to appear during heavy disk access (apt-get dist-upgrade), even if I'm not playing any music. That's definitely weird...
The microphone input works flawlessly. I didn't have problems with over-amplification, though I can imagine that being an issue with the lack of hardware mixing. And I definitely have a sound card for surround sound HD movie nights now. And the crazy thing is I can do it all perfectly with my little netbook. Thank you, Linux. Thanks also to you, Mandar.
Post Scriptum
Some additional information for nerds: When the card is not in use, it produces not wakes in powertop, when in use, it produces about 200-300 wakes/s (no matter if surround or stereo sound).
Update
The clicking sound seems to be related to the power supply. The problem disappears in the same work load (e.g. heavy disk updatedb) if I plug the power adapter into my netbook.
Update2
As I almost expected the device is not anywhere as good in Windows as in Linux. The crystalizer does sound nice, but there are many glitches in the Windows driver. E.g.
- sometimes when you pause they playback, the result is a constant beep until you press play again,
- during forwarding in movies, there are short beeps.
- Once after removing the plug and putting it back inside, the entire system hung, only working again after removing it again and then showing and error message.
- the driver uses much more CPU than in Linux and it's a 50 MB package
- there are no volume controls for rear, center, lfe and front channels, only 1 master control (in Linux you can fix this -- maybe MatrixMixer works for Windows?)
- the microphone input sounds slightly noise shaped, esp. in combination with the "crystalizer"
Update3 (9/2011)
Unfortunately I only just tried recording in Linux for the first time. And it seems it doesn't work at all. I got only noise. I've tried Line in and Mic in. There's no real setting for the record options anyway. (Which channel, etc.) So that's definitely a downside. I had never tried that in Linux before. btw. Check here to get the remote control and volume know working. It should come out of the box with kernel 2.6.37+.
And here's my .asoundrc so far:
pcm.!default {
type plug
slave.pcm "softvol" #make use of softvol
}
# create softvol master channel
# see http://alsa.opensrc.org/index.php/How_to_use_softvol_to_control_the_master_volume
pcm.softvol {
type softvol
slave {
pcm "dmixer2" #redirect the output to dmix (instead of "hw:0,0")
}
control {
name "Master" #override the PCM slider to set the softvol volume level globally
card S51
}
}
# create stereo dmixer, because using the 6 channel one causes stutter if the channels are empty
pcm.dmixer2 {
type dmix
ipc_key 2343
slave {
pcm "hw:S51"
channels 2
}
}
pcm.dmixer6 {
type dmix
ipc_key 2342
slave {
pcm "hw:S51"
rate 48000
channels 6
period_time 0
period_size 1024
buffer_time 0
buffer_size 4096
}
}
# reroute the channels because rear and sub/lfe are exchanged
pcm.mysurround {
type route
slave.pcm "dmixer6"
slave.channels 6
ttable.0.0 1
ttable.1.1 1
ttable.2.4 1
ttable.3.5 1
ttable.4.2 1
ttable.5.3 1
}
Hi, maybe you can provide me with some additional information about the x-fi surround, as i'm looking for an usb audio interface to connect to an external DAC.
ReplyDeleteAre you using the analog or the optical output?
Have you tried playback of 24bit/96khz stereo files?
Thanks for your help.
I'm happy to help: If you provide me with corresponding samples I will see if I can play them. I'll try to make sure to send them directly to the hardware without automatic alsa plugin conversion.
ReplyDeleteI'm not sure if the optical output works... :/
the analog works in surround as reported.
If you use 'aplay -v -D $device $audiofile' you can check wether or not alsa is doing any kind of conversion, but you have to convert the audiofile to wave first, because aplay can only play uncompressed audio.
ReplyDeleteTo get a sample, you can either just take any audiofile and use 'sox -V3 $infile -b 24 -r 96k $outfile.wav' to convert it or download some free flac files here:
http://www.2l.no/hires/index.html
I think this will answer your question ;)
ReplyDelete$ LANG= aplay -v -D hw:S51 outfile.wav
Playing WAVE 'outfile.wav' : Signed 24 bit Little Endian in 3bytes, Rate 96000 Hz, Stereo
Hardware PCM card 1 'SB X-Fi Surround 5.1' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S24_3LE
subformat : STD
channels : 2
rate : 96000
exact rate : 96000 (96000/1)
msbits : 24
buffer_size : 48000
period_size : 12000
period_time : 125000
tstamp_mode : NONE
period_step : 1
avail_min : 12000
period_event : 0
start_threshold : 48000
stop_threshold : 48000
silence_threshold: 0
silence_size : 0
boundary : 1572864000
appl_ptr : 0
hw_ptr : 0
Sounds just fine. I notice no skips or anything.
Great, thanks for your help.
ReplyDeletehow were you able to use the snd-usb-xfi module? for the life of me i cannot seem to figure this out. thanks for the guide!
ReplyDeleteThere is a snd-usb-xfi module? I haven't heard of that yet. I just use snd-usb-audio. Works as expected, even in 5.1. ;)
ReplyDelete