Date: Fri, 29 Mar 2002 22:16:28 +0100 From: Rahul Siddharthan <rsidd@online.fr> To: "Adam D. Gorski" <agorski@engin.umich.edu> Cc: freebsd-multimedia@FreeBSD.ORG Subject: Re: SB problem (was: Cat'ing /dev/audio) Message-ID: <20020329211628.GA824@lpt.ens.fr> In-Reply-To: <Pine.SOL.4.33.0203291602460.8412-100000@and.engin.umich.edu> References: <20020329191527.B77860@lpt.ens.fr> <Pine.SOL.4.33.0203291602460.8412-100000@and.engin.umich.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Adam D. Gorski said on Mar 29, 2002 at 16:06:02: > Ok.. I converted an 8Khz wav file to Ogg, and that played fine... > > I converted a 44Khz Ogg to wav... I got the popping/screeching > > So basically it goes along with the suggestion that it's a sampling > problem... but is this a BSD-only issue? Everything played like a charm for > me under Linux, no matter what my current CPU load was, never a single skip. It's an issue, as I understand, with the way the PCM sound driver in FreeBSD handles sampling rate conversion: it doesn't do it very well. The only solution I found which worked reliably for me was playing it through arts, specifying the correct output rate (I also tried esd but that didn't work). > Oh, almost forgot.. when I play that 128bps/44Khz Ogg in XMMS, the bitrate > fluctuates.. meaning it goes from like 98 to 114 to 104 to 112 and so forth, > which is accompanied by the screeching. That's a red herring, it doesn't mean anything. The bit rate isn't the sampling rate; the sampling rate is the "output" and is constant, the bit rate is the effective number of bits per second in the encoded file and can vary according to what compression scheme you're using. Basically, the maximum frequency you can reproduce (Nyquist frequency) is set by your sampling rate. When you "upsample" (convert a lower sampling rate to a higher one) you're doing some sort of interpolation, if it's not very good you'll get a bit of distortion but no more. But when you "downsample" some frequencies in your original signal may now be higher than your new Nyqvist frequency -- then if you're not doing it carefully, they get "aliased" into lower frequencies, mixing up with what was already there, and resulting in plenty of noise like what you hear. I think there's no OS-level fix for this problem except digging into the pcm driver, which I'm not competent to do. As a user, you can either look for some sound software which does high-quality sampling rate conversion before output, or play everything through arts. (Even if you're not using kde you can run artsd separately from the command line, and xmms and ogg123 both have arts plugins.) HTH, Rahul To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-multimedia" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020329211628.GA824>