Plug-and-Play Hardware

How to make those pesky new PnP sound cards work and play well on your Linux box.
Enabling the Device at Bootup

Now that you have your PnP card working under Linux, wouldn't it be great if those devices were set up automatically at boot time? I added the above two lines to my /etc/rc.d/rc.local file, so that my sound driver is loaded each time I boot the system.

This example used what I view as the most common plug-and-play situation when using Linux—a sound card. Other PnP devices exist, such as modems and network cards. The same technique can be applied to those cards as well.

Resources

David Cantrell is a Computer Science undergraduate at the Georgia Institute of Technology. He has been using Linux since 1997. David spends a lot of time at his computer, but also enjoys visiting his favorite Mexican restaurant and midnight movies. He enjoys water skiing, backpacking and watching “The Simpsons”. He can be reached via e-mail at david@burdell.org.

______________________

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Hi, friend I appreciate your

Vajinder Dutt's picture

Hi, friend

I appreciate your contribution

I'm using Ubuntu Intrepid Ibex. Everything is good except sound. My sound card is Crystal CS 4235. I hear drum sound only at the login screen. There after no sound. Volume control carries a red mark when I click it it reads :"No volume control GStreamer plugins and/or devices found"
$aplay -l output is:
aplay: device_list:215: no soundcards found...

----------------------------------------------------------------------
My isapnp.conf file shows:

# $Id: pnpdump_main.c,v 1.27 2001/04/30 21:54:53 fox Exp $
# Release isapnptools-1.27
#
# This is free software, see the sources for details.
# This software has NO WARRANTY, use at your OWN RISK
#
# For details of the output file format, see isapnp.conf(5)
#
# For latest information and FAQ on isapnp and pnpdump see:
# http://www.roestock.demon.co.uk/isapnptools/
#
# Compiler flags: -DREALTIME -DHAVE_PROC -DENABLE_PCI -DHAVE_SCHED_SETSCHEDULER -DHAVE_NANOSLEEP -DWANT_TO_VALIDATE
#
# Trying port address 0273
# Board 1 has serial identifier a9 ff ff ff ff 36 42 63 0e

# (DEBUG)
(READPORT 0x0273)
(ISOLATE PRESERVE)
(IDENTIFY *)
(VERBOSITY 2)
(CONFLICT (IO FATAL)(IRQ FATAL)(DMA FATAL)(MEM FATAL)) # or WARNING

# Card 1: (serial identifier a9 ff ff ff ff 36 42 63 0e)
# Vendor Id CSC4236, No Serial Number (-1), checksum 0xA9.
# Version 1.0, Vendor version 0.5
# ANSI string -->Crystal Codec<--
#
# Logical device id CSC0000
# Device supports vendor reserved register @ 0x38
# Device supports vendor reserved register @ 0x3c
# Device supports vendor reserved register @ 0x3e
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CSC4236/-1 (LD 0
# ANSI string -->WSS/SB<--

# Multiple choice time, choose one only !

# Start dependent functions: priority preferred
# First DMA channel 1.
# 8 bit DMA only
# Logical device is not a bus master
# DMA may execute in count by byte mode
# DMA may not execute in count by word mode
# DMA channel speed type A
# (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 A
# (DMA 1 (CHANNEL 0))
# IRQ 5.
# High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0534
# Maximum IO base address 0x0534
# IO base alignment 4 bytes
# Number of IO addresses required: 4
# (IO 0 (SIZE 4) (BASE 0x0534))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0388
# Maximum IO base address 0x0388
# IO base alignment 8 bytes
# Number of IO addresses required: 4
# (IO 1 (SIZE 4) (BASE 0x0388))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0220
# Maximum IO base address 0x0220
# IO base alignment 32 bytes
# Number of IO addresses required: 16
# (IO 2 (SIZE 16) (BASE 0x0220))

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

# Start dependent functions: priority functional
# 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 A
# (DMA 0 (CHANNEL 0))
# IRQ 5, 7, 9, 11, 12 or 15.
# High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 5 (MODE +E)))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0534
# Maximum IO base address 0x0ffc
# IO base alignment 4 bytes
# Number of IO addresses required: 4
# (IO 0 (SIZE 4) (BASE 0x0534))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0388
# Maximum IO base address 0x03f8
# IO base alignment 8 bytes
# Number of IO addresses required: 4
# (IO 1 (SIZE 4) (BASE 0x0388))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0220
# Maximum IO base address 0x0300
# IO base alignment 32 bytes
# Number of IO addresses required: 16
# (IO 2 (SIZE 16) (BASE 0x0220))

# End dependent functions
(NAME "CSC4236/-1[0]{WSS/SB }")
# (ACT Y)
))
#
# Logical device id CSC0001
# Device supports vendor reserved register @ 0x39
# Device supports vendor reserved register @ 0x3c
# Device supports vendor reserved register @ 0x3e
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CSC4236/-1 (LD 1
# ANSI string -->GAME<--

# Multiple choice time, choose one only !

# Start dependent functions: priority preferred
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0200
# Maximum IO base address 0x0200
# IO base alignment 8 bytes
# Number of IO addresses required: 8
# (IO 0 (SIZE 8) (BASE 0x0200))

# Start dependent functions: priority acceptable
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0208
# Maximum IO base address 0x0208
# IO base alignment 8 bytes
# Number of IO addresses required: 8
# (IO 0 (SIZE 8) (BASE 0x0208))

# End dependent functions
(NAME "CSC4236/-1[1]{GAME }")
# (ACT Y)
))
#
# Logical device id CSC0010
# Device supports vendor reserved register @ 0x38
# Device supports vendor reserved register @ 0x3c
# Device supports vendor reserved register @ 0x3e
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CSC4236/-1 (LD 2
# ANSI string -->CTRL<--
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0120
# Maximum IO base address 0x0ff8
# IO base alignment 8 bytes
# Number of IO addresses required: 8
# (IO 0 (SIZE 8) (BASE 0x0120))
(NAME "CSC4236/-1[2]{CTRL }")
# (ACT Y)
))
#
# Logical device id CSC0003
# Device supports vendor reserved register @ 0x38
# Device supports vendor reserved register @ 0x3c
# Device supports vendor reserved register @ 0x3e
#
# Edit the entries below to uncomment out the configuration required.
# Note that only the first value of any range is given, this may be changed if required
# Don't forget to uncomment the activate (ACT Y) when happy

