Date: Wed, 10 Dec 2003 16:35:44 -0800 From: Orion Hodson <orion@freebsd.org> To: Michael Nottebrock <michaelnottebrock@gmx.net> Cc: multimedia@freebsd.org Subject: Fixed rate codec with vchans [ was Re: Problem with snd_ich and vchans ] Message-ID: <200312110035.hBB0ZiNc013558@puma.icir.org> In-Reply-To: Your message of "Wed, 10 Dec 2003 22:20:57 %2B0100." <200312102221.03613.michaelnottebrock@gmx.net>
next in thread | previous in thread | raw e-mail | index | archive | help
/-- Michael Nottebrock wrote: | | pcm0: <Intel ICH2 (82801BA)> port 0xe800-0xe83f,0xec00-0xecff irq 10 at dev= | ice=20 | 31.5 on pci0 | pcm0: <C-Media Electronics CMI9739 AC97 Codec> | | running by default with hw.snd.pcm0.ac97rate: 48000. | | Now when I enable vchans, sound plays back to slowly (pitched down), fiddli= | ng=20 | with above sysctl doesn't have any effect. I found the following in vchan.c: | | /* XXX gross ugly hack, kill murder death */ | if (first && !err) { | err =3D chn_reset(parent, AFMT_STEREO | AFMT_S16_LE); | if (err) | printf("chn_reset: %d\n", err); | err =3D chn_setspeed(parent, 44100); | if (err) | printf("chn_setspeed: %d\n", err); | } | | When I change the 44100 to 48000 there, sound plays back normally with vcha= | ns enabled. Michael The ac97 codec is fixed rate (48kHz). The virtual channel code resamples all playback streams to 44.1kHz before mixing them and needs to arrange to plumb in a rate converter after the mixing step. Unfortunately, there's a bug in the planning code that doesn't allow this to happen correctly. The patch above is nicely avoids this problem for the case in hand. The bugs in the feeder planning code also affect recording and certain format selections (quite a lot of cases with fixed rate codecs). There's an attempted general case patch relative to -CURRENT in August: http://people.freebsd.org/~orion/files/ac97_fixed_rate_feeder.patch The patch was written at about the point I decided I wanted to take a break from the project and has not been committed. It touches quite a lot of code, but hopefully makes the feeder planning easier to reason about. Kind Regards - Orion
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200312110035.hBB0ZiNc013558>