tas3004_tables.c off-by-one
PATCH 1/1 tas3004_tables.c off-by-one
Hi,
I noticed that when pushed to the upper limits, the mixer channels on my ibook G4 just went silent (tested with master, bass, treble).
I found out this was due to too short (by one item) arrays in tas3004_tables.c. This patch fixes it. I just copied over the last entry of each array.
HTH,
--
Colin
http://www.colino.net/
sound/dmasound/tas3004_tables.c renamed from sound/dmasound/tas3004_tables.c.orig +4 -4
@@ -195,7 +195,7 @@0x1577b ,0x16a37 ,0x17df5 ,0x192bd ,0x1a890 ,0x1bf7b ,0x1d78d ,0x1f0d1 ,0x20b55 ,0x22727 ,0x24456 ,0x262f2 , -0x2830b +0x2830b ,0x2830b }; static uint tas3004_mixer_tab[]={
@@ -224,7 +224,7 @@0x1577ac ,0x16a370 ,0x17df51 ,0x192bc2 ,0x1a88f8 ,0x1bf7b7 ,0x1d78c9 ,0x1f0d04 ,0x20b542 ,0x227268 ,0x244564 ,0x262f26 , -0x2830af +0x2830af ,0x2830af }; static uint tas3004_treble_tab[]={
@@ -253,7 +253,7 @@0x2f ,0x2c ,0x27 ,0x23 ,0x1f ,0x1a ,0x15 ,0xf ,0x8 ,0x5 ,0x2 ,0x1 , -0x1 +0x1 ,0x1 }; static uint tas3004_bass_tab[]={
@@ -282,7 +282,7 @@0x36 ,0x33 ,0x2f ,0x2b ,0x28 ,0x24 ,0x20 ,0x1c ,0x17 ,0x12 ,0xd ,0x7 , -0x1 +0x1 ,0x1 }; struct tas_gain_t tas3004_gain={
Quoted 8 lines · Colin Leroy
Hi,
I noticed that when pushed to the upper limits, the mixer channels on my ibook G4 just went silent (tested with master, bass, treble).
I found out this was due to too short (by one item) arrays in
tas3004_tables.c. This patch fixes it. I just copied over the last entry of each array.
Interesting, my understanding is that those values were taken from Darwin ;) I'll look at this too along with your fan stuff and merge, thanks.
Ben.
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
On 21 Dec 2003 at 10h12, Benjamin Herrenschmidt wrote:
Hi,
Quoted 6 lines
Quoted 3 lines
I found out this was due to too short (by one item) arrays in
tas3004_tables.c. This patch fixes it. I just copied over the last entry of each array.Interesting, my understanding is that those values were taken from Darwin ;)
That's what I thought too; that's a bit odd. debug printk()s clearly told me that the kernel was trying to get array[101] of the 101 elements arrays :-) Maybe Darwin doesn't allow the mixers to get to 100% ?
--
Colin
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
Quoted 9 lines
Quoted 5 lines
I found out this was due to too short (by one item) arrays in
tas3004_tables.c. This patch fixes it. I just copied over the last entry
of each array.Interesting, my understanding is that those values were taken from Darwin ;) I'll look at this too along with your fan stuff and merge, thanks.
It could be these tables are taken from Darwin, but there is no need for that; the chip manual contains those tables, too (but for a bigger range of values).
Segher
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/
On 09 Jan 2004 at 23h01, Segher Boessenkool wrote:
Hi,
Quoted 3 lines
It could be these tables are taken from Darwin, but there is no need for that; the chip manual contains those tables, too (but for a bigger range of values).
By the way, this was for kernel 2.4 and dmasound. Alsa drivers in 2.6 work fine.
--
Colin
** Sent via the linuxppc-dev mail list. See http://lists.linuxppc.org/