(CONFIGURE CSC4236/-1 (LD 3
# ANSI string -->MPU<--

# Multiple choice time, choose one only !

# Start dependent functions: priority preferred
# IRQ 9.
# High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 9 (MODE +E)))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0330
# Maximum IO base address 0x0330
# IO base alignment 8 bytes
# Number of IO addresses required: 2
# (IO 0 (SIZE 2) (BASE 0x0330))

# Start dependent functions: priority acceptable
# IRQ 9, 11, 12 or 15.
# High true, edge sensitive interrupt (by default)
# (INT 0 (IRQ 9 (MODE +E)))
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0330
# Maximum IO base address 0x0360
# IO base alignment 8 bytes
# Number of IO addresses required: 2
# (IO 0 (SIZE 2) (BASE 0x0330))

# Start dependent functions: priority functional
# Logical device decodes 16 bit IO address lines
# Minimum IO base address 0x0330
# Maximum IO base address 0x03e0
# IO base alignment 8 bytes
# Number of IO addresses required: 2
# (IO 0 (SIZE 2) (BASE 0x0330))

# End dependent functions
(NAME "CSC4236/-1[3]{MPU }")
# (ACT Y)
))
# End tag... Checksum 0x00 (OK)

# Returns all cards to the "Wait for Key" state
(WAITFORKEY)

----------------------------------------------------------------------

And my lspnp -v output is:

01:01.00 CSC0000 Crystal PnP audio system CODEC
state = active
dma 1
dma 3
irq 5
io 0x534-0x537
io 0x388-0x38b
io 0x220-0x22f

01:01.01 CSC0001 Crystal PnP audio system joystick
state = disabled

01:01.02 CSC0010 Crystal PnP audio system control registers
state = active
io 0x120-0x127

01:01.03 CSC0003 Crystal PnP audio system MPU-401 compatible
state = active
io 0x330-0x331

--------------------------------------------------------------------

I don't know what to do with isapnp.conf file. Which lines are to be uncommented?

Re: Strictly On-Line: Plug-and-Play Hardware

Anonymous's picture

Thank you for a plain easy explanation that a newbie can understand!!

Re: Strictly On-Line: Plug-and-Play Hardware

Anonymous's picture

Your explanation is very good. However, when I do the command "modprobe sb.o io=0x220 irq=5 dma=1" it always tells me "Can't locate module sb.o". It tells me that even if I specify another module, such as sound.o or whatever. I check whether the module is installed or not, and it's actually installed!!! But it says it's not there!!! What can I do?? Please e-mail me if you can help me, thank you. noviembrexx@hotmail.com

Re: Strictly On-Line: Plug-and-Play Hardware

Anonymous's picture

don't use the ".o" with modprobe -- just the module name

modprobe sb ...

bv

Re: Strictly On-Line: Plug-and-Play Hardware

Anonymous's picture

I've got another problem:
"this module has no such paramter - IRQ"
"this module has no such paramter - DMA"
"this module has no such paramter - DMA1"
:((

Webinar
One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Webinar
Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix