ALSA fix for legacy sound cards in Puppy 2x

How to do things, solutions, recipes, tutorials
Post Reply
Message
Author
tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

ALSA fix for legacy sound cards in Puppy 2x

#1 Post by tempestuous »

Usually in Linux, older ISA-based sound cards are not automatically detected at boot. So those of use with these sound cards know that we have to run "alsaconf" to set up the ALSA driver. The correct ALSA module is then configured to load with particular dma settings, and sometimes these dma settings do not agree with those defined in BIOS. Sometimes ALSA simply won't work with "standard" dma settings.

If you have an ISA sound card that requires such a "non-standard" ALSA dma configuration, then you will have a problem with Puppy2.
Puppy2's 2.6.16 kernel has "improved" ISAPNP routines(!!) which will disallow driver settings that don't agree with what it thinks is correct. The new PNP stuff can be found in /sys/devices/pnp0/
There are many directories here which earlier kernels did not have.

After much trial-and-error, my solution was to "coax" the ALSA module into accepting the standard dma values, like this:
First load the ALSA module (mine is snd-es18xx) with ONLY the dma1 setting.
Then after a brief pause, load the module again with both dma1 AND dma2 settings.
(My Sony VAIO's BIOS assigns dma1=1 dma2=5 for its ESS ES1879 sound chip)

Code: Select all

## first load the core ALSA module
modprobe snd
## specify ONLY dma1 value
modprobe snd-es18xx isapnp=0 irq=5 dma1=1
sleep 1
## now specify both dma1 AND dma2 values
modprobe snd-es18xx isapnp=0 irq=5 dma1=1 dma2=5
Do this from /etc/rc.d/rc.local at each boot.
Don't run "alsaconf or Puppy's "ALSA sound Wizard".

User avatar
willhunt
Posts: 495
Joined: Wed 05 Oct 2005, 18:19

Thanks :)

#2 Post by willhunt »

I have been having same problem with snd-intel8x0
I changed the irq to 7 shazam! :D
I cut and pasted it to /ect/rc.d/rc.local and I back in biz
thanks again

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#3 Post by tempestuous »

That's good to hear, but you have come up with a similar solution to a different problem.

1. Intel 8x0 AC97-based sound chips are not legacy ISA devices. They're PCI devices, which have always been auto detected in Linux quite well.

2. The ALSA snd-intel8x0 driver will not accept "irq" or "dma" as parameters. I think this is the same for all ALSA PCI drivers.

It sounds like you changed your settings in hardware (BIOS) so that the operating system and ALSA driver were more "happy".

There is another possible fix for you; the snd-intel8x0 module has the parameter "buggy_irq", 0=disable 1=enable. You could try putting your hardware irq setting back to normal, then load the module like this -
modprobe snd-intel8x0 buggy_irq=1

I should have mentioned in my first post that I also tried to change my dma2 setting in BIOS, thus changing the "standard" settings. But whatever I changed it to, alsaconf wanted to choose something different.
The only solution was to coax/force the ALSA driver to accept the correct dma values.

User avatar
willhunt
Posts: 495
Joined: Wed 05 Oct 2005, 18:19

well

#4 Post by willhunt »

my sound chip is a C-Media but worked with the intel sound driver but when I updated to pup 2.0 it found no sound driver this worked to restore my sound

nicom
Posts: 34
Joined: Mon 06 Feb 2006, 02:15
Location: Melbourne, Australia

#5 Post by nicom »

Tempetuous

This sounds just what I'm after, but I have a couple of questions.

I run Puppy 2.01 on an old machine (P133,32MB) by a hard disk installation. I have tried to get my sound blaster pro compatable card working using the ALSA wizard without success.

Can I now just use your method to detect my card, or do I need get rid of the sound card configuration that the wizard came up with and tries to execute whenever I boot?

If I need to go back to scratch with no card configuration, can I do it without a full reinstall?

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#6 Post by tempestuous »

Both alsaconf and the ALSA sound Wizard will add their sound configuration details to the end of /etc/modprobe.conf
All you need to do is open this file in a text editor and delete (or comment out) those last lines -

alias snd-card-0 ...
alias sound-slot-0 ...

(I also see the "sb" module listed at line 142, but don't worry, that's the old OSS driver, which has been removed from Puppy2.)

Now reboot and you should have no ALSA modules loaded. Check with "lsmod". Now you can try my 2-stage module loading method from the commandline before committing your commands to /etc/rc.d/rc.local
If it works, please report the commands you used. It may help others.

nicom
Posts: 34
Joined: Mon 06 Feb 2006, 02:15
Location: Melbourne, Australia

#7 Post by nicom »

Success!

I did however need to go to a three step approach.

Firstly my sound card chip is an ALS100 which I notice is included in /lib/modules/2.6.16.7/sound/isa directory. I can get the card going in windows98 and looking at the hardware profile it tells me that IRQ=5, dma=1 and dma=3.

Code: Select all

modprobe snd
modprobe snd-als100
modprobe snd-als100 isapnp=0 irq=5 dma1=1
modprobe snd-als100 isapnp=0 irq=5 dma1=1 dma2=3
If I try to do it in 2 steps as per your instructions I get a fatal error.

So far I have only done it from the console. I assume I should put the "sleep 1" command between my steps.

Thanks for your help.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#8 Post by tempestuous »

Well done.
But in the interests of good science (versus good luck) it would be worth checking a little further - different modules have different parameters. The parameters for my snd-es18xx module are not the same as yours. Run "modinfo snd-als100" to see what your available parameters are.
"isapnp" is not available. And for you, "dma1" should be "dma8" and "dma2" should be "dma16".
I suggest you first try to do everything in one hit -

Code: Select all

modprobe snd
modprobe snd-als100 irq=5 dma8=1 dma16=3
If no success, now try one dma value at a time.
Regarding sleep placement and duration - trial and error, I'm afraid.

User avatar
willhunt
Posts: 495
Joined: Wed 05 Oct 2005, 18:19

it it helps

#9 Post by willhunt »

I sell surplus computer so I allways have a bunch of different boxs to try it on

nicom
Posts: 34
Joined: Mon 06 Feb 2006, 02:15
Location: Melbourne, Australia

#10 Post by nicom »

You were right. When I run modinfo-ALS100 it refers to both dma8 and dma16. With the correct reference I was able to install the driver in a single step as you suggest.

Is there any way of finding out what values to insert in the two "dma=" statements other than running windows as I did?

nicom
Posts: 34
Joined: Mon 06 Feb 2006, 02:15
Location: Melbourne, Australia

#11 Post by nicom »

Oops! I meant "modinfo snd-ALS100" in my previous post.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#12 Post by tempestuous »

nicom wrote:Is there any way of finding out what values to insert in the two "dma=" statements other than running windows as I did?
Those dma and irq settings should be listed in your bios.

Since your setup is now quite conventional, you don't need to load the ALSA drivers from /etc/rc.d/rc.local
Add this to the end of /etc/modprobe.conf -

alias snd-card-0 snd-als100
alias sound-slot-0 snd-als100
options snd-als100 irq=5 dma8=1 dma16=3

nicom
Posts: 34
Joined: Mon 06 Feb 2006, 02:15
Location: Melbourne, Australia

#13 Post by nicom »

Once again you are correct. I have modified the etc/modprobe.conf and now the sound card works on boot up (well as good as it's going to work on that machine).

I checked the bios and could not find any reference to dma and irq settings. I should point out it's a very old version, Award Modular BIOS v4.51PG. Any other suggestions.

Although I have my card working now, if I can understand it a bit better I will try to write an idiots guide to getting sounds card going.

Thanks for your help.

User avatar
zigbert
Posts: 6621
Joined: Wed 29 Mar 2006, 18:13
Location: Valåmoen, Norway
Contact:

#14 Post by zigbert »

...I will try to write an idiots guide to getting sounds card going.
nicom, I'm one of your idiots.

tempestuous
Posts: 5464
Joined: Fri 10 Jun 2005, 05:12
Location: Australia

#15 Post by tempestuous »

Sorry, the bios will only show audio settings for onboard ISA audio devices, typical with older laptops.

For separate ISA sound cards, the irq and dma settings are SOMETIMES determined by the sound card manufacturer and should be listed in the card's documentation. And it's possible that these settings can be changed by jumpers on the card.

But SOMETIMES, the irq and dma settings are determined by the motherboard, and can vary depending on which ISA slot the card is plugged into.

So to your original question ... how to find out? I think "pnpdump" is what you want ... but this utility is not included in Puppy2, so I attach it. gunzip it into /sbin
It will only work with ISA devices which are PnP (Plug-and-Play) compatible.
Attachments
pnpdump.gz
(16.33 KiB) Downloaded 2617 times

nicom
Posts: 34
Joined: Mon 06 Feb 2006, 02:15
Location: Melbourne, Australia

#16 Post by nicom »

I finally got around to working out how to use pnpdump. The results still leave me in confusion. The following is what I understand to the relevant bit.

Code: Select all

# Multiple choice time, choose one only !

#     Start dependent functions: priority preferred
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0220
#             IO base alignment 16 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0220) (CHECK))
#       IRQ 5.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 1.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed type F
# (DMA 0 (CHANNEL 1))
#       Next DMA channel 0 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed type F
# (DMA 1 (CHANNEL 0))

#       Start dependent functions: priority acceptable
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0220
#             Maximum IO base address 0x0280
#             IO base alignment 32 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0220) (CHECK))
#       IRQ 5, 7, 9, 10 or 11.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed type F
# (DMA 0 (CHANNEL 0))
#       Next DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed type F
# (DMA 1 (CHANNEL 0))

#       Start dependent functions: priority functional
#       Logical device decodes 16 bit IO address lines
#             Minimum IO base address 0x0100
#             Maximum IO base address 0x03f0
#             IO base alignment 16 bytes
#             Number of IO addresses required: 16
# (IO 0 (SIZE 16) (BASE 0x0100) (CHECK))
#       IRQ 5, 7, 9, 10 or 11.
#             High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
#       First DMA channel 0, 1 or 3.
#             8 bit DMA only
#             Logical device is a bus master
#             DMA may execute in count by byte mode
#             DMA may not execute in count by word mode
#             DMA channel speed type F
# (DMA 0 (CHANNEL 0))

#     End dependent functions
When I compare my results to the discussion I found at http://www.linux-sxs.org/upgrading/pnpdump I get nothing like it.

User avatar
Kaos' avatar
Posts: 8
Joined: Sat 04 Nov 2006, 18:28
Location: South Wales

Two sound cards

#17 Post by Kaos' avatar »

I'm one of the previously mentioned idiots. Sorry to go off on a side track, but i spotted something here that might help me. I have two working sound cards. For good but hard to explain reasons, I want to use the second one, not the one loaded first. I can use alsa wizard to switch, but I loose the change on restart.Did I miss something obvious? If I deleted the modprobe.conf entry for one of the cards, would that cause my computer to use only the other? This isn't realy relevant, I just thought the question might be something to answer in the idiots guide to Sound cards.

PS: Charge people for the guide, you'll make tonnes of money!

:!: :twisted: :!:

Nokes
Posts: 2
Joined: Tue 22 Jul 2008, 18:22

#18 Post by Nokes »

i've got a problem with my Yamaha opl3sa3 i di pretty much everything in the first post, and i still got nothing

it's an old Toshiba Satellite Pro 480cdt

EDIT: Nevermind i got it, wow this forum does help!

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#19 Post by mikeb »

Any tips for an isa card (AD1816a)that won't do isapnp but have all the settings but the newer alsa driver will not use them as it will only accept isapnp cards so gives a card not present error.. it is and the old oss driver is fine but that means going back to the 2.4.xx kernel.

mike

Post Reply