Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Need help to get it working: "x-fi surround 5.1"
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
keenblade
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1087

PostPosted: Wed Jul 07, 2010 10:33 pm    Post subject: Need help to get it working: "x-fi surround 5.1" Reply with quote

I have an x-fi surround 5.1 which is a usb sound card. I want to use it with analog outputs. Actually I can get stereo sound using mplayer like this:
Code:
mplayer -ao alsa:device=hw=1.0 blabla.mp3

and also I can get all the 6 output working with some confusion (rear acts as csub and vice verse):
Code:

speaker-test -Dplughw:1,0 -c6 -t wav
speaker-test 1.0.23

Playback device is plughw:1,0
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 96 to 87381
Period size range from 48 to 43690
Using max buffer size 87380
Periods = 4
was set period_size = 21845
was set buffer_size = 87380
 0 - Front Left
 4 - Center
 1 - Front Right
 3 - Rear Right
 2 - Rear Left
 5 - LFE
Time per period = 7,294890

I believe media-sound/xfi-drivers does not work for usb x-fi card. So is there a solution to use it as a system wide sound card with 5.1 sound?
What is the current procedure, if there is one for a usb x-fi surround 5.1?
I've read threads here for x-fi driver, but it does not cover the usb one. There are posts for ubuntu, but obviously I won't install ubuntu.
Actually the hardware volume knob and mute button do not work on the card, too. Alsamixer does not have any control for the card. I guess the snd_usb_audio module makes the card working somewhat.
And I hope I won't end up using pulseaudio. Any pointers?
Some info:
Code:

aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC861-VD Analog [ALC861-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: S51 [SB X-Fi Surround 5.1], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: S51 [SB X-Fi Surround 5.1], device 1: USB Audio [USB Audio #1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Code:

aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Intel
    HDA Intel, ALC861-VD Analog
    Default Audio Device
front:CARD=Intel,DEV=0
    HDA Intel, ALC861-VD Analog
    Front speakers
surround40:CARD=Intel,DEV=0
    HDA Intel, ALC861-VD Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
    HDA Intel, ALC861-VD Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
    HDA Intel, ALC861-VD Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
    HDA Intel, ALC861-VD Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
    HDA Intel, ALC861-VD Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
default:CARD=S51
    SB X-Fi Surround 5.1, USB Audio
    Default Audio Device
front:CARD=S51,DEV=0
    SB X-Fi Surround 5.1, USB Audio
    Front speakers
surround40:CARD=S51,DEV=0
    SB X-Fi Surround 5.1, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=S51,DEV=0
    SB X-Fi Surround 5.1, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=S51,DEV=0
    SB X-Fi Surround 5.1, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=S51,DEV=0
    SB X-Fi Surround 5.1, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=S51,DEV=0
    SB X-Fi Surround 5.1, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=S51,DEV=0
    SB X-Fi Surround 5.1, USB Audio
    IEC958 (S/PDIF) Digital Audio Output

_________________
Anyway it's all the same at the end...
Need help to get it working: "x-fi surround 5.1"
Back to top
View user's profile Send private message
keenblade
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1087

PostPosted: Sat Dec 18, 2010 1:04 pm    Post subject: Reply with quote

Ok, for x-fi surround 5.1, here is my tweaked .asoundrc file that I am quite happy with:
Code:

pcm.!default {
    type            plug
    slave.pcm       "softvol"
}

ctl.!default {
    type hw
    card 1
}

ctl.softvol
{
type hw
card 1
}

pcm.softvol {
type softvol
slave {
pcm "upmix_20to51"
}
control {
name "Master" #override the PCM slider to set the softvol volume level globally
card 1
}
}

pcm.dmixed {
    type   asym
    playback.pcm {
           type   dmix
           ipc_key 5678293
       ipc_perm 0660
       ipc_gid audio
       slave {
                      channels 6
                pcm {
               format S16_LE
          rate 48000
          type hw
              card 1
              device 0
              subdevice 0
              }
          }
 
      }
   }

pcm.!surround20 {
   type plug
   slave.pcm "dmixed"
}

pcm.!surround40 {
   type plug
   slave.pcm "dmixed"
}

pcm.!surround51 {
   type plug
   slave.pcm "dmixed"
}

pcm.ch51dup {
        slave.pcm "dmixed"
        slave.channels 6
        type route
 
        # Front
        ttable.0.0 0.5
        ttable.1.1 0.5

        # Rear
        ttable.2.4 2
        ttable.3.5 2
        # Front left/right to rear
        ttable.0.4 1
        ttable.1.5 1

        # Center
        ttable.4.2 0.5
        # Front left/right to center
        ttable.0.2 0.5
        ttable.1.2 0.5
 
        # LFE
        ttable.5.3 1
        # Front to LFE
        ttable.0.3 0.5
        ttable.1.3 0.5
}

# speaker-test -D upmix_20to51 -c 2 -t wav
pcm.upmix_20to51 {
   type plug
   slave.pcm "lowpass_21to21"
   slave.channels 3
   ttable {
      0.0     0.5       # left channel
      1.1     0.5       # right channel
      0.3     2     # mix left and right ...
      1.3     2     # ... channel for subwoofer
   }
}

pcm.lowpass_21to21 {
   type ladspa
   slave.pcm upmix_21to51
   # Set the path to ladspa, to fix this error:
   # Playback open error: -2,No such file or directory
   path "/usr/lib/ladspa"
   channels 3
   plugins {
      0 {
         id 1098  # Identity (Audio) (1098/identity_audio)
         policy duplicate
         input.bindings.0 "Input";
         output.bindings.0 "Output";
      }

      1 {
         id 1052  # High-pass filter front left
         policy none
         input.bindings.0 "Input";
         output.bindings.0 "Output";
         input {
            controls [ 200 ]
         }
      }

      2 {
         id 1052  # High-pass filter front right
         policy none
         input.bindings.1 "Input";
         output.bindings.1 "Output";
         input {
            controls [ 200 ]
         }
      }

      3 {
         id 1672  # Low-pass filter.
         policy none
         input.bindings.2 "Input";
         output.bindings.2 "Output";
         input {
            controls [ 300 2 ]
         }
      }

   }
}

# Debugging:  speaker-test -D upmix_21to51 -c 3 -t wav
pcm.upmix_21to51 {
   type plug
   slave.pcm "dmixed"
#   slave.pcm "lowpass_21to21"
   slave.channels 6
   ttable {
      0.0     1       # front left
      1.1     1       # front right
      0.4     2       # rear left
      1.5     2       # rear right

      # Front left/right to center.
      # Imbalanced because is to the left of the monitor!
      # Would normally be 0.5 each.
      0.2     0.5
      1.2     0.5

      # Subwoofer, more powerful to compensate for bass-removal from other speakers.
      2.3     2
    }
}



high and low pass filters are now in my config.
Anyway, I am happy with the music that surrounds me coming all off my six output :)
Btw, "U2 - Pride" is playing here. Great song though.

I use mpd + gmpc for music. So I need to use this config for ~/.mpdconf:
Code:

audio_output {
          type    "alsa"
          device  "plug:ch51dup"
          name    "ch51dup"
        }
audio_output {
          type    "alsa"
          device  "plug:lowpass_21to21"
          name    "lowpass_21to21"
        }

If I choose "ch51dup" stereo music is converted to 5.1 sound. If I choose " lowpass_21to21" also frequencies are adjusted which makes sound great on my logitech sound system. I don't know why this does not work in .mpdconf?
device "plug:upmix_20to51"
_________________
Anyway it's all the same at the end...
Need help to get it working: "x-fi surround 5.1"


Last edited by keenblade on Fri Apr 29, 2011 5:59 pm; edited 7 times in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Dec 18, 2010 1:25 pm    Post subject: Reply with quote

keenblade wrote:
I am happy with the music that surrounds me coming all off my six output :)

