Skip to contentSkip to conversation

Lots of noob questions on writing an ALSA driver for SM501

DISCUSSION Bill Gatliff 2 participants 5 messages Jul 26, 2005

lore
Share & tools
lore
#0 lore raw

Guys:

I'm attempting to write my first ALSA driver. My objective is to get sounds to emerge through a UCB1400 connected to an SM501's AC97-link controller, and to receive sounds coming from the UCB1400's audio input(s).

I'm going over Takashi Iwai's "Writing an ALSA Driver" document, but there are a few things I just don't understand yet. I'm hoping that someone here will be able to set me straight.

The SM501 has an AC97-Link controller, but nothing else related to audio as far as I can tell. In my hardware the SM501 is memory-mapped, and is not a PCI device. The host processor is an AT91RM9200 (ARM).

As far as I can tell, I need a "PCM Interface" driver to provide a PCM device file to userspace. It also looks like I need an "AC97 Interface" driver to provide access to the UCB1400 during playback and recording. Is this right?

I'm hoping someone will set me straight here. Thanks!!

b.g.

Signature · 17 lines
Bill Gatliff
[email protected]

The true Southern watermelon is a boon apart, and not to be mentioned
with commoner things.  It is chief of the world's luxuries, king by
the grace of God over all the fruits of the earth.  When one has
tasted it, he knows what the angels eat.  It was not a Southern
watermelon that Eve took; we know it because she repented.
               -- Mark Twain, "Pudd'nhead Wilson's Calendar"



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
#1 lore raw
Quoted 15 lines · Bill Gatliff

Guys:

I'm attempting to write my first ALSA driver. My objective is to get sounds to emerge through a UCB1400 connected to an SM501's AC97-link controller, and to receive sounds coming from the UCB1400's audio input(s).

I'm going over Takashi Iwai's "Writing an ALSA Driver" document, but there are a few things I just don't understand yet. I'm hoping that someone here will be able to set me straight.

The SM501 has an AC97-Link controller, but nothing else related to audio as far as I can tell. In my hardware the SM501 is memory-mapped, and is not a PCI device. The host processor is an AT91RM9200 (ARM).

Quoted 5 lines

As far as I can tell, I need a "PCM Interface" driver to provide a PCM device file to userspace. It also looks like I need an "AC97 Interface" driver to provide access to the UCB1400 during playback and recording. Is this right?

I'm hoping someone will set me straight here. Thanks!!

Look to drivers in the sound/arm (alsa-kernel/arm) tree for ideas.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

#2 lore raw

Jaroslav:

Quoted 8 lines · Jaroslav Kysela

On Tue, 26 Jul 2005, Bill Gatliff wrote:

Look to drivers in the sound/arm (alsa-kernel/arm) tree for ideas.

Jaroslav

I think that the pxa2xx-ac97 and pxa2xx-pcm stuff may be exactly the models I'm looking for.

But the sm501 stuff won't be ARM-specific--- it'll be tested on ARM and SH, at least. So where should the source for sm501-pcm.c and sm501-ac97 be placed?

b.g.

Signature · 12 lines
Bill Gatliff
[email protected]

Today is the last day of your life so far.



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
#3 lore raw
Quoted 2 lines · Bill Gatliff

But the sm501 stuff won't be ARM-specific--- it'll be tested on ARM and SH, at least. So where should the source for sm501-pcm.c and sm501-ac97 be placed?

Good question. I think drivers/sm501 directory might be ok for the common stuff (library) and place the toplevel modules for architectures to arm/ and new sh/ directories. If the toplevel code will be very common, something like

#define ARCH_SH
#include "../arm/sm501-ac97.c"

might be used in the sh/ directory.

Or leave everything in drivers/sm501 for this time - we can move it later.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project, SUSE Labs

-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click

#4 lore raw

Jaroslav:

Quoted 5 lines · Jaroslav Kysela

On Tue, 26 Jul 2005, Bill Gatliff wrote:

Or leave everything in drivers/sm501 for this time - we can move it later.

Ok.

b.g.

Signature · 13 lines
Bill Gatliff
[email protected]

You have the capacity to learn from mistakes.
You'll learn a lot today.



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click