[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Sound mixer on 8500 fails to select line-in [+ bugfix(s)]



I find that 'line-in' works under MacOS 8.5 but not under LINUX (behn 
kernel rsync'ed benh a few days ago).  No luck trying to get 'line-in' 
to work, in spite of studying the code well enough to come up with at
least one bug fix and a suggested change in another case (see below).  
Here are the driver related startup messages:

    Linux version 2.4.19-pre8-ben0 (tvr@g3) (gcc version 2.95.4 20011002 (Debian prerelease)) #28 Mon May 27 11:09:31 PDT 2002
	...
    dmasound_pmac: Awacs/Screamer Codec Mfct: 1 Rev 2
    PowerMac AWACS rev 2  DMA sound driver rev 016 installed
    Core driver edition 01.06 : PowerMac Built-in Sound driver edition 00.07
    Write will use    4 fragments of   32768 bytes as default
    Read  will use    4 fragments of   32768 bytes as default

In spite of what the message suggests, this is just an AWACS, not a
'Screamer'.  Hacking around various 'unused' bits in the AWACS chip 
didn't seem to change anything (as i wasn't able to find any kind of
documentation of the relevant hardware on the Apple WWW site).  So
i'm looking for ideas on how to fix this.  Anyone been here before?

				-- Tovar

P.S. 'Mic in' has vastly too much gain for this application and i want 
that channel for other purposes in any case.

Attachment:  'diff' and notes for driver/sound/dmasound/dmasound_awacs.c
-------------------------------------------------------------------------------
*** dmasound_awacs.c.orig	Sun May 12 14:49:30 2002
--- dmasound_awacs.c	Mon May 27 11:09:23 2002
***************
*** 793,805 ****
  {
  	int r1, rn;
  
  	if (mute && volume == 0) {
  		r1 = awacs_reg[1] | mute;
  	} else {
  		r1 = awacs_reg[1] & ~mute;
! 		rn = awacs_reg[n] & ~(0xf | (0xf << lshift));
! 		rn |= ((AWACS_VOLUME_TO_MASK(volume & 0xff) & 0xf) << lshift);
! 		rn |= AWACS_VOLUME_TO_MASK((volume >> 8) & 0xff) & 0xf;
  		awacs_reg[n] = rn;
  		awacs_write((n << 12) | rn);
  		volume = awacs_get_volume(rn, lshift);
--- 793,807 ----
  {
  	int r1, rn;
  
+ 	int mask = (1<<lshift)-1;
+ 
  	if (mute && volume == 0) {
  		r1 = awacs_reg[1] | mute;
  	} else {
  		r1 = awacs_reg[1] & ~mute;
! 		rn = awacs_reg[n] & ~(mask | (mask << lshift));
! 		rn |= ((AWACS_VOLUME_TO_MASK(volume & 0xff) & mask) << lshift);
! 		rn |= AWACS_VOLUME_TO_MASK((volume >> 8) & 0xff) & mask;
  		awacs_reg[n] = rn;
  		awacs_write((n << 12) | rn);
  		volume = awacs_get_volume(rn, lshift);
***************
*** 1798,1804 ****
  	case SOUND_MIXER_WRITE_VOLUME:
  		IOCTL_IN(arg, data);
  		line_vol = data ;
! 		awacs_volume_setter(data, 2, 0, 6);
  		/* fall through */
  	case SOUND_MIXER_READ_VOLUME:
  		rc = IOCTL_OUT(arg, line_vol);
--- 1809,1815 ----
  	case SOUND_MIXER_WRITE_VOLUME:
  		IOCTL_IN(arg, data);
  		line_vol = data ;
! 		awacs_volume_setter(data, 2, MASK_AMUTE, 6);
  		/* fall through */
  	case SOUND_MIXER_READ_VOLUME:
  		rc = IOCTL_OUT(arg, line_vol);
-------------------------------------------------------------------------------
(1) awacs_volume_setter() uses a fixed mask but takes a left-right channel
shift amount as an argument.  This looks like it'd be using a four bit mask
with six bit fields.  The suggested change derives the mask as runtime.
(2) 'Headphone' audio is not turned off for volume of zero on AWACS.  The
bugfix Forces it off using mute as is done for other audio ports.
===============================================================================


-- 
To UNSUBSCRIBE, email to debian-powerpc-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: