| Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | ======================================================= | 
|  | 2 | Documentation for the NeoMagic 256AV/256ZX sound driver | 
|  | 3 | ======================================================= | 
|  | 4 |  | 
|  | 5 | You're looking at version 1.1 of the driver.  (Woohoo!) It has been | 
|  | 6 | successfully tested against the following laptop models: | 
|  | 7 |  | 
|  | 8 | Sony Z505S/Z505SX/Z505DX/Z505RX | 
|  | 9 | Sony F150, F160, F180, F250, F270, F280, PCG-F26 | 
|  | 10 | Dell Latitude CPi, CPt (various submodels) | 
|  | 11 |  | 
|  | 12 | There are a few caveats, which is why you should read the entirety of | 
|  | 13 | this document first. | 
|  | 14 |  | 
|  | 15 | This driver was developed without any support or assistance from | 
|  | 16 | NeoMagic.  There is no warranty, expressed, implied, or otherwise.  It | 
|  | 17 | is free software in the public domain; feel free to use it, sell it, | 
|  | 18 | give it to your best friends, even claim that you wrote it (but why?!) | 
|  | 19 | but don't go whining to me, NeoMagic, Sony, Dell, or anyone else | 
|  | 20 | when it blows up your computer. | 
|  | 21 |  | 
|  | 22 | Version 1.1 contains a change to try and detect non-AC97 versions of | 
|  | 23 | the hardware, and not install itself appropriately.  It should also | 
|  | 24 | reinitialize the hardware on an APM resume event, assuming that APM | 
|  | 25 | was configured into your kernel. | 
|  | 26 |  | 
|  | 27 | ============ | 
|  | 28 | Installation | 
|  | 29 | ============ | 
|  | 30 |  | 
|  | 31 | Enable the sound drivers, the OSS sound drivers, and then the NM256 | 
|  | 32 | driver.  The NM256 driver *must* be configured as a module (it won't | 
|  | 33 | give you any other choice). | 
|  | 34 |  | 
|  | 35 | Next, do the usual "make modules" and "make modules_install". | 
|  | 36 | Finally, insmod the soundcore, sound and nm256 modules. | 
|  | 37 |  | 
|  | 38 | When the nm256 driver module is loaded, you should see a couple of | 
|  | 39 | confirmation messages in the kernel logfile indicating that it found | 
|  | 40 | the device (the device does *not* use any I/O ports or DMA channels). | 
|  | 41 | Now try playing a wav file, futz with the CD-ROM if you have one, etc. | 
|  | 42 |  | 
|  | 43 | The NM256 is entirely a PCI-based device, and all the necessary | 
|  | 44 | information is automatically obtained from the card.  It can only be | 
|  | 45 | configured as a module in a vain attempt to prevent people from | 
|  | 46 | hurting themselves.  It works correctly if it shares an IRQ with | 
|  | 47 | another device (it normally shares IRQ 9 with the builtin eepro100 | 
|  | 48 | ethernet on the Sony Z505 laptops). | 
|  | 49 |  | 
|  | 50 | It does not run the card in any sort of compatibility mode. It will | 
|  | 51 | not work on laptops that have the SB16-compatible, AD1848-compatible | 
|  | 52 | or CS4232-compatible codec/mixer; you will want to use the appropriate | 
|  | 53 | compatible OSS driver with these chipsets.  I cannot provide any | 
|  | 54 | assistance with machines using the SB16, AD1848 or CS4232 compatible | 
|  | 55 | versions.  (The driver now attempts to detect the mixer version, and | 
|  | 56 | will refuse to load if it believes the hardware is not | 
|  | 57 | AC97-compatible.) | 
|  | 58 |  | 
|  | 59 | The sound support is very basic, but it does include simultaneous | 
|  | 60 | playback and record capability.  The mixer support is also quite | 
|  | 61 | simple, although this is in keeping with the rather limited | 
|  | 62 | functionality of the chipset. | 
|  | 63 |  | 
|  | 64 | There is no hardware synthesizer available, as the Losedows OPL-3 and | 
|  | 65 | MIDI support is done via hardware emulation. | 
|  | 66 |  | 
|  | 67 | Only three recording devices are available on the Sony: the | 
|  | 68 | microphone, the CD-ROM input, and the volume device (which corresponds | 
|  | 69 | to the stereo output).  (Other devices may be available on other | 
|  | 70 | models of laptops.)  The Z505 series does not have a builtin CD-ROM, | 
|  | 71 | so of course the CD-ROM input doesn't work.  It does work on laptops | 
|  | 72 | with a builtin CD-ROM drive. | 
|  | 73 |  | 
|  | 74 | The mixer device does not appear to have any tone controls, at least | 
|  | 75 | on the Z505 series.  The mixer module checks for tone controls in the | 
|  | 76 | AC97 mixer, and will enable them if they are available. | 
|  | 77 |  | 
|  | 78 | ============== | 
|  | 79 | Known problems | 
|  | 80 | ============== | 
|  | 81 |  | 
|  | 82 | * There are known problems with PCMCIA cards and the eepro100 ethernet | 
|  | 83 | driver on the Z505S/Z505SX/Z505DX.  Keep reading. | 
|  | 84 |  | 
|  | 85 | * There are also potential problems with using a virtual X display, and | 
|  | 86 | also problems loading the module after the X server has been started. | 
|  | 87 | Keep reading. | 
|  | 88 |  | 
|  | 89 | * The volume control isn't anywhere near linear.  Sorry.  This will be | 
|  | 90 | fixed eventually, when I get sufficiently annoyed with it.  (I doubt | 
|  | 91 | it will ever be fixed now, since I've never gotten sufficiently | 
|  | 92 | annoyed with it and nobody else seems to care.) | 
|  | 93 |  | 
|  | 94 | * There are reports that the CD-ROM volume is very low.  Since I do not | 
|  | 95 | have a CD-ROM equipped laptop, I cannot test this (it's kinda hard to | 
|  | 96 | do remotely). | 
|  | 97 |  | 
|  | 98 | * Only 8 fixed-rate speeds are supported.  This is mainly a chipset | 
|  | 99 | limitation.  It may be possible to support other speeds in the future. | 
|  | 100 |  | 
|  | 101 | * There is no support for the telephone mixer/codec.  There is support | 
|  | 102 | for a phonein/phoneout device in the mixer driver;  whether or not | 
|  | 103 | it does anything is anyone's guess.  (Reports on this would be | 
|  | 104 | appreciated.  You'll have to figure out how to get the phone to | 
|  | 105 | go off-hook before it'll work, tho.) | 
|  | 106 |  | 
|  | 107 | * This driver was not written with any cooperation or support from | 
|  | 108 | NeoMagic.  If you have any questions about this, see their website | 
|  | 109 | for their official stance on supporting open source drivers. | 
|  | 110 |  | 
|  | 111 | ============ | 
|  | 112 | Video memory | 
|  | 113 | ============ | 
|  | 114 |  | 
|  | 115 | The NeoMagic sound engine uses a portion of the display memory to hold | 
|  | 116 | the sound buffer.  (Crazy, eh?)  The NeoMagic video BIOS sets up a | 
|  | 117 | special pointer at the top of video RAM to indicate where the top of | 
|  | 118 | the audio buffer should be placed. | 
|  | 119 |  | 
|  | 120 | At the present time XFree86 is apparently not aware of this.  It will | 
|  | 121 | thus write over either the pointer or the sound buffer with abandon. | 
|  | 122 | (Accelerated-X seems to do a better job here.) | 
|  | 123 |  | 
|  | 124 | This implies a few things: | 
|  | 125 |  | 
|  | 126 | * Sometimes the NM256 driver has to guess at where the buffer | 
|  | 127 | should be placed, especially if the module is loaded after the | 
|  | 128 | X server is started.  It's usually correct, but it will consistently | 
|  | 129 | fail on the Sony F250. | 
|  | 130 |  | 
|  | 131 | * Virtual screens greater than 1024x768x16 under XFree86 are | 
|  | 132 | problematic on laptops with only 2.5MB of screen RAM. This | 
|  | 133 | includes all of the 256AV-equipped laptops.  (Virtual displays | 
|  | 134 | may or may not work on the 256ZX, which has at least 4MB of | 
|  | 135 | video RAM.) | 
|  | 136 |  | 
|  | 137 | If you start having problems with random noise being output either | 
|  | 138 | constantly (this is the usual symptom on the F250), or when windows | 
|  | 139 | are moved around (this is the usual symptom when using a virtual | 
|  | 140 | screen), the best fix is to | 
|  | 141 |  | 
|  | 142 | * Don't use a virtual frame buffer. | 
|  | 143 | * Make sure you load the NM256 module before the X server is | 
|  | 144 | started. | 
|  | 145 |  | 
|  | 146 | On the F250, it is possible to force the driver to load properly even | 
|  | 147 | after the XFree86 server is started by doing: | 
|  | 148 |  | 
|  | 149 | insmod nm256 buffertop=0x25a800 | 
|  | 150 |  | 
|  | 151 | This forces the audio buffers to the correct offset in screen RAM. | 
|  | 152 |  | 
|  | 153 | One user has reported a similar problem on the Sony F270, although | 
|  | 154 | others apparently aren't seeing any problems.  His suggested command | 
|  | 155 | is | 
|  | 156 |  | 
|  | 157 | insmod nm256 buffertop=0x272800 | 
|  | 158 |  | 
|  | 159 | ================= | 
|  | 160 | Official WWW site | 
|  | 161 | ================= | 
|  | 162 |  | 
|  | 163 | The official site for the NM256 driver is: | 
|  | 164 |  | 
|  | 165 | http://www.uglx.org/sony.html | 
|  | 166 |  | 
|  | 167 | You should always be able to get the latest version of the driver there, | 
|  | 168 | and the driver will be supported for the foreseeable future. | 
|  | 169 |  | 
|  | 170 | ============== | 
|  | 171 | Z505RX and IDE | 
|  | 172 | ============== | 
|  | 173 |  | 
|  | 174 | There appears to be a problem with the IDE chipset on the Z505RX; one | 
|  | 175 | of the symptoms is that sound playback periodically hangs (when the | 
|  | 176 | disk is accessed).  The user reporting the problem also reported that | 
|  | 177 | enabling all of the IDE chipset workarounds in the kernel solved the | 
|  | 178 | problem, tho obviously only one of them should be needed--if someone | 
|  | 179 | can give me more details I would appreciate it. | 
|  | 180 |  | 
|  | 181 | ============================== | 
|  | 182 | Z505S/Z505SX on-board Ethernet | 
|  | 183 | ============================== | 
|  | 184 |  | 
|  | 185 | If you're using the on-board Ethernet Pro/100 ethernet support on the Z505 | 
|  | 186 | series, I strongly encourage you to download the latest eepro100 driver from | 
|  | 187 | Donald Becker's site: | 
|  | 188 |  | 
|  | 189 | ftp://cesdis.gsfc.nasa.gov/pub/linux/drivers/test/eepro100.c | 
|  | 190 |  | 
|  | 191 | There was a reported problem on the Z505SX that if the ethernet | 
|  | 192 | interface is disabled and reenabled while the sound driver is loaded, | 
|  | 193 | the machine would lock up.  I have included a workaround that is | 
|  | 194 | working satisfactorily.  However, you may occasionally see a message | 
|  | 195 | about "Releasing interrupts, over 1000 bad interrupts" which indicates | 
|  | 196 | that the workaround is doing its job. | 
|  | 197 |  | 
|  | 198 | ================================== | 
|  | 199 | PCMCIA and the Z505S/Z505SX/Z505DX | 
|  | 200 | ================================== | 
|  | 201 |  | 
|  | 202 | There is also a known problem with the Sony Z505S and Z505SX hanging | 
|  | 203 | if a PCMCIA card is inserted while the ethernet driver is loaded, or | 
|  | 204 | in some cases if the laptop is suspended.  This is caused by tons of | 
|  | 205 | spurious IRQ 9s, probably generated from the PCMCIA or ACPI bridges. | 
|  | 206 |  | 
|  | 207 | There is currently no fix for the problem that works in every case. | 
|  | 208 | The only known workarounds are to disable the ethernet interface | 
|  | 209 | before inserting or removing a PCMCIA card, or with some cards | 
|  | 210 | disabling the PCMCIA card before ejecting it will also help the | 
|  | 211 | problem with the laptop hanging when the card is ejected. | 
|  | 212 |  | 
|  | 213 | One user has reported that setting the tcic's cs_irq to some value | 
|  | 214 | other than 9 (like 11) fixed the problem.  This doesn't work on my | 
|  | 215 | Z505S, however--changing the value causes the cardmgr to stop seeing | 
|  | 216 | card insertions and removals, cards don't seem to work correctly, and | 
|  | 217 | I still get hangs if a card is inserted when the kernel is booted. | 
|  | 218 |  | 
|  | 219 | Using the latest ethernet driver and pcmcia package allows me to | 
|  | 220 | insert an Adaptec 1480A SlimScsi card without the laptop hanging, | 
|  | 221 | although I still have to shut down the card before ejecting or | 
|  | 222 | powering down the laptop.  However, similar experiments with a DE-660 | 
|  | 223 | ethernet card still result in hangs when the card is inserted.  I am | 
|  | 224 | beginning to think that the interrupts are CardBus-related, since the | 
|  | 225 | Adaptec card is a CardBus card, and the DE-660 is not; however, I | 
|  | 226 | don't have any other CardBus cards to test with. | 
|  | 227 |  | 
|  | 228 | ====== | 
|  | 229 | Thanks | 
|  | 230 | ====== | 
|  | 231 |  | 
|  | 232 | First, I want to thank everyone (except NeoMagic of course) for their | 
|  | 233 | generous support and encouragement.  I'd like to list everyone's name | 
|  | 234 | here that replied during the development phase, but the list is | 
|  | 235 | amazingly long. | 
|  | 236 |  | 
|  | 237 | I will be rather unfair and single out a few people, however: | 
|  | 238 |  | 
|  | 239 | Justin Maurer, for being the first random net.person to try it, | 
|  | 240 | and for letting me login to his Z505SX to get it working there | 
|  | 241 |  | 
|  | 242 | Edi Weitz for trying out several different versions, and giving | 
|  | 243 | me a lot of useful feedback | 
|  | 244 |  | 
|  | 245 | Greg Rumple for letting me login remotely to get the driver | 
|  | 246 | functional on the 256ZX, for his assistance on tracking | 
|  | 247 | down all sorts of random stuff, and for trying out Accel-X | 
|  | 248 |  | 
|  | 249 | Zach Brown, for the initial AC97 mixer interface design | 
|  | 250 |  | 
|  | 251 | Jeff Garzik, for various helpful suggestions on the AC97 | 
|  | 252 | interface | 
|  | 253 |  | 
|  | 254 | "Mr. Bumpy" for feedback on the Z505RX | 
|  | 255 |  | 
|  | 256 | Bill Nottingham, for generous assistance in getting the mixer ID | 
|  | 257 | code working | 
|  | 258 |  | 
|  | 259 | ================= | 
|  | 260 | Previous versions | 
|  | 261 | ================= | 
|  | 262 |  | 
|  | 263 | Versions prior to 0.3 (aka `noname') had problems with weird artifacts | 
|  | 264 | in the output and failed to set the recording rate properly.  These | 
|  | 265 | problems have long since been fixed. | 
|  | 266 |  | 
|  | 267 | Versions prior to 0.5 had problems with clicks in the output when | 
|  | 268 | anything other than 16-bit stereo sound was being played, and also had | 
|  | 269 | periodic clicks when recording. | 
|  | 270 |  | 
|  | 271 | Version 0.7 first incorporated support for the NM256ZX chipset, which | 
|  | 272 | is found on some Dell Latitude laptops (the CPt, and apparently | 
|  | 273 | some CPi models as well).  It also included the generic AC97 | 
|  | 274 | mixer module. | 
|  | 275 |  | 
|  | 276 | Version 0.75 renamed all the functions and files with slightly more | 
|  | 277 | generic names. | 
|  | 278 |  | 
|  | 279 | Note that previous versions of this document claimed that recording was | 
|  | 280 | 8-bit only; it actually has been working for 16-bits all along. |