summaryrefslogtreecommitdiffstats
path: root/sys/dev/sound/isa/sb8.c
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>1999-11-13 18:31:31 +0000
committerdfr <dfr@FreeBSD.org>1999-11-13 18:31:31 +0000
commitc1a649a08b622f47d4695ce4ebb2a4e61d8d0a97 (patch)
tree26b721cc998033446b39607f9db15d553a430f63 /sys/dev/sound/isa/sb8.c
parentaa69617b79d139b2f6dd59ca158cc65893d3bfa7 (diff)
downloadFreeBSD-src-c1a649a08b622f47d4695ce4ebb2a4e61d8d0a97.zip
FreeBSD-src-c1a649a08b622f47d4695ce4ebb2a4e61d8d0a97.tar.gz
* Ignore the wierd fakechan workarounds for simplex in dsp_ioctl().
Without this, ioctl commands for setting formats and speeds were essentially ignored for simplex devices until the application actually performed a read or write. * Make sure that both channels are set in the SB mixer code and provide a mixer table specifically for the ess18xx which supports the extended accuracy available on this part. * Fix a stupid bug in ess_format() which ignored the passed-in format and changed the hardware based on the value which was set last time. This meant that the hardware setting was often not set correctly at all. * Add a custom identify driver for the ESS1888 which automagically detects and adds the device in a pseudo-PnP way. This driver also emits the magic sequence which enables the sound hardware after a hard reset, allowing it to work correctly for the sound hardware of a PWS 433au (and probably all other PWS class alpha machines). With these changes, I was able to play back simple sounds on my 433au. I have not tested recording or any other formats other than 8bit ulaw and 16bit stereo.
Diffstat (limited to 'sys/dev/sound/isa/sb8.c')
-rw-r--r--sys/dev/sound/isa/sb8.c44
1 files changed, 28 insertions, 16 deletions
diff --git a/sys/dev/sound/isa/sb8.c b/sys/dev/sound/isa/sb8.c
index 5123d40..ed1eefe 100644
--- a/sys/dev/sound/isa/sb8.c
+++ b/sys/dev/sound/isa/sb8.c
@@ -881,8 +881,8 @@ ess_format(struct sb_chinfo *ch, u_int32_t format)
{
struct sb_info *sb = ch->parent;
int play = (ch->dir == PCMDIR_PLAY)? 1 : 0;
- int b16 = (ch->fmt & AFMT_S16_LE)? 1 : 0;
- int stereo = (ch->fmt & AFMT_STEREO)? 1 : 0;
+ int b16 = (format & AFMT_S16_LE)? 1 : 0;
+ int stereo = (format & AFMT_STEREO)? 1 : 0;
u_char c;
ch->fmt = format;
sb_reset_dsp(sb);
@@ -913,7 +913,7 @@ ess_speed(struct sb_chinfo *ch, int speed)
if (speed > 22000) {
t = (795500 + speed / 2) / speed;
speed = (795500 + t / 2) / t;
- t = (256 - t ) | 0x80;
+ t = (256 - t ) | 0x80;
} else {
t = (397700 + speed / 2) / speed;
speed = (397700 + t / 2) / t;
@@ -1175,7 +1175,10 @@ sbmix_set(snd_mixer *m, unsigned dev, unsigned left, unsigned right)
switch (sb->bd_flags & BD_F_MIX_MASK) {
case BD_F_MIX_CT1345:
- iomap = &sbpro_mix;
+ if (sb->bd_flags & BD_F_ESS)
+ iomap = &ess_mix;
+ else
+ iomap = &sbpro_mix;
break;
case BD_F_MIX_CT1745:
@@ -1186,19 +1189,24 @@ sbmix_set(snd_mixer *m, unsigned dev, unsigned left, unsigned right)
return -1;
/* XXX how about the SG NX Pro, iomap = sgnxpro_mix */
}
+
+ /* Change left channel */
regoffs = (*iomap)[dev][LEFT_CHN].regno;
- if (regoffs == 0) return -1;
- val = sb_getmixer(sb, regoffs);
- change_bits(iomap, &val, dev, LEFT_CHN, left);
- sb_setmixer(sb, regoffs, val);
- if ((*iomap)[dev][RIGHT_CHN].regno != regoffs) { /* Change register */
- regoffs = (*iomap)[dev][RIGHT_CHN].regno;
- if (regoffs != 0) {
- val = sb_getmixer(sb, regoffs); /* Read the new one */
- change_bits(iomap, &val, dev, RIGHT_CHN, right);
- sb_setmixer(sb, regoffs, val);
- } else right = left;
- } else right = left;
+ if (regoffs != 0) {
+ val = sb_getmixer(sb, regoffs);
+ change_bits(iomap, &val, dev, LEFT_CHN, left);
+ sb_setmixer(sb, regoffs, val);
+ }
+
+ /* Change right channel */
+ regoffs = (*iomap)[dev][RIGHT_CHN].regno;
+ if (regoffs != 0) {
+ val = sb_getmixer(sb, regoffs); /* Read the new one */
+ change_bits(iomap, &val, dev, RIGHT_CHN, right);
+ sb_setmixer(sb, regoffs, val);
+ } else
+ right = left;
+
return left | (right << 8);
}
@@ -1284,6 +1292,10 @@ sbpnp_probe(device_t dev)
case 0x69187316: /* ESS1869 */
s = "ESS1869";
break;
+
+ case 0x88187316: /* ESS1888 */
+ s = "ESS1888";
+ break;
}
if (s) {
device_set_desc(dev, s);
OpenPOWER on IntegriCloud