You are not logged in.

#1 2013-10-08 15:52:20

Diggo
Member
Registered: 2013-05-29
Posts: 13

Asound.conf for x-fi emu20k with upmixing.

Hi,

i think some weeks ago my problems started after a system update. I am using a Creative X-Fi Elite Pro (emu20k). Sadly i can't tell which update started the problems. VLC and K-Mix went nuts, now displaying two volume-sliders for vlc. If you touch one slider, the volume in vlc immediately increases to maximum showing 125% volume. But it seems like its about 400% volume. It gets so loud that you have to turn down the speakervolume, but even then it's not possible to listen to it, because of the heavy distortion.
The problem only occurs, when i have upmixing in my asound.conf. Without upmixing everything is fine, except music sounds lame without a subwoofer. So now testing around a bit, i thought it would be nice if i could get a lowpass-filter, but currently i am not able to get a working config :-/
There are a lot of sample configs for software-mixing with dmix, but somwhere i read, that my soundcard has hardware-mixers and that i should prefer them.

I tried both of the configs here: http://forums.gentoo.org/viewtopic-p-45 … ml#4528619 as they were mentioned here in the archforum somwhere.

before that my last config lines were:

pcm.!default { 
slave.pcm surround51 
slave.channels 6 
type route 
ttable.0.0 1 
ttable.1.1 1 
ttable.0.2 1 
ttable.1.3 1 
ttable.0.4 0.5 
ttable.1.4 0.5 
ttable.0.5 0.5 
ttable.1.5 0.5 
} 

pcm.51ch { 
slave.pcm surround51 
slave.channels 6 
type route 
ttable.0.0 1 
ttable.1.1 1 
ttable.0.2 1 
ttable.1.3 1 
ttable.0.4 0.5 
ttable.1.4 0.5 
ttable.0.5 0.5 
ttable.1.5 0.5 
hint { 
show on 
description "Surround 5.1 Channel" 
}  
}

my current /etc/asound.conf

#Software Volume Control
# ----------------

# Die Hardwarekarte
pcm.snd_card {
        type hw
        card 0
        device 0
}

# This is a virtual 5.1 device:
pcm.softvol {
        type                    softvol
        slave.pcm               "multi"
        control {
                name            "SoftMaster"
                card            0
        }
}

# Splitting the channels into six different devices:
pcm.multi {
        type                    multi
        slaves {
                a.pcm           "front"
                a.channels      2
                b.pcm           "rear"
                b.channels      2
                c.pcm           "center_lfe"
                c.channels      2
        }
        bindings {
                0.slave         a
                0.channel       0
                1.slave         a
                1.channel       1
                2.slave         b
                2.channel       0
                3.slave         b
                3.channel       1
                4.slave         c
                4.channel       0
                5.slave         c
                5.channel       1
        }
}


# ----------------
# Upmix
# ----------------

# controls[ x ] specifies the crossover frequency x for the subwoofer.
# It needs to be changed 3 times, should not be lower than 50 but also
# not greater than 300:
pcm.lowpass_21to21 {
    type ladspa
    slave.pcm upmix_21to51
    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
         policy none
         input.bindings.0 "Input";
         output.bindings.0 "Output";
         input {
            controls [ 90 ]
         }
      }

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

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

   }
}


pcm.upmix_20to51 {
   type plug
   slave.pcm "lowpass_21to21"
   slave.channels 3
   ttable {
      0.0     1       # left channel
      1.1     1       # right channel
      0.2     0.5     # mix left and right ...
      1.2     0.5     # ... channel for subwoofer
   }
}


pcm.upmix_21to51 {
   type plug
   #For use without software volume control this should be "surround51":
   slave.pcm softvol
   slave.channels 6
   ttable {
      0.0     1       # front left
      1.1     1       # front right
      0.2     1       # rear left
      1.3     1       # rear right

      # Front left/right to center.
      0.4     0.5
      1.4     0.5

      # Set to 2 for subwoofer, more powerful to compensate for bass-removal from other speakers.
      # Would normally be 1.
      2.5     1
    }
}


