View previous topic :: View next topic |
Author |
Message |
octoploid n00b
Joined: 21 Oct 2006 Posts: 65
|
Posted: Thu Dec 18, 2008 1:45 pm Post subject: Crossfeed ALSA plugin (for headphones) |
|
|
What is crossfeed?
From wikipedia:
Quote: | Crossfeeding, blends the left and right stereo channels slightly, reducing the extreme channel separation characteristic of headphone listening that is known to cause headaches in a small fraction of listeners (and compensating for extreme separation in older stereo releases). Crossfeed also improves the soundstage characteristics and makes the music sound more natural as if one was listening to a pair of speakers. |
First we will install the bs2b crossfeed plugin.
This ladspa plugin is part of the tap-plugins and is only available in CVS. (no ebuild)
Code: | # emerge ladspa-sdk
cd /tmp
rsync -av "rsync://PROJECTNAME.cvs.sourceforge.net/cvsroot/tap-plugins/*" .
export CVSROOT=/tmp
cd ~
cvs -z3 co tap-plugins
cd tap-plugins
make
# make install
# env-update |
Now we must tell alsa to use this new plugin.
We edit /etc/asound.conf:
Code: | pcm.!default {
type hw
card 0
}
ctl.!default {
type hw
card 0
}
pcm.crossfeed {
type plug
slave.pcm "ladspa"
}
pcm.ladspa {
type ladspa
slave.pcm "plughw:0,0";
path "/usr/local/lib/ladspa";
plugins [
{
label tap_bs2b
input {
controls [ 2 1 ]
}
}
]
} |
This should be adjusted to reflect your hardware configuration. I use an external USB DAC
with no software mixing (bit-perfect sound) . You can set different sound characteristics
with the "controls" values. (First integer 1..3, second 0 or 1). See:
http://www.hydrogenaudio.org/forums/index.php?showtopic=38291
or the source code for further information.
Now we must tell our music player to use the alsa-crossfeed plugin.
I will give two examples: cmus and mpd.
cmus:
Just type ":set dsp.alsa.device=crossfeed" to enable the plugin and
":set dsp.alsa.device=default" to switch it off again.
mpd:
Edit /etc/mpd.conf
Code: | audio_output {
type "alsa"
name "ALSA default"
device "default"
# format "44100:16:2" # optional
}
#
audio_output {
type "alsa"
name "ALSA crossfeed"
device "crossfeed"
# format "44100:16:2" # optional
} |
Restart mpd and run "mpc disable 1"
"mpc outputs" now shows:
Code: | Output 1 (ALSA default) is disabled
Output 2 (ALSA crossfeed) is enabled |
If you want to switch the crossfeed plugin off again, you
just enable output 1 and disable output 2. _________________ Myself and mine gymnastic ever |
|
Back to top |
|
|
a.b. Apprentice
Joined: 23 Mar 2008 Posts: 218 Location: Anus Mundi, Germany
|
Posted: Fri Dec 19, 2008 6:18 pm Post subject: |
|
|
I tried that but it doesn't work. The most meaningful error messages comes from mplayer:
Quote: |
[AO_ALSA] alsa-lib: pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM ladspa
[AO_ALSA] Playback open error: File exists
Failed to initialize audio driver 'alsa:device=crossfeed'
Could not open/initialize audio device -> no sound.
|
|
|
Back to top |
|
|
octoploid n00b
Joined: 21 Oct 2006 Posts: 65
|
Posted: Fri Dec 19, 2008 6:31 pm Post subject: |
|
|
a.b. wrote: | I tried that but it doesn't work. The most meaningful error messages comes from mplayer:
Quote: |
[AO_ALSA] alsa-lib: pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM ladspa
[AO_ALSA] Playback open error: File exists
Failed to initialize audio driver 'alsa:device=crossfeed'
Could not open/initialize audio device -> no sound.
|
|
You should make sure that ALSA_PCM_PLUGINS="ladspa" is set, when you emerge alsa-lib.
Also check if both "pcm.crossfeed" and "pcm.ladspa" are defined in your asound.conf as
described above. _________________ Myself and mine gymnastic ever |
|
Back to top |
|
|
a.b. Apprentice
Joined: 23 Mar 2008 Posts: 218 Location: Anus Mundi, Germany
|
Posted: Fri Dec 19, 2008 7:33 pm Post subject: |
|
|
octoploid wrote: | a.b. wrote: | I tried that but it doesn't work. The most meaningful error messages comes from mplayer:
Quote: |
[AO_ALSA] alsa-lib: pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM ladspa
[AO_ALSA] Playback open error: File exists
Failed to initialize audio driver 'alsa:device=crossfeed'
Could not open/initialize audio device -> no sound.
|
|
You should make sure that ALSA_PCM_PLUGINS="ladspa" is set, when you emerge alsa-lib.
|
In fact I have set ALSA_PCM_PLUGINS="*" in my make.conf. I'll try remergeing with ladspa
explicitly set.
Quote: |
Also check if both "pcm.crossfeed" and "pcm.ladspa" are defined in your asound.conf as
described above. |
I copy&pasted yours. |
|
Back to top |
|
|
octoploid n00b
Joined: 21 Oct 2006 Posts: 65
|
Posted: Fri Dec 19, 2008 7:48 pm Post subject: |
|
|
a.b. wrote: | octoploid wrote: | a.b. wrote: | I tried that but it doesn't work. The most meaningful error messages comes from mplayer:
Quote: |
[AO_ALSA] alsa-lib: pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM ladspa
[AO_ALSA] Playback open error: File exists
Failed to initialize audio driver 'alsa:device=crossfeed'
Could not open/initialize audio device -> no sound.
|
|
You should make sure that ALSA_PCM_PLUGINS="ladspa" is set, when you emerge alsa-lib.
|
In fact I have set ALSA_PCM_PLUGINS="*" in my make.conf. I'll try remergeing with ladspa
explicitly set. |
Just delete ALSA_PCM_PLUGINS="*" in your make.conf and re-emerge. This should also build all
alsa pcm plugins. (Check by running: emerge -pv alsa-lib) _________________ Myself and mine gymnastic ever |
|
Back to top |
|
|
a.b. Apprentice
Joined: 23 Mar 2008 Posts: 218 Location: Anus Mundi, Germany
|
Posted: Fri Dec 19, 2008 7:56 pm Post subject: |
|
|
octoploid wrote: | a.b. wrote: | octoploid wrote: | a.b. wrote: | I tried that but it doesn't work. The most meaningful error messages comes from mplayer:
Quote: |
[AO_ALSA] alsa-lib: pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM ladspa
[AO_ALSA] Playback open error: File exists:
Failed to initialize audio driver 'alsa:device=crossfeed'
Could not open/initialize audio device -> no sound.
|
|
You should make sure that ALSA_PCM_PLUGINS="ladspa" is set, when you emerge alsa-lib.
|
In fact I have set ALSA_PCM_PLUGINS="*" in my make.conf. I'll try remergeing with ladspa
explicitly set. |
Just delete ALSA_PCM_PLUGINS="*" in your make.conf and re-emerge. This should also build all
alsa pcm plugins. (Check by running: emerge -pv alsa-lib) |
No, it doesn't. That's probably because I have set USE="-*" |
|
Back to top |
|
|
ciaranhearne n00b
Joined: 23 Feb 2007 Posts: 10
|
Posted: Mon Feb 02, 2009 6:59 pm Post subject: bs2b with Dmix |
|
|
Just in case anyone wants to know how to get this plugin working with Dmix (so you can play multiple sounds at once) here is my working .asoundrc:
Code: |
pcm.!default {
type plug
slave.pcm "ladspa"
}
pcm.crossfeed {
type plug
slave.pcm "ladspa"
}
pcm.ladspa {
type ladspa
slave.pcm "dmixplug"
path "/usr/lib/ladspa";
plugins [
{
label tap_bs2b
input {
controls [ 2 1 ]
}
}
]
}
pcm.dmixplug {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1234
slave {
pcm "hw:0,0"
period_size 1024
buffer_size 4096
rate 44100
}
}
|
Ciaran |
|
Back to top |
|
|
darklegion Guru
Joined: 14 Nov 2004 Posts: 468
|
Posted: Tue Mar 03, 2009 12:01 pm Post subject: |
|
|
I'm just wondering: How do you set configuration options with the bs2b plugin? There is an "easy" crossfeed mode in bs2b that supposedly causes much less treble roll off.I looked in tap_bs2b.c and it is probably CONTROL_HIGH_BOOST that enables this with the ladspa plugin, but I have no idea how to enable it.
I'll have a more thorough look in the morning (I'm badly lacking sleep) but if you already know the answer, I'd love to hear it.The plugin has unacceptable quality at the moment, for me. |
|
Back to top |
|
|
octoploid n00b
Joined: 21 Oct 2006 Posts: 65
|
Posted: Tue Mar 03, 2009 12:38 pm Post subject: |
|
|
darklegion wrote: | I'm just wondering: How do you set configuration options with the bs2b plugin? There is an "easy" crossfeed mode in bs2b that supposedly causes much less treble roll off.I looked in tap_bs2b.c and it is probably CONTROL_HIGH_BOOST that enables this with the ladspa plugin, but I have no idea how to enable it.
I'll have a more thorough look in the morning (I'm badly lacking sleep) but if you already know the answer, I'd love to hear it.The plugin has unacceptable quality at the moment, for me. |
You should check the hydrogenaudio.org link that I've posted above.
Basically :
input {
controls [ 2 1 ]
}
controls the plugin. The second integer sets the "easy" crossfeed mode (1=on, 0=off).
The first integer specifies the crossfeed level:
Quote: | Crossfeed level
1 : Virtual speakers placed almost directly left and right of you (60 degrees azimuth).
2: Virtual speakers at 10 and 2 'o clock.
3: Virtual speakers at 11 and 1 'o clock (30 degrees azimuth).
easy off 0: Virtual speakers further away. Mix the left and right signals normally. Result is mild treble rolloff.
easy on 1: Virtual speakers nearer. Highgain boost or "Easy on the mix, baby!" Not as much treble rolloff.
|
_________________ Myself and mine gymnastic ever |
|
Back to top |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
Posted: Wed Jul 29, 2009 3:30 am Post subject: |
|
|
Thank you octoploid for the how-to, and ciaranhearne for the tip about dmix.
With my Klipsch Custom 2 in-ear monitors I have found I need the aggressive "3" setting to get a minimally comfortable soundstage depth on old/low-quality recordings. With newer recordings that come with more depth, either "2" or "3" give a nice, mild enhancement.
I have created an ebuild "tap-plugins-99999999.ebuild" for the CVS head:
Code: |
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
inherit cvs
DESCRIPTION="Tom's Audio Processing LADSPA plugins"
HOMEPAGE="http://tap-plugins.sourceforge.net/"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
DEPEND="media-libs/ladspa-sdk"
RDEPEND="${DEPEND}"
ECVS_SERVER="${PN}.cvs.sourceforge.net:/cvsroot/${PN}"
ECVS_MODULE="${PN}"
S="${WORKDIR}/${ECVS_MODULE}"
src_unpack() {
cvs_src_unpack
cd "${S}"
epatch "${FILESDIR}/${P}-makefile.patch"
}
src_install() {
emake DESTDIR="${D}" install || die "emake install failed"
dodoc CREDITS README
} |
which requires the following patch in "files/tap-plugins-99999999-makefile.patch" :
Code: | diff -urN tap-plugins-99999999.old/Makefile tap-plugins-99999999/Makefile
--- tap-plugins-99999999.old/Makefile 2009-07-29 11:43:31.000000000 +0900
+++ tap-plugins-99999999/Makefile 2009-07-29 11:46:15.000000000 +0900
@@ -23,8 +23,8 @@
# Change this if you want to install somewhere else. In particular
# you may wish to remove the middle "local/" part of the path.
-INSTALL_PLUGINS_DIR = /usr/local/lib/ladspa/
-INSTALL_LRDF_DIR = /usr/local/share/ladspa/rdf/
+INSTALL_PLUGINS_DIR = ${D}/usr/lib/ladspa/
+INSTALL_LRDF_DIR = ${D}/usr//share/ladspa/rdf/
# NO EDITING below this line is required
# if all you want to do is install and use the plugins.
|
Put these in your local overlay. _________________ Personal overlay | Simple backup scheme |
|
Back to top |
|
|
octoploid n00b
Joined: 21 Oct 2006 Posts: 65
|
Posted: Fri Jul 31, 2009 7:45 pm Post subject: |
|
|
BTW there is new ladspa-bs2b plugin available:
http://sourceforge.net/projects/bs2b/files/LADSPA%20plugin/0.9.1/ladspa-bs2b-0.9.1.tar.bz2/download
If you want to check it out, first emerge libbs2b and then compile and install it by hand (or write
an ebuild).
This new plugin is controlled by two numbers:
Code: | Lowpass-filter-cut-frequency: Lowpass-filter-cut-frequency
flags: readable, writable, controllable
Float. Range: 300 - 2000 Default: 725 Current: 725
Feeding-level : Feeding-level
flags: readable, writable, controllable
Float. Range: 1 - 15 Default: 4.5 Current: 4.5
|
See http://bs2b.sourceforge.net/ for more info. _________________ Myself and mine gymnastic ever |
|
Back to top |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
Posted: Sat Aug 01, 2009 3:39 am Post subject: |
|
|
octoploid,
Thank you again! The mix is much stronger with this plugin, and I find the default settings more than adequate for my IEMs. Here is the ebuild, "ladspa-bs2b-0.9.1.ebuild" :
Code: | # Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
DESCRIPTION="LADSPA plugin for bs2b"
HOMEPAGE="http://bs2b.sourceforge.net"
SRC_URI="mirror://sourceforge/bs2b/LADSPA%20splugin/${PV}/${P}.tar.bz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
DEPEND="media-libs/ladspa-sdk
>=media-libs/libbs2b-3.1.0"
RDEPEND="${DEPEND}"
src_install() {
emake DESTDIR="${D}" install || die "emake install failed"
dodoc AUTHORS THANKS
} |
EDIT: I opened a bug to add this to the Portage tree. _________________ Personal overlay | Simple backup scheme |
|
Back to top |
|
|
sping Developer
Joined: 16 Aug 2009 Posts: 25 Location: Germany, Berlin
|
Posted: Sun Aug 16, 2009 2:26 am Post subject: |
|
|
Hypnos wrote: | Here is the ebuild, "ladspa-bs2b-0.9.1.ebuild" |
Added to the sping overlay next to media-plugins/audacious-bs2b. |
|
Back to top |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
Posted: Tue Dec 20, 2011 2:09 pm Post subject: |
|
|
Sorry for necromancing, but it seems silly to open a new thread for such a small update.
My Klipsch Custom 2 headphones conked out, so I got an Image S4 set. I find I need much less crossfeed, but have to reverse the channels as the headphones fit much better switching left/right. Here is my updated ~/.asoundrc:
Code: | ctl.!default {
type hw
card Intel
}
pcm.!default {
type route
slave.pcm "plug:ladspa"
slave.channels 2
ttable.1.0 1
ttable.0.1 1
}
pcm.ladspa {
type ladspa
slave.pcm "dmixplug"
path "/usr/lib/ladspa"
plugins [
{
label bs2b
# input {
# controls [ 700 5 ]
# }
}
]
}
pcm.dmixplug {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
type dmix
ipc_key 1234
slave {
pcm "hw:0"
period_size 1024
buffer_size 4096
rate 48000
}
}
|
Hopefully this will be useful to someone.
EDIT: This setup seems to screw up mono audio output ... no sound.
EDIT2: PaulBredbury's correction below, plus with "slave.channels 2" mono at least comes out of the front left channel. _________________ Personal overlay | Simple backup scheme
Last edited by Hypnos on Fri Dec 23, 2011 12:13 pm; edited 1 time in total |
|
Back to top |
|
|
PaulBredbury Watchman
Joined: 14 Jul 2005 Posts: 7310
|
Posted: Wed Dec 21, 2011 7:36 am Post subject: |
|
|
Hypnos wrote: | controls [ 1 1 ] |
That's not quite right - I assume that first 1 gets changed to either 300 or 725.
analyseplugin bs2b
Quote: | Ports: "Lowpass filter cut frequency (Hz)" input, control, 300 to 2000, default 725
"Feeding level (dB)" input, control, 1 to 15, default 4.5 |
I've been using in my ~/.asoundrc:
|
|
Back to top |
|
|
Hypnos Advocate
Joined: 18 Jul 2002 Posts: 2889 Location: Omnipresent
|
Posted: Wed Dec 21, 2011 8:53 am Post subject: |
|
|
Paul,
Thanks for the correction -- the ladspa-bs2b code does seem to clip parameter values to the ranges given in the info output, instead of using the presets described in the bs2b headers which were used in the old tap_bs2b plugin.
This also explains why the second parameter always affected the output much more than the first parameter in my experimentation with these new headphones. _________________ Personal overlay | Simple backup scheme |
|
Back to top |
|
|
West201 Tux's lil' helper
Joined: 22 Dec 2011 Posts: 115
|
Posted: Fri Dec 23, 2011 10:42 am Post subject: |
|
|
I can only hear the headset when I use phonon's "test" sound, but when playing music or VLC it's not functioning. Any suggestions ? I did use cmus method. |
|
Back to top |
|
|
|