diff options
author | ariff <ariff@FreeBSD.org> | 2007-12-14 02:16:26 +0000 |
---|---|---|
committer | ariff <ariff@FreeBSD.org> | 2007-12-14 02:16:26 +0000 |
commit | 76dde6b4fab459f0a8dea9274fe00b6cb566f0a8 (patch) | |
tree | a859808fe281a1c3248ee2ff979aebe00264d1ee | |
parent | c6ebd74e9837a9ac0edd1d9ec2015dad7ea6735e (diff) | |
download | FreeBSD-src-76dde6b4fab459f0a8dea9274fe00b6cb566f0a8.zip FreeBSD-src-76dde6b4fab459f0a8dea9274fe00b6cb566f0a8.tar.gz |
Limit total hardware playback channels to just 1. The reliability of
it's multi DAC / playback channels is not that good. Enabling vchans
make the bug more visible since playback allocation will look for
possible free hardware channels first (i.e: the next DAC, the very first
has been consumed by vchan mixer) which in this case has been proven faulty.
Tested by: Dominic Fandrey <LoN_Kamikaze at gmx dot de>
URL: http://lists.freebsd.org/pipermail/freebsd-stable/2007-December/039022.html
-rw-r--r-- | sys/dev/sound/pci/maestro.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/sys/dev/sound/pci/maestro.c b/sys/dev/sound/pci/maestro.c index 10e7acd..cec690a 100644 --- a/sys/dev/sound/pci/maestro.c +++ b/sys/dev/sound/pci/maestro.c @@ -1771,7 +1771,7 @@ agg_attach(device_t dev) struct resource *irq = NULL; void *ih = NULL; char status[SND_STATUSLEN]; - int ret = 0; + int dacn, ret = 0; ess = malloc(sizeof(*ess), M_DEVBUF, M_WAITOK | M_ZERO); ess->dev = dev; @@ -1786,6 +1786,15 @@ agg_attach(device_t dev) } #endif + if (resource_int_value(device_get_name(dev), device_get_unit(dev), + "dac", &dacn) == 0) { + if (dacn < 1) + dacn = 1; + else if (dacn > AGG_MAXPLAYCH) + dacn = AGG_MAXPLAYCH; + } else + dacn = AGG_MAXPLAYCH; + ess->bufsz = pcm_getbuffersize(dev, 4096, AGG_DEFAULT_BUFSZ, 65536); if (bus_dma_tag_create(/*parent*/ bus_get_dma_tag(dev), /*align */ 4, 1 << (16+1), @@ -1895,7 +1904,7 @@ agg_attach(device_t dev) } ess->codec = codec; - ret = pcm_register(dev, ess, AGG_MAXPLAYCH, 1); + ret = pcm_register(dev, ess, dacn, 1); if (ret) goto bad; @@ -1903,7 +1912,7 @@ agg_attach(device_t dev) agg_lock(ess); agg_power(ess, powerstate_init); agg_unlock(ess); - for (data = 0; data < AGG_MAXPLAYCH; data++) + for (data = 0; data < dacn; data++) pcm_addchan(dev, PCMDIR_PLAY, &aggpch_class, ess); pcm_addchan(dev, PCMDIR_REC, &aggrch_class, ess); adjust_pchbase(ess->pch, ess->playchns, ess->bufsz); |