Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[solved?]asound.conf, softvol, 5.1, low pass filter,
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Dragonix
Apprentice
Apprentice


Joined: 21 May 2006
Posts: 253
Location: Germany

PostPosted: Sat Jul 24, 2010 2:33 pm    Post subject: [solved?]asound.conf, softvol, 5.1, low pass filter, Reply with quote

Hi,
I've problems with alsa. What I'd like to achieve (my soundcard is an emu10k1):
stereo-source (mp3 for example, !default) --> upmix + lowpass filter --> softvol --> sound card
and
surround-source (movie) --> softvol (same conrtrol as above!) --> sound card

My asound.conf:
(stereo --> umpix_20to51 --> lowpass_21to21_plug --> lowpass_21to21 --> upmix_21to51_float --> upmix_21to51 --> softvolume51 --> multi)
*code removed, see below*

However, it is not working :(
Code:
$ speaker-test -c 2 -D default

speaker-test 1.0.22

Wiedergabe-Gerät ist default
Stream-Parameter sind 48000 Hz, S16_LE, 2 Kanäle
Verwende 16 Oktaven rosa Rauschen
speaker-test: pcm_params.c:170: snd1_pcm_hw_param_get_min: Zusicherung »!snd_interval_empty(i)« nicht erfüllt. (==snd_pcm_hw_param_get_min: Assertion `!snd_interval_empty(i)' failed.)
Abgebrochen


Any ideas?

Thanks :)

Edit.. I think I fixed it?! I just added some "route", "asym", .. plugins and now it seems to work.. feel free to test..
Code:

pcm.snd_card {
    type hw
    card 0
}

pcm.snd_card_plug {
type plug
slave.pcm "snd_card"
}


pcm.multi {
    type            multi
    slaves {
        a.pcm        "front:Live"
        a.channels    2

        b.pcm        "rear:Live"
        b.channels    2

        c.pcm        "center_lfe:Live"
        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
    }
}

pcm.softvolume51 {
    type            softvol
    slave.pcm       "plug:multi"
#    slave.channels  6
    control.name    "Real Master 5.1"
    control.card    0

}

pcm.defroute {
type route
slave.pcm upmix_20to51
ttable {
        0.0     1       # left channel
        1.1     1       # right channel
    }
}

pcm.!default {
   type asym
   playback.pcm "defroute"
hint {
        show on
        description "Def Stereo Out"
    }
}

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

pcm.upmix_20to51 {
    type route
    slave.pcm "lowpass_21to21_plug"
    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 route
    slave.pcm "softvolume51"
    slave.channels 6
    ttable {
        0.0     1       # front left
        1.1     1       # front right
        0.2     1       # rear left
        1.3     1       # rear right
        0.4     0.5     # center
        1.4     0.5     # center
        2.5     1       # subwoofer
    }

}

pcm.upmix_21to51_float {
type lfloat

slave.pcm "upmix_21to51"
slave.format "S16_LE"
}

pcm.lowpass_21to21_plug {
type plug
slave.pcm "lowpass_21to21"
}

pcm.lowpass_21to21 {
   type ladspa
   slave.pcm "upmix_21to51_float"
   # Set the path to ladspa, to fix this error:
   # Playback open error: -2,No such file or directory
   path "/usr/lib64/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 [ 120 ]   #120 = my crossover freq
         }
      }

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

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

pcm.doom {
   slave.pcm surround51
   slave.channels 6
   type route
   ttable.0.0 1
   ttable.1.1 1
   ttable.2.4 1
   ttable.3.5 1
   ttable.4.2 1
   ttable.5.3 1
}



Last edited by Dragonix on Sat Jul 24, 2010 3:11 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: Sat Jul 24, 2010 3:01 pm    Post subject: Reply with quote

So, do some debugging yourself. Narrow it down. Use speaker-test on all those pcms that you've defined, and see which work and which don't.

The current latest ALSA is 1.0.23, but I dunno whether 1.0.22 is the cause of your problem.
Back to top
View user's profile Send private message
Dragonix
Apprentice
Apprentice


Joined: 21 May 2006
Posts: 253
Location: Germany

PostPosted: Sat Jul 24, 2010 3:10 pm    Post subject: Reply with quote

Oh I did. Believe me. I guess I started this "project" 2 years ago. A few weeks ago I found this: http://alsa.opensrc.org/index.php/Low-pass_filter_for_subwoofer_channel_(HOWTO)#Troubleshooting , however it didn't help.
Funny thing: Just because "speaker-test -D exampledev" is working, it doesn't mean that exampledev is working in my asound.conf -- try a route, plug, lfloat, or whatever...
But now I think it's working.. except vlc (no sound) and flash-plugin (maximum volume.. it seems to ignore !default...)
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Jul 24, 2010 3:16 pm    Post subject: Reply with quote

I did this (except softvol, which I don't need) over 2 years ago.

Why can't people using ****ing GOOGLE? I've lost count of the number of times I've linked back to it.

Flash uses !default - you can prove it yourself easily, by redefining !default. Unless you're one of the 0.00001% of users for whom it mysteriously prefers /dev/dsp.

Provide more detail, if you want assistance.
Back to top
View user's profile Send private message
Dragonix
Apprentice
Apprentice


Joined: 21 May 2006
Posts: 253
Location: Germany

PostPosted: Sat Jul 24, 2010 3:23 pm    Post subject: Reply with quote

Yeah. Just upmixing + low pass is simple.
But your config misses softvol. Softvol for stereo + 5.1 and that's complicated. Despite that, it outputs on surround51 (and the rest is identical to mine! Unfortuntely your config is *only a part of mine*) and it misses lfloat (at least I need it, but, according to the alsa wiki it IS needed). I can't do that, as I redifine surround51. My config is working now, and I stated clearly what I want.

Details? My asound.conf is there. Juk, amarok, mplayer are working with my !default. Only adobe-flash (nsplugin-wrapper - amd64?) ignores it. And vlc requests alsa-lib-1.0.23 (which I was using): "Potential ALSA version problem: VLC failed to initialize your sound output device (if any). Please update alsa-lib to version 1.0.23-2-g8d80d5f or higher to try to fix this issue." --> No sound (console: ALSA lib pcm_route.c:1015:(snd_pcm_route_load_ttable) Invalid type for 2;; this is the only alsa-related message. SDL Output --> no sound)

However, the flash thing exists since adobe discontinued the 64bit plugin.. so I guess the problem is linked to nsplugin-wrapper?!
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Sat Jul 24, 2010 4:06 pm    Post subject: Reply with quote

Dragonix wrote:
it misses lfloat

In all my ALSA messings, I've never heard of a problem fixed by lfloat - what makes you think it's important?

I don't use 64-bit, so can thankfully bypass the 64-bit flash headache.

I suggest you try improved dmix. Note that it stays in 5.1, 48khz for everything. Because that's the only way I found to keep it reliable.
Back to top
View user's profile Send private message
Dragonix
Apprentice
Apprentice


Joined: 21 May 2006
Posts: 253
Location: Germany

PostPosted: Sat Jul 24, 2010 4:28 pm    Post subject: Reply with quote

Quote:
In all my ALSA messings, I've never heard of a problem fixed by lfloat - what makes you think it's important?

To be honest? I think it *shouldn't* be necessary. The ladspa plugins output data in the "float" format. And "plug" is "too stupid" to do a format-conversation. Link: http://alsa.opensrc.org/index.php/Low-pass_filter_for_subwoofer_channel_(HOWTO)#Troubleshooting . I can confirm that I musn't remove the lfloat stuff, else --> "pcm_params.c:170: snd1_pcm_hw_param_get_min: Assertion `!snd_interval_empty(i)' failed...

Quote:
I suggest you try improved dmix. Note that it stays in 5.1, 48khz for everything. Because that's the only way I found to keep it reliable.

I am going to try it. But I always ignored dmix as my card is capable of hardware mixing.

Any idea about vlc (1.1.0/1.1.1)? I'm a little bit clueless here.. Normal user? Error. User with empty /home/user? Error. Normal asound.conf? Error. No asound.conf? Error. alsa-lib-1.0.21? Error. 1.0.22? Error. 1.0.23 (as requested!)? Error. Gentoo-sources? Error. Zen-sources? Error...
1.0.6 is working fine..
Code:

[ebuild   R   ] media-video/vlc-1.1.1  USE="X a52 aac aalib alsa bidi cdda cddb dbus dts dvb dvd ffmpeg flac gcrypt gnutls httpd kde libass libcaca live matroska mmx mp3 mpeg musepack ncurses nsplugin ogg opengl png qt4 samba sdl skins sse stream svg theora truetype twolame vlm vorbis x264 xcb xml xv (-altivec) -atmo -avahi -dc1394 -debug -dirac -directfb -fbcon -fluidsynth -fontconfig -ggi -gnome -id3tag -ieee1394 -jack -kate -libnotify -libproxy -libtiger -libv4l -libv4l2 -lirc -lua -modplug -mtp -optimisememory -oss -projectm -pulseaudio -pvr -remoteosd -rtsp -run-as-root -schroedinger -sdl-image -shine -shout -speex -sqlite (-svga) -taglib -udev -upnp -v4l -v4l2 -vaapi -vcdx (-win32codecs) -wma-fixed -xosd -zvbi" 0 kB


Thanks (especially @PaulBredbury for his patience :) )
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia 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