alspvill
Posts: 13
Joined: Tue Aug 28, 2012 11:35 pm

Creative X-Fi 5.1 USB sound card

Fri Aug 31, 2012 5:17 am

I am trying to get a X-Fi USB card (from Creative) to work on the raspi, so I'll document my efforts here.

I am using a monitor that has USB ports as a powered USB hub. I have not checked if the card will even power on when connected directly to the raspi.

Since the first boot the card came up in lsusb, which is obviously a good thing!

And since I didn't know where to look to configure audio I/O devices i did some searching around and decided to instal pulseaudio (not sure if it was such a good move, but anyway...) I mostly followed what I could find here http://ubuntuforums.org/archive/index.p ... 93063.html and here http://www.samlesher.com/ubuntu/install ... u-810-xfce.

Except that I installed libao4 instead of the suggested libao2 or libao-pulse.

apt-get complained about not being able to find padevchooser and pulseaudio-module-hal (which is to be expected i suppose) so did not install those.

When I went into the PulseAudio manager, as it was loading, i got some pops out of the speakers connected to the usb soundcard, so something most be working.... However once in the preferences the X-Fi card shows up as an audio input device only, and it does not appear as a possible output device.

This is as far as i have gotten and still not managed to get it working, I think it might have something to do with the package padevchooser as the name strongly suggests. I'll keep trying to get it to work and post my progress here. Ideas are VERY welcome.

alspvill
Posts: 13
Joined: Tue Aug 28, 2012 11:35 pm

Re: Creative X-Fi 5.1 USB sound card

Sat Sep 01, 2012 6:42 pm

I think this topic should actually go in the raspbian part of the forum.
mod help needed :) (sorry)

alspvill
Posts: 13
Joined: Tue Aug 28, 2012 11:35 pm

Re: Creative X-Fi 5.1 USB sound card

Sat Sep 01, 2012 7:20 pm

