Page 1 of 2

USB Soundcard Nightmares...

Posted: Sun Nov 01, 2009 6:32 am
by Ithilin
Ok recently I've been trying to get OSS4 working on ArchLinux, but I've been so far very unsuccessful. Let's start out where I'm at. Currently I have two sound cards on my laptop, a Sigmatel Hda Intel card, plus an external USB X-FI 5.1. The reason I've got the external one is that my on board card has died as of two years now. One of the problems I'm having right now is setting up the default card which I'm not really getting on how to do it yet, plus it's not that huge of a priority since I've got to get my sound working first.

And that leads me to my ultimate problem of not getting this sound card working with OSS4. I've tried playing music through the USB sound card with XMMS, by selecting the USB sound and have had no luck with that. << I have to do that since the on board is set as deault at the moment. In the OSS plugin in XMMS whenever I'm selecting the USB card it says this underneath it, so hopefully this will help me solve this problem ... "Opened OUT by xmms/17534 @ 44100/48000 Hz Fragment: Not Started." I've also got this error message from Dmesg that may also shed some light on my current problem "oss_usb: Endpoint control write error -32 Failed to set 48000 Hz sampling rate."

By the way my USB sound card does work with ALSA, but I get horrendous crackling noises whenever I run programs that have flash or if I decide to listen to music and multitask and that is a HUGE deal breaker for me. :)

Re: USB Soundcard Nightmares...

Posted: Sun Nov 01, 2009 9:36 am
by Temüjin
If your onboard audio is dead, disable it in the BIOS. Then run soundoff; ossdetect; soundon
The OSS usb driver is still in beta, so I don't know if it would work anyway. Good luck.

Re: USB Soundcard Nightmares...

Posted: Sun Nov 01, 2009 9:42 am
by Ithilin
Temüjin wrote:If your onboard audio is dead, disable it in the BIOS. Then run soundoff; ossdetect; soundon
The OSS usb driver is still in beta, so I don't know if it would work anyway. Good luck.


Looks like I checked my post again at the perfect time, ha. Anyways I cannot disable my audio in my bios unfortunately so I'm going to need something that hopefully the devs can help me out with. I also went in and changed the alt - settings? <-- erm.. whatever the setting is.. And was able to change my output rate, which I confirmed in XMMS, but it wouldn't change it hence the Dmesg that I got above. So I would get 48000/96000 48000/48000 ... and there were 8 different altsettings I could choose from.

Re: USB Soundcard Nightmares...

Posted: Sun Nov 01, 2009 1:57 pm
by cesium
Well, if you want to prevent OSS from loading its hdaudio driver, just edit /usr/lib/oss/etc/installed_drivers and erase "oss_hdaudio" line.

As for the USB card, check if you have an "altsettings" option in the mixer, and try modifying it. Also, try attaching vmix to it (add "vmixctl attach -M /dev/dsp /dev/dsp_in" line to /usr/lib/oss/soundon.user just before "exit 0" line).

Re: USB Soundcard Nightmares...

Posted: Sun Nov 01, 2009 9:21 pm
by Ithilin
cesium wrote:Well, if you want to prevent OSS from loading its hdaudio driver, just edit /usr/lib/oss/etc/installed_drivers and erase "oss_hdaudio" line.

As for the USB card, check if you have an "altsettings" option in the mixer, and try modifying it. Also, try attaching vmix to it (add "vmixctl attach -M /dev/dsp /dev/dsp_in" line to /usr/lib/oss/soundon.user just before "exit 0" line).


In the post above I said that I tried the altsettings options with no avail, but I haven't tried the vmix one so I'll give that a go and report back.

EDIT: Ok so I tried what you said and added the vmix than I also went ahead and tried fiddling with the altsettings again, but any and every alternative always gives me this message in the Dmesg output.

"oss_usb: Endpoint control write error -32
Failed to set 48000 Hz sampling rate"

Plus I tried running the command that you said to put in that file above *the vmix one*. And I got this
vmixctl attach -M /dev/dsp /dev/dsp_in
/dev/dsp_in: No such file or directory

EDIT.... Again: I just thought that this might be of use. Whenever I type in ossmix, I get this.

Selected mixer 0/USB sound device
Known controls are:
play-altset <OFF|1|2|3|4|5|6|7|8> (currently 1)
rec-altset <OFF|1|2|3|4> (currently OFF)

Re: USB Soundcard Nightmares...

Posted: Tue Nov 17, 2009 8:57 pm
by kristian
I got my usb device working by adding a true return value in the function write_control_value(...) in ossusb_audio.c.

Code: Select all

static int
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,
           int ctl, int l, unsigned int v)
{
  return 1;


PS. The latest usb related commit by Yair (870 / 50005aa1b0be) makes vmix attach correctly to the mixer.

Re: USB Soundcard Nightmares...

Posted: Wed Nov 18, 2009 11:08 pm
by kirby
Got issues with USB driver as well, using my Alesis M1Active 320 USB monitors and OSS4.2 build 2002.

When I run osstest, it says

Code: Select all

- Performing audio playback test...
  <left> Device returned error: Input/output error


and dmesg says

Code: Select all

[ 2816.572660] oss_usb: Endpoint control write error -32
[ 2816.572668] Failed to set 48000 Hz sampling rate


I have tried all altsettings (whatever that is). Also, when I try to attach vmix to it, I get

Code: Select all

VMIXCTL_ATTACH: Input/output error


and dmesg:

Code: Select all

[ 2472.645580] Vmix instance 2: Master device 0 is not compatible with vmix (error -5)

Re: USB Soundcard Nightmares...

Posted: Thu Nov 19, 2009 6:19 am
by kristian
Try the work around mentioned in my previous post.

Re: USB Soundcard Nightmares...

Posted: Thu Nov 19, 2009 6:17 pm
by kirby
Try the work around mentioned in my previous post.


This worked like a charm. Thanks a lot, you are my hero.

Re: USB Soundcard Nightmares...

Posted: Thu Nov 19, 2009 6:33 pm
by kristian
kirby wrote:This worked like a charm. Thanks a lot, you are my hero.

It's not a proper fix in any way but it "works for me". I'm glad it works for you too.

Hopefully someone with the proper knowledge can solve this one for real later on.

Re: USB Soundcard Nightmares...

Posted: Sat Nov 21, 2009 5:56 am
by Anonymo
kristian wrote:I got my usb device working by adding a true return value in the function write_control_value(...) in ossusb_audio.c.

Code: Select all

static int
write_control_value (ossusb_devc * devc, udi_endpoint_handle_t * endpoint,
           int ctl, int l, unsigned int v)
{
  return 1;


PS. The latest usb related commit by Yair (870 / 50005aa1b0be) makes vmix attach correctly to the mixer.


Where is the ossusb_audio.c file?

Re: USB Soundcard Nightmares...

Posted: Sat Nov 21, 2009 7:48 am
by kristian
[BUILD DIRECTORY]/kernel/drv/oss_usb/ossusb_audio.c

Re: USB Soundcard Nightmares...

Posted: Sat Nov 21, 2009 3:28 pm
by Anonymo
kristian wrote:[BUILD DIRECTORY]/kernel/drv/oss_usb/ossusb_audio.c


I'm on Arch Linux, I don't think I have a build directory. I'm using the kernel provided. I have the USB 5.1 x-fi USB and it works with alsa, so I know everything is plugged in.
Whenever I run osstest, I get

Code: Select all

[raul@Atreides ~]$ osstest
Sound subsystem and version: OSS 4.2 (b 2002/200911172222) (0x00040100)
Platform: Linux/x86_64 2.6.31-ARCH #1 SMP PREEMPT Tue Nov 10 19:01:40 CET 2009

*** Scanning sound adapter #-1 ***
/dev/oss/usb041e3042-1/pcm0 (audio engine 0): USB sound device play
- Performing audio playback test...
  <left> Device returned error: Input/output error

*** Scanning sound adapter #3 ***
/dev/oss/usb041e3042-2/pcmin0 (audio engine 1): USB sound device rec
- Skipping input only device

*** Some errors were detected during the tests ***


I followed the directions here:
http://wiki.archlinux.org/index.php/OSS

Re: USB Soundcard Nightmares...

Posted: Sat Nov 21, 2009 6:34 pm
by kristian
It seems your using a package manager for installing oss. Usally the packages only contain the binary. To make the changes mentioned earlier you need to build and install oss from source. This however might not be easy if your not experienced with building from source.

Re: USB Soundcard Nightmares...

Posted: Sat Nov 21, 2009 11:07 pm
by Maxa
Anonymo wrote:
kristian wrote:[BUILD DIRECTORY]/kernel/drv/oss_usb/ossusb_audio.c

I'm on Arch Linux, I don't think I have a build directory.

Arch Linux has pkgbuilds on their site, similar to gentoo ebuilds. http://repos.archlinux.org/wsvn/communi ... ty-x86_64/ from here, download and extract the tarball, then "makepkg --nobuild" to download and extract the sources in "src/" subdirectory. Edit the sources as needed, then build with "makepkg --noextract". See makepkg manual if you need more info and options, there's also something in wiki