All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] emu10k1: minor send routing cleanup
@ 2004-11-16 22:55 Lee Revell
  2004-11-17 13:38 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: Lee Revell @ 2004-11-16 22:55 UTC (permalink / raw)
  To: alsa-devel; +Cc: perex, tiwai

Use snd_emu10k1_compose_audigy_fxrt* macro where appropriate.  Also add
a few comments to explain send routing structure.

Signed-Off-By: Lee Revell <rlrevell@joe-job.com>

diff -Nru alsa-multi/alsa-kernel/include/emu10k1.h alsa-dev/alsa-kernel/include/emu10k1.h
--- alsa-multi/alsa-kernel/include/emu10k1.h	2004-11-16 17:44:27.000000000 -0500
+++ alsa-dev/alsa-kernel/include/emu10k1.h	2004-11-16 17:31:39.000000000 -0500
@@ -833,6 +833,7 @@
 };
 
 typedef struct {
+	/* mono, left, right x 8 sends (4 on emu10k1) */
 	unsigned char send_routing[3][8];
 	unsigned char send_volume[3][8];
 	unsigned short attn[3];
diff -Nru alsa-multi/alsa-kernel/pci/emu10k1/emupcm.c alsa-dev/alsa-kernel/pci/emu10k1/emupcm.c
--- alsa-multi/alsa-kernel/pci/emu10k1/emupcm.c	2004-11-16 17:44:25.000000000 -0500
+++ alsa-dev/alsa-kernel/pci/emu10k1/emupcm.c	2004-11-16 17:31:30.000000000 -0500
@@ -336,6 +336,7 @@
 		send_routing[3] = 3;
 		memset(send_amount, 0, sizeof(send_amount));
 	} else {
+		/* mono, left, right (master voice = left) */
 		tmp = stereo ? (master ? 1 : 2) : 0;
 		memcpy(send_routing, &mix->send_routing[tmp][0], 8);
 		memcpy(send_amount, &mix->send_volume[tmp][0], 8);
@@ -363,15 +364,9 @@
 	// setup routing
 	if (emu->audigy) {
 		snd_emu10k1_ptr_write(emu, A_FXRT1, voice,
-				      ((unsigned int)send_routing[3] << 24) |
-				      ((unsigned int)send_routing[2] << 16) |
-				      ((unsigned int)send_routing[1] << 8) |
-				      (unsigned int)send_routing[0]);
+				      snd_emu10k1_compose_audigy_fxrt1(send_routing));
 		snd_emu10k1_ptr_write(emu, A_FXRT2, voice,
-				      ((unsigned int)send_routing[7] << 24) |
-				      ((unsigned int)send_routing[6] << 16) |
-				      ((unsigned int)send_routing[5] << 8) |
-				      (unsigned int)send_routing[4]);
+				      snd_emu10k1_compose_audigy_fxrt2(send_routing));
 		snd_emu10k1_ptr_write(emu, A_SENDAMOUNTS, voice,
 				      ((unsigned int)send_amount[4] << 24) |
 				      ((unsigned int)send_amount[5] << 16) |




-------------------------------------------------------
This SF.Net email is sponsored by: InterSystems CACHE
FREE OODBMS DOWNLOAD - A multidimensional database that combines
robust object and relational technologies, making it a perfect match
for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8

^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: Re: [PATCH] emu10k1: minor send routing cleanup
@ 2004-11-21  1:21 James
  2004-11-22 11:36 ` Takashi Iwai
  0 siblings, 1 reply; 7+ messages in thread
From: James @ 2004-11-21  1:21 UTC (permalink / raw)
  To: Lee Revell; +Cc: Takashi Iwai, alsa-devel, perex

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

Lee Revell wrote:
> On Wed, 2004-11-17 at 14:38 +0100, Takashi Iwai wrote:
> 
>>>Use snd_emu10k1_compose_audigy_fxrt* macro where appropriate.  Also add
>>>a few comments to explain send routing structure.
>>>
>>>Signed-Off-By: Lee Revell <rlrevell@joe-job.com>
>>
>>Thanks, applied to CVS.
>>
> 
> 
> Sorry, please revert this one.  It disables the right channel.  The
> macro must not be correct.
> 
> Lee
> 

Use the attached patch to fix this problem.

[-- Attachment #2: emu10k1.h.diff --]
[-- Type: text/x-diff, Size: 883 bytes --]

--- emu10k1.h.org	2004-11-21 01:04:06.875103895 +0000
+++ emu10k1.h	2004-11-21 01:04:10.252609912 +0000
@@ -840,10 +840,10 @@
 ((route[0] | (route[1] << 4) | (route[2] << 8) | (route[3] << 12)) << 16)
 
 #define snd_emu10k1_compose_audigy_fxrt1(route) \
-(((unsigned int)route[0] | ((unsigned int)route[1] << 8) | ((unsigned int)route[2] << 16) | ((unsigned int)route[3] << 12)) << 24)
+((unsigned int)route[0] | ((unsigned int)route[1] << 8) | ((unsigned int)route[2] << 16) | ((unsigned int)route[3] << 24))
 
 #define snd_emu10k1_compose_audigy_fxrt2(route) \
-(((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 12)) << 24)
+((unsigned int)route[4] | ((unsigned int)route[5] << 8) | ((unsigned int)route[6] << 16) | ((unsigned int)route[7] << 24))
 
 typedef struct snd_emu10k1_memblk {
 	snd_util_memblk_t mem;

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-11-22 18:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-16 22:55 [PATCH] emu10k1: minor send routing cleanup Lee Revell
2004-11-17 13:38 ` Takashi Iwai
2004-11-20 23:29   ` Lee Revell
  -- strict thread matches above, loose matches on Subject: below --
2004-11-21  1:21 James
2004-11-22 11:36 ` Takashi Iwai
2004-11-22 18:30   ` James Courtier-Dutton
2004-11-22 18:42     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.