freebsd-skq/sys/dev/sound/pci
Alexander Leidinger 9190333ce7 Fix the order of the stereo channels (left <-> right).
From the PR:
---snip---
 I think I have found the change which reversed the channels.
 Revision 1.44 of emu10k1.c, which added Audigy support, has the line

 emu_wrptr(sc, v->vnum, FXRT, 0xd01c0000);

 replaced with the following lines:

 if (sc->audigy) {
         emu_wrptr(sc, v->vnum, A_FXRT1, v->fxrt1);
         emu_wrptr(sc, v->vnum, A_FXRT2, v->fxrt2);
         emu_wrptr(sc, v->vnum, A_SENDAMOUNTS, 0);
 }
 else
         emu_wrptr(sc, v->vnum, FXRT, v->fxrt1 << 16);

 where v->fxrt1 << 16 == 0xd10c0000

 I don't have Audigy, so I'm not sure if the problem affects Audigy cards
 too. The order of the channels can't be tested by just altering mixer
 settings. Here's a small program to test if the channels are reversed on
 your sound card:

 #include <sys/soundcard.h>
 #include <fcntl.h>
 #include <unistd.h>

 int main(int argc, char **argv)
 {
 	int fd = open("/dev/dsp", O_WRONLY), format = AFMT_S16_LE;
   int channels = 2, rate = 22050, i;

   /* 450 Hz sine wave on left channel, right channel silent */
   unsigned char samples[] = {0, 0, 0, 0, 94, 16, 0, 0, 120, 32, 0, 0,
     9, 48, 0, 0, 208, 62, 0, 0, 143, 76, 0, 0, 12, 89, 0, 0, 19, 100,
     0, 0, 117, 109, 0, 0, 11, 117, 0, 0, 182, 122, 0, 0, 92, 126, 0,
     0, 239, 127, 0, 0, 105, 127, 0, 0, 202, 124, 0, 0, 32, 120, 0, 0,
     124, 113, 0, 0, 251, 104, 0, 0, 193, 94, 0, 0, 249, 82, 0, 0,
     212, 69, 0, 0, 138, 55, 0, 0, 85, 40, 0, 0, 120, 24, 0, 0, 51, 8,
     0, 0, 205, 247, 0, 0, 136, 231, 0, 0, 171, 215, 0, 0, 118, 200,
     0, 0, 44, 186, 0, 0, 7, 173, 0, 0, 63, 161, 0, 0, 5, 151, 0, 0,
     132, 142, 0, 0, 224, 135, 0, 0, 54, 131, 0, 0, 151, 128, 0, 0,
     17, 128, 0, 0, 164, 129, 0, 0, 74, 133, 0, 0, 245, 138, 0, 0,
     139, 146, 0, 0, 237, 155, 0, 0, 244, 166, 0, 0, 113, 179, 0, 0,
     48, 193, 0, 0, 247, 207, 0, 0, 136, 223, 0, 0, 162, 239, 0, 0};

   ioctl(fd, SNDCTL_DSP_SETFMT,&format);
   ioctl(fd, SNDCTL_DSP_CHANNELS,&channels);
   ioctl(fd, SNDCTL_DSP_SPEED,&rate);

   for(i=0;i<500;i++)
     write(fd, &samples, sizeof(samples));
   write(fd, &samples, 2); /* swap channels */
   for(i=0;i<500;i++)
     write(fd, &samples, sizeof(samples));

   return 0;
 }

 You should hear a sound on the left channel followed by a sound on the
 right channel. If you hear a sound on the right channel first, the
 channels are reversed.
---snip---

Owners of an audigy card should verify if it DTRT and report back.

Noticed by:	Matthias Buelow <mkb@mukappabeta.de>
Submitted by:	Juha-Matti Tilli <juhis@nallukka.net>
PR:		72221
2005-12-28 17:57:36 +00:00
..
als4000.c Fix recording device selection based on ALS4000 datasheet. 2005-11-07 09:26:17 +00:00
als4000.h
atiixp.c Add suspend and resume support. 2005-12-25 00:43:03 +00:00
atiixp.h Support for ATI IXP 200 / 300 / 400 series audio controllers. 2005-11-27 03:29:59 +00:00
au88x0.c Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
au88x0.h
aureal.c Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
aureal.h
cmi.c This driver is already MPSAFE, remove busdma_lock_mutex and Giant from 2005-07-31 12:38:22 +00:00
cmireg.h
cs4281.c Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
cs4281.h
csa.c Fix -Wundef from compiling the amd64 LINT. 2005-12-04 10:06:06 +00:00
csapcm.c Power up the external amplifiers additionally to powering up the DAC and ADC. 2005-09-11 14:15:05 +00:00
csareg.h Implement suspend/resume operation for snd_csa(4) 2005-06-27 07:43:57 +00:00
csavar.h Implement suspend/resume operation for snd_csa(4) 2005-06-27 07:43:57 +00:00
ds1-fw.h
ds1.c Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
ds1.h
emu10k1.c Fix the order of the stereo channels (left <-> right). 2005-12-28 17:57:36 +00:00
es137x.c Use both (enabled by default) DAC1 and DAC2 to provide 2 2005-11-14 18:17:31 +00:00
es137x.h * Register programming error during device initialization 2005-07-31 13:19:38 +00:00
fm801.c Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
ich.c Add a hack to ignore PCR bit for 6300ESB, 82801[D-G]B chips. It seems 2005-11-21 03:37:43 +00:00
ich.h
maestro3.c Unlock driver lock before calling resource_int_value(9). 2005-09-13 10:12:28 +00:00
maestro_reg.h
maestro.c Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
neomagic-coeff.h
neomagic.c Fix hang at init for MagicMedia 256A[VX] chips. [1] 2005-09-11 17:30:27 +00:00
neomagic.h
solo.c Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
t4dwave.c Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
t4dwave.h
via82c686.c - Locking improvements. 2005-10-05 20:05:52 +00:00
via82c686.h
via8233.c Fix a long standing unhandled interrupt bug which can cause 2005-11-14 18:18:52 +00:00
via8233.h
vibes.c Use BUS_PROBE_DEFAULT in preference to 0 and BUS_PROBE_LOW_PRIORITY in 2005-03-01 08:58:06 +00:00
vibes.h