UPDATE: Some progress made
(I should have mentioned earlier that I'm running Raspbian)

I installed and ran rpi-update (which i hadn't previously) and now when i go into the PulseAudio volume control it lets me choose input + output profiles for the USB sound card.

However running the volume control now takes up all the processing power and my raspi starts running extremely slow. It lets me choose a variety of profiles which include 5.1 output woohoo!

However when I try to play music through the card I still get no sound...
I've tried to mess with the cli tool pacmd to change the default output to the USB card but have not yet managed to get it working.

I will keep trying to get it working and post my progress.
Has anybody got other USB sound cards working?

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Creative X-Fi 5.1 USB sound card

Sat Sep 01, 2012 8:17 pm

"Has anybody got other USB sound cards working?" - yes using qmmp.

Image

CM108 based audio, FM transmitter dongle and a Sound Blaster Live 24bit External.

Richard S.

alspvill
Posts: 13
Joined: Tue Aug 28, 2012 11:35 pm

Re: Creative X-Fi 5.1 USB sound card

Sat Sep 01, 2012 8:32 pm

Thanks! I'll check qmmp out.

Meanwhile I've had some success...

I tried playing audio using aplay like av2kk did in this post http://www.raspberrypi.org/phpBB3/viewt ... 94#p160394
Using:

Code: Select all

aplay -D plughw:1,0 soundfile.mp3

I get some horrible audio (through the usb output!!), apparently because aplay does not support mp3

I will keep trying to get it working and post my progress.
anybody know other programs to play audio from the command line that you can specify the device to play to in a way similar to aplay (as the PCM alsa device) (as i've said, ill check qmmp, but it would be nice to know which other ones are useful)? I tried using omxplayer but apparently you can only specify hdmi or local

alspvill
Posts: 13
Joined: Tue Aug 28, 2012 11:35 pm

Re: Creative X-Fi 5.1 USB sound card

Sat Sep 01, 2012 8:56 pm

qmmp worked!!! (sort of) :(

The preference menu of qmmp lets me choose audio devices and such. And it did let me choose my USB soundcard and it did play, and sound indeed came out of the speakers connected to it.

However the audio is choppy and plays for a second and stops for a second.
If I run qmmp from the terminal it keeps giving these messages:

buffer underrun!

So probably a buffer problem, but i keep fiddling with the the buffer settings and nothing changes.

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Creative X-Fi 5.1 USB sound card

Sat Sep 01, 2012 8:59 pm

Sorry I forgot to mention you need to turn off the graphic equaliser (it's on by default) the CPU gets hammered otherwise.
If you change the default buffering settings the on-board sound can go a bit funny to fix this make sure ALSA "Advanced Settings" are as follows: Buffer time(ms): 250, Period time (ms): 50.

Richard S.

alspvill
Posts: 13
Joined: Tue Aug 28, 2012 11:35 pm

Re: Creative X-Fi 5.1 USB sound card

Sun Sep 02, 2012 2:56 pm

Turning off the equalizer works! however the audio sounds as if sped up (although its smooth now) and apparently changing the buffer settings doesn't appear to make a difference.

Maybe its PulseAudio interfering I dont think I needed to install that at all now...
Anyway, the audio is not top quality, even when playing .flac files. I thnk the best audio option on the pi is using hdmi out... :(

User avatar
redhawk
Posts: 3465
Joined: Sun Mar 04, 2012 2:13 pm
Location: ::1

Re: Creative X-Fi 5.1 USB sound card

Mon Sep 03, 2012 11:40 am

It's the ALSA drivers I had the same problem with my FM transmitter dongle I set my audio to "sysdefault:CARD=Audio" which did the trick. http://www.raspberrypi.org/phpBB3/viewt ... 21#p144068
ALSA thinks your audio device isn't 44.1kHz capable so it plays everything at 48kHz instead without re-sampling.

Richard S.

frigaut
Posts: 3
Joined: Fri Sep 07, 2012 5:23 am

Re: Creative X-Fi 5.1 USB sound card

Fri Sep 07, 2012 5:46 am

FYI:
After many frustrating hours, I finally got the sound blaster 5.1 surround external sound card to work with:
- alsa (no need of pulseaudio)
- blacklisting snd-bcm2835
- so called usb fix, using dwc_otg.speed=1 (boot parameter /boot/cmdline.txt). That's what got rid of the constant crackling/popping. I also use dwc_otg.fiq_fix_enable=1 to reduce the number of interupts but don't think it makes any difference as far as sound quality.
- the following asound.conf to provide "Master" volume control for the card:

Code: Select all

[[email protected] ~]$ cat /etc/asound.conf
pcm.!default {
    type            plug
    slave.pcm       "softvol"   #make use of softvol
}

pcm.softvol {
    type            softvol
    slave {
        pcm        "dmix"      #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        0
    }
}
I'm using mpd on the pi. Working great now. The sound is incomparably better than with the internal ARN-emulated card (snd-bcm2835).

mbz
Posts: 3
Joined: Fri Sep 07, 2012 9:02 am

Re: Creative X-Fi 5.1 USB sound card

Fri Sep 07, 2012 9:08 am

@frigaut
What's your 5.1 card? This one? http://www.ixbt.com/multimedia/creative ... rightb.jpg
Does your card working directly in usb port or usb-hub is needed?
Does your card work both with internal sndcard (without blacklisting?)

alspvill
Posts: 13
Joined: Tue Aug 28, 2012 11:35 pm

Re: Creative X-Fi 5.1 USB sound card

Fri Sep 07, 2012 1:34 pm

frigaut wrote: I'm using mpd on the pi. Working great now. The sound is incomparably better than with the internal ARN-emulated card (snd-bcm2835).
Great!! I'll give it a go over the weekend if I have enough time!

Its nice to know its possible to get it working after all. I'm glad to hear the sound does get better.

frigaut
Posts: 3
Joined: Fri Sep 07, 2012 5:23 am

Re: Creative X-Fi 5.1 USB sound card

Sat Sep 08, 2012 7:44 am

mbz wrote:@frigaut
What's your 5.1 card? This one? http://www.ixbt.com/multimedia/creative ... rightb.jpg
Yes, this one.
Does your card working directly in usb port or usb-hub is needed?
usb hub is needed. It's actually a bit more complicated:
* the pi can't provide the power that the card needs, so direct plugin doesn't work
* plugging it in the usb hub only (astrotek usb3, back compatible with 1 and 2) resulted for me in some kind of usb mounting error (in dmesg).
* using a Y USB cable and plugging the device directly on the pi usb input and the usb power on the powered usb hub worked.
Does your card work both with internal sndcard (without blacklisting?)
I'm not sure I understand the question. I can get sound from the pi with the snd_bcm3825 module, but the sound is not good. Not bad, but with significant background noise and some very noticeable distortions. I couldn't get any output from the external creative usb sound card without blacklisting snd_bcm3825, but this might be incidental. The kernel module used for the card is snd_usb_audio.

btw, I'm using mpd. the relevant config is

Code: Select all

audio_output {
	type		"alsa"
	name		"My ALSA Device"
	mixer_type      "software"
	mixer_control	"Master"
}
and I mistakenly posted the wrong asound.conf yesterday. The correct one is:

Code: Select all

[[email protected] .mpd]$ cat /etc/asound.conf
pcm.!default {
    type plug
    slave.pcm "softvol"
}
pcm.dmixer {
       type dmix
       ipc_key 1024
       slave {
           pcm "hw:0"
           period_time 0
           period_size 4096
           buffer_size 131072
           rate 44100
       }
       bindings {
           0 0
           1 1
       }
}
pcm.dsnooper {
       type dsnoop
       ipc_key 1024
       slave {
           pcm "hw:0"
           channels 2
           period_time 0
           period_size 4096
           buffer_size 131072
           rate 1
       }
       bindings {
           0 0
           1 1
       }
}
pcm.softvol {
       type softvol
       slave { pcm "dmixer" }
       control {
           name "Master"
           card 0
       }
}
ctl.!default {
    type hw
    card 0
}
ctl.softvol {
    type hw
    card 0
}
ctl.dmixer {
    type hw
    card 0
}

jamieburchell
Posts: 23
Joined: Sat Dec 01, 2012 2:37 am

Re: Creative X-Fi 5.1 USB sound card

Sun Dec 02, 2012 3:55 pm

Hi

Would you be able to point me in the right direction on how to get the creative X-Fi USB working in Raspbian? Do you need to get/make drivers, or?

My goal is to make the Pi play music, through the nicest player/interface available. I've had no luck with the XBMC distros and this card.

Thanks

Jamie

jamieburchell
Posts: 23
Joined: Sat Dec 01, 2012 2:37 am

Re: Creative X-Fi 5.1 USB sound card

Sun Dec 02, 2012 8:40 pm

@frigaut

I installed the latest Raspbian, image, updated all packages, made your cmdline.txt and asound.conf changes, blacklisted the default Pi sound module (it still showed in lsmod after a reboot?), manually removed the module, installed Qmmp, selected the Creative X-Fi card and playback is on/off with terrible crackling/interference. I've also tried combinations of the above too. Something is clearly missing.

amofok17
Posts: 11
Joined: Sun Dec 30, 2012 5:47 pm

Re: Creative X-Fi 5.1 USB sound card

Sun Dec 30, 2012 6:13 pm

Good evening.

I seem to have had some luck with this...
An overview as everyone will be different so you know where I'm coming from.
Setup
Hardware;
256mb Raspberry pi
D-link usb hub (c/with)
3 x Rs-232 to usb convertors
1 x creative X-fi 5.1 USB sound card
Software;
The raspberry pi version of archlinux
shairport so I can play music from iPod etc. to the speakers atatched to the above setup.
3x datalogging scripts to get data via the rs-232 convertors

So plugged in the creative and followed the following steps from above...

- alsa (allready had this from the shairport setup)
- did NOT blacklist the snd-bcm2835 (but mine doesn't get loaded anyway)
- added 'dwc_otg.speed=1' and dwc_otg.fiq_fix_enable=1 to /boot/cmdline.txt

At this stage I had no 'fuzzels' or 'crackling' but the songs played to fast, then stopped for a couple of seconds ever 10 seconds or so (presumably as it was playing to fast it ran out of song and had to wait for it to catch up again)

I tried all manor of /etc/asound.conf etc... but made no difference then I came across this...

http://archlinuxarm.org/forum/viewtopic.php?f=18&t=3686

Played around a bit but in the end what has worked for me is;

modified /etc/libao.conf as such:

Code: Select all

default_driver=alsa
dev=default
use_mmap=no
and just deleted all my /etc/asound.conf file completely.

Is still not perfect every 10-15mins It makes a sound like a squashed frog, or that someone has trodden on the cable, but much better than before, and at the correct speed (I think!)

No idea what all the above stuff does or how it's all connected, but it'll do me for now..

audioplastic
Posts: 12
Joined: Tue Jan 15, 2013 12:51 am
Location: Cambridge

Re: Creative X-Fi 5.1 USB sound card

Tue Jan 15, 2013 3:04 am

I have managed to get an X-Fi HD working very well under Debian Wheezy. I have listened to hours of streamed audio without any noises or dropouts. To help others, I have uploaded full instructions in an article on my blog ...

http://audioplastic.github.com/blog/2013/01/10/AP1/

Hope it helps.

ldanicel
Posts: 1
Joined: Tue Jan 15, 2013 6:12 pm

Re: Creative X-Fi 5.1 USB sound card

Tue Jan 15, 2013 6:19 pm

Not want to be mean now ... but your tutorial doesn't bring anything new.

The problem here as I see it is that we all have to set our RPIs USB chipset into 1.1 mode so that we're blocked with 12mbps networking and/or 12mbps access to any kind of USB storage device.

This is a *HUGE* problem but everyone else seems to not realise the effect of using:
dwc_otg.speed=1

Will we ever get a real fix?
My dream setup : stick the USB soundcard and external powered hard-drive in it and get everything fullspeed as advertised ( USB2 transfer rates and static-less music )
What I'm saying is that I will need 2 RPIs to fulfill my job or to sell one and buy some other SoC.

What's it gonna be ?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24679
Joined: Sat Jul 30, 2011 7:41 pm

Re: Creative X-Fi 5.1 USB sound card

Tue Jan 15, 2013 6:48 pm

ldanicel wrote:Not want to be mean now ... but your tutorial doesn't bring anything new.

The problem here as I see it is that we all have to set our RPIs USB chipset into 1.1 mode so that we're blocked with 12mbps networking and/or 12mbps access to any kind of USB storage device.

This is a *HUGE* problem but everyone else seems to not realise the effect of using:
dwc_otg.speed=1

Will we ever get a real fix?
My dream setup : stick the USB soundcard and external powered hard-drive in it and get everything fullspeed as advertised ( USB2 transfer rates and static-less music )
What I'm saying is that I will need 2 RPIs to fulfill my job or to sell one and buy some other SoC.

What's it gonna be ?
We appreciate politeness here, please use it when posting. The first line of your post reminds of the timeworn phrase, "I'm not a racist, but..."

The USB is being worked on. See the USB redux thread. And as for working as advertised - at which point in the advert for this educational machine was there a promise to support every USB device at every speed?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I own the world’s worst thesaurus. Not only is it awful, it’s awful."

gregsmith_to
Posts: 15
Joined: Mon May 14, 2012 1:56 am

Re: Creative X-Fi 5.1 USB sound card

Wed Jan 16, 2013 3:41 pm

All very helpful, thank you all.

frigaut :
so called usb fix, using dwc_otg.speed=1
Anyone, if you have a USB keyboard and/or mouse which work with dwc_otg.speed=1, please let me know what they are; I have not been able to find any. I have an open question on raspberrypi.stackexchange.com for this.. http://raspberrypi.stackexchange.com/qu ... de-to-work

Return to “Graphics, sound and multimedia”