# ----------------
# Overwrite default devices
# ----------------

pcm.!default {
        type                    asym
        playback.pcm            "upmix_20to51"
}

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

speaker test says:

speaker-test -D upmix_20to51 -c2 -t wav
                                                                                                                      
speaker-test 1.0.27.2                                                                                                 
                                                                                                                      
Wiedergabe-Gerät ist upmix_20to51                                                                                     
Stream-Parameter sind 48000 Hz, S16_LE, 2 Kanäle                                                                      
WAV-Datei(en)                                                                                                         
ALSA lib pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable                                            
ALSA lib pcm_params.c:2162:(snd1_pcm_hw_refine_slave) Slave PCM not usable                                            
Broken configuration for playback: no configurations available: Das Argument ist ungültig                             
Setting of hwparams failed: Das Argument ist ungültig  

aplay -l

**** Liste der Hardware-Geräte (PLAYBACK) ****
Karte 0: XFi [Creative X-Fi], Gerät 0: ctxfi [Front/WaveIn]
  Sub-Geräte: 255/256
  Sub-Gerät #0: subdevice #0
  Sub-Gerät #1: subdevice #1
  Sub-Gerät #2: subdevice #2
...
  Sub-Gerät #255: subdevice #255
Karte 0: XFi [Creative X-Fi], Gerät 1: ctxfi [Surround]
  Sub-Geräte: 256/256
  Sub-Gerät #0: subdevice #0
...
  Sub-Gerät #255: subdevice #255
Karte 0: XFi [Creative X-Fi], Gerät 2: ctxfi [Center/LFE]
  Sub-Geräte: 256/256
  Sub-Gerät #0: subdevice #0
...
  Sub-Gerät #255: subdevice #255
Karte 0: XFi [Creative X-Fi], Gerät 3: ctxfi [Side]
  Sub-Geräte: 256/256
  Sub-Gerät #0: subdevice #0
...
  Sub-Gerät #255: subdevice #255
Karte 0: XFi [Creative X-Fi], Gerät 4: ctxfi [IEC958 Non-audio]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 3: HDMI 0 [HDMI 0]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 7: HDMI 1 [HDMI 1]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 8: HDMI 2 [HDMI 2]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0
Karte 1: NVidia [HDA NVidia], Gerät 9: HDMI 3 [HDMI 3]
  Sub-Geräte: 1/1
  Sub-Gerät #0: subdevice #0

Has anyone a working asound.conf / asound.rc for a X-fi emu20k based card with upmixing?

Last edited by Diggo (2013-10-08 16:11:25)

Offline

#2 2013-10-08 21:44:24

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Asound.conf for x-fi emu20k with upmixing.

Try upmix_20to51 in the config in my sig.

If you encounter problems, test the individual PCMs with speaker-test.

KMix is probably just adding confusion - can you disable it?

Offline

#3 2013-10-09 21:38:42

Diggo
Member
Registered: 2013-05-29
Posts: 13

Re: Asound.conf for x-fi emu20k with upmixing.

Sorry, i wasn't online anymore, yesterday. So i saw your post today, when i just nearly finished creating a config by examples i found (your config was one of these and a post of RGamma here in the Board). I think i slightly start to understand how the configuration works...

I currently have this asound.conf, which works good so far, except that i can't use the ttables for adjusting my volume levels. Maybe i misunderstood sth. ?
My plan was to put the stream into the upmixer, then through the low/highpassfilter, and at last through an adjustment of the volume channels.
I had set up a part i called "volumecontrol", but if i do not make the shortcut from upmix51 to plug:lowpass, the speaker test doesnt work. Any idea what i did miss? I had the same errors with the config from your Gentoo thread, after i had added the float_converter.

Thank you in advance! I'll take a look at the config in your sig tomorrow, i have to get some sleep smile

LSA configuration for use with surround speaker sets.
# Provides on-demand upmixing via plugin plus
# lowpass filtering/crossover capability plus
# software-mixing/dmix support.
# Possibly useful sources include:
# https://wiki.archlinux.org/index.php/Alsa
# http://www.volkerschatz.com/noise/alsa.html
# http://www.sabi.co.uk/Notes/linuxSoundALSA.html
# http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
# For those who understand German: http://wiki.ubuntuusers.de/.asoundrc


# Change default samplerate conversion algorithm to
# SRC_SINC_MEDIUM_QUALITY. Requires package "libsamplerate".
# See http://www.mega-nerd.com/SRC/api_misc.html.
# Other resampling algorithms are available.
defaults.pcm.rate_converter "samplerate_medium"

# The first ALSA device of the first soundcard
# (here: Analog Multichannel Ouput).
# See /proc/asound and "aplay -l".
pcm.sndcard {
        type hw
        card 0
        device 0
}

# Dmix software mixing device.
# Takes multiple input streams, resamples them to target
# rate (here: 48kHz) and sends it to the sound card.
#pcm.dmix51 {
#       type dmix
#       ipc_key 1024
#       slave {
#               pcm "sndcard"
#               channels 6
#               rate 48000
#               period_time 0           # Fixes audio crackling/stutter
#               period_size 1024        # with libsamplerate and chromium.
#               buffer_time 0           # Not all options may be
#               buffer_size 4096        # absolutely necessary.
#       }
#}

# Convert float data from "lowpass51" to integer data
# and pass it on to the dmix device.
pcm.lowpass_float {
        type lfloat
        slave {
                pcm "surround51"
                format "S16_LE"
        }
}

# Lowpass filter.
# Requires "ladspa" for plugin support,
# "cmt" for identity_audio plugin and
# "swh-plugins" for lpf plugin.
# See http://www.ladspa.org/.
pcm.lowpass51 {
        type ladspa
        slave.pcm "lowpass_float"
        path "/usr/lib/ladspa"
        plugins {
                # Copies all audio of all channels to other plugins.
                # If no other plugin handles a channel, it comes out unchanged.
                0 {
                        id 1098 # Identity (Audio) (1098/identity_audio)
                        policy duplicate
                        input.bindings.0 "Input";
                        output.bindings.0 "Output";
                }

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

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

                # Center highpass

                4 {
                        id 1052  # High-pass filter
                        policy none  
                        input.bindings.4 "Input";
                        output.bindings.4 "Output";
                        input {
                          controls [ 120 ]
                        }
                }

                # Actual low-pass filter functionality.
                # Operate on channel 5 (LFE) and remove
                # frequencies higher than 120Hz.
                5 {
                        id 1051  # Low Pass Filter (One Pole) (1051/lpf)
                        policy none
                        input.bindings.5 "Input";
                        output.bindings.5 "Output";
                        input {
                                controls [ 120 ]
                        }
                }
        }
}

pcm.volumecontrol {
   type plug
   #For use without software volume control this should be "surround51":
   slave.pcm "plug:lowpass51"
   ttable {
      0.0     1       # front left
      1.1     1       # front right
      2.2     1       # rear left
      3.3     1       # rear right

      # Front left/right to center.
      4.4     0.4

      # Set to 2 for subwoofer, more powerful to compensate for bass-removal from other speakers.
      # Would normally be 1.
        # center -> sub mit lautstaerke 1
      5.5     4
    }
}

# Automatic upmixing. Requires package "alsa-plugins".
pcm.upmix51 {
        type upmix
        # Simply "lowpass51" won't work.
        # "plug:..." specifies a plug device like
        # the long form for the default device below
        # and takes care of channel/format conversions
        # automatically.

        # works:
        slave.pcm "plug:lowpass51"
        # does not work:
        # slave.pcm "plug:volumecontrol"

        # Specifying the number of channels to upmix to here is mandatory.
        channels 6


}

# Default device to be used by all applications playing all sorts of sources.
# There's automatic upmixing for 2.0 sources and native playback of 5.1 sources.
# (possibly others as supported by the upmix plugin)
pcm.!default {
        type plug
        slave.pcm "upmix51"
}

Offline

Board footer

Powered by FluxBB