OSS mains HUM filtering 50Hz / 60Hz ?
Hans Petter Selasky
hps at selasky.org
Wed May 14 08:06:12 UTC 2014
On 05/13/14 20:31, Hans Petter Selasky wrote:
> Hi,
>
> Some of my USB audio headsets seems to be picking up mains HUM even if
> powered from battery. At first I thought the mains HUM came from the
> computer, but then I did some work and I verified my findings by
> sampling the AC network using a non-switching power supply. Maybe it
> does not belong in the FreeBSD audio stack, but I think it would be very
> clever to have a configurable band-reject filter in the FreeBSD DSP
> framework for 50 and 60Hz? Do we have such a filter mechanism already?
>
> Not sure if this is a so-called "feature" or not ... :-)
>
> http://en.wikipedia.org/wiki/Mains_hum
>
> http://www.selasky.org/hans_petter/hum.png
>
> --HPS
Hi,
I tried the following patch with some success:
=== pcm/feeder_chain.c
==================================================================
--- pcm/feeder_chain.c (revision 265912)
+++ pcm/feeder_chain.c (local)
@@ -721,7 +721,7 @@
/* Soft EQ only applicable for PLAY. */
if (cdesc.dummy == 0 &&
- c->direction == PCMDIR_PLAY && (d->flags & SD_F_EQ) &&
+ (d->flags & SD_F_EQ) &&
(((d->flags & SD_F_EQ_PC) &&
!(c->flags & CHN_F_HAS_VCHAN)) ||
(!(d->flags & SD_F_EQ_PC) && !(c->flags & CHN_F_VIRTUAL))))
And setting:
hint.pcm.0.eq=1
hint.pcm.1.eq=1
hint.pcm.2.eq=1
hint.pcm.3.eq=1
--HPS
More information about the freebsd-multimedia
mailing list