It can be improved - use your subwoofer and tweeters for their appropriate frequencies.
Back to top
View user's profile Send private message
keenblade
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1087

PostPosted: Sat Dec 18, 2010 8:39 pm    Post subject: Reply with quote

PaulBredbury wrote:

It can be improved - use your subwoofer and tweeters for their appropriate frequencies.

Thanks, PaulBredbury. I'll try to borrow your config to adjust frequencies. It is not easy to understand and apply it though.
Although, I have read many of your useful threads about sound, I should have missed that one.
_________________
Anyway it's all the same at the end...
Need help to get it working: "x-fi surround 5.1"
Back to top
View user's profile Send private message
keenblade
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1087

PostPosted: Sat Dec 18, 2010 10:58 pm    Post subject: Reply with quote

I think .asoundrc file is very hard to manage and I confess I could not manage to apply high and low pass filters to my above config.
So, I will have to live with no frequency filtering unless somebody help me with it.
_________________
Anyway it's all the same at the end...
Need help to get it working: "x-fi surround 5.1"


Last edited by keenblade on Thu Apr 28, 2011 11:18 pm; edited 2 times in total
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sun Dec 19, 2010 3:15 am    Post subject: Reply with quote

Well, debug it. *Look* at my config. Notice the packages that you need to install, and the debugging commands shown. E.g.:

listplugins
speaker-test -D plug:lowpass_21to21 -c 3 -t wav
Back to top
View user's profile Send private message
keenblade
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1087

PostPosted: Thu Apr 28, 2011 11:23 pm    Post subject: Reply with quote

Frequency filtering works now. Only I can't use volume adjustment within sound mixer (alsamixer or any other mixer.)
I need to understand how to relate softvol with ch51dup and lowpass_21to21?
Actually, lowpass_21to21 is using ch51dup and I have six output working. But how can I relate softvol and lowpass_21to21, so I can use them globally with a working volume mixer?
_________________
Anyway it's all the same at the end...
Need help to get it working: "x-fi surround 5.1"
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Fri Apr 29, 2011 3:41 pm    Post subject: Reply with quote

keenblade wrote:
lowpass_21to21 is using ch51dup

Er, that sounds pointless and wrong.

The point of lowpass is that the low sounds go only to *one* speaker, the subwoofer.

You should be playing with all the speaker-test commands in my config, so you can get an understanding of how all the PCMs work individually and together.
Back to top
View user's profile Send private message
keenblade
Veteran
Veteran


Joined: 03 Oct 2004
Posts: 1087

PostPosted: Fri Apr 29, 2011 6:08 pm    Post subject: Reply with quote

PaulBredbury wrote:
keenblade wrote:
lowpass_21to21 is using ch51dup

Er, that sounds pointless and wrong.

The point of lowpass is that the low sounds go only to *one* speaker, the subwoofer.

You should be playing with all the speaker-test commands in my config, so you can get an understanding of how all the PCMs work individually and together.

I tried your speaker-test commands. Actually I used your config as a basis. I think I got it working finally globally.
Could you take a look at my config above? I updated it. If you look at "pcm.lowpass_21to21" it is using lowpass filter for sub, but it is also using high pass filters for left and right channels. The thing I can't understand what is happening with the rest of channels. Are the highpass filters are applied to center and rear speakers?
_________________
Anyway it's all the same at the end...
Need help to get it working: "x-fi surround 5.1"
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Apr 30, 2011 12:49 am    Post subject: Reply with quote

keenblade wrote:
Actually I used your config as a basis

And then tweaked it until you broke it 8O

Telling the music player to use lowpass_21to21 is wrong. It's just a processing stage! The music program should output to upmix_20to51. And if that doesn't work for you, test it with speaker-test and SHOW AN ERROR MESSAGE!

Here's my latest ~/.asoundrc, FWIW. The ALSA wiki URLs have changed slightly (removed "index.php\").

Quote:
Are the highpass filters are applied to center and rear speakers?

See explanation in ALSA wiki entry.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum