How to use ABDAC audio on NGW100?

Go To Last Post
21 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I was wondering what steps are required to create a /dev/dsp device on my NGW100 using the ABDAC audio driver?

I have spent a couple of days trawling through the relevant posts which I could find as well as the OSS documentation but can't get the driver loaded.

Using Buildroot2.3.0 I have tried starting with the atngw100_defconfig and then added madplay, alsa utils and ncurses etc.

I then go into:
buildroot-avr32-v2.3.0/project_build_avr32/{name_of_my_configuration}/linux-2.6.27.6/arch/avr32/boards/atngw100
and edit the setup.c file so that it includes:

"at32_add_device_abdac(0);" 

in the function

 static int __init atngw100_init(void)

I then go and edit the .config file that is the lowest directory of Buildroot and add the following:

#
# Sound
#
CONFIG_SOUND=m

#
# Advanced Linux Sound Architecture
#
CONFIG_SND=m
CONFIG_SND_TIMER=m
CONFIG_SND_PCM=m
# CONFIG_SND_SEQUENCER is not set
CONFIG_SND_OSSEMUL=y
CONFIG_SND_MIXER_OSS=m
CONFIG_SND_PCM_OSS=m
CONFIG_SND_PCM_OSS_PLUGINS=y
# CONFIG_SND_DYNAMIC_MINORS is not set
# CONFIG_SND_SUPPORT_OLD_API is not set
CONFIG_SND_VERBOSE_PROCFS=y
CONFIG_SND_VERBOSE_PRINTK=y
CONFIG_SND_DEBUG=y
CONFIG_SND_DEBUG_DETECT=y
# CONFIG_SND_PCM_XRUN_DEBUG is not set

#
# Generic devices
#
CONFIG_SND_AC97_CODEC=m
CONFIG_SND_AC97_BUS=m
CONFIG_SND_DUMMY=m
# CONFIG_SND_MTPAV is not set
# CONFIG_SND_SERIAL_U16550 is not set
# CONFIG_SND_MPU401 is not set

#
# ALSA AVR32 devices
#
CONFIG_SND_ATMEL_AC97=m
CONFIG_SND_ATMEL_AC97_USE_ALSA_MALLOC_CALLS=y
CONFIG_SND_ATMEL_AC97C_USE_PDC=y
CONFIG_SND_AT73C213=m
CONFIG_SND_AT73C213_USE_ALSA_MALLOC_CALLS=y

#
# Open Sound System
#
CONFIG_SOUND_PRIME=m
# CONFIG_OSS_OBSOLETE_DRIVER is not set
# CONFIG_SOUND_MSNDCLAS is not set
# CONFIG_SOUND_MSNDPIN is not set
CONFIG_SOUND_AT32_DAC=m

I then 'make' that configuration and move it to my NGW100.

On my NGW100 I only get:

./sys/devices/platform/abdac.0
./sys/bus/platform/devices/abdac.0

and nothing relevant in the /dev/ directory.

Does anyone know what I need to do to get the ABDAC loaded as /dev/dsp on my NGW100 using Buildroot2.3.0?

[/code]

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ABDAC does not work in kernel 2.6.27, because the driver is not ported to the new DMA framework.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Oh ok, thanks hce.

The ac97 code is still good in 2.6.27 onwards right?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dingo_aus wrote:
Oh ok, thanks hce.

The ac97 code is still good in 2.6.27 onwards right?

Nope, same problem.

On the good side, I am working on the AC97C driver as we speak. Will be sent to the AVR32 kernel list and ALSA list when done.

ABDAC will follow after that, rewritten to ALSA.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Excellent work hce,

I eagerly look forward to testing your submissions ;)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey =)

When will the AC97 driver be approximately finished?

Im currently working on a larger project and everything works fine, except for the AC97, the thing is that my wirless card needs a kernel above 2.6.28 so a can't use the old kernel where the driver is working...

Best Regards
BWA

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I actually got sound today, and it seems like I will not need to modify the DMA framework in the kernel (which is a very good thing).

But there are some problems I need to sort out with cleaning up after the DMA, because the way it is now I run out of descriptors after a few skips in the sound file or playing several files.

Removing the driver does not work either ;)

I would recommend to subscribe to the AVR32 kernel list, link somewhere on http://avr32linux.org I will use that list for review when I am confident that it works.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The relevant mailings lists are found on this page:

http://avr32linux.org/twiki/bin/...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey =)

I already member of the kernel mailing list =)
not much going on there in the last weeks...

I'm really in dire need of that driver, right now... is it possible that you send me a patch, wheather it is stable or not, i just need to get out a few beeps...
my e-mail is bwa [at] berniwa [dot] com

I'd really appreciate that...

Greets from Austria =)
Bernhard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The current state of the AC97C driver is that it crashes the kernel when you stop the playback ;) So it is not useful for anything.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How can I find more information’s about ABDAC audio? At the beginning I started with the Application Note "AVR32120: AVR32 ABDAC audio bitstream DAC driver example" and use the component TPA152.

It's the sound okay?

Dingo_aus wrote:
buildroot-avr32-v2.3.0/project_build_avr32/{name_of_my_configuration}/linux-2.6.27.6/arch/avr32/boards/atngw100
and edit the setup.c file so that it includes:
Code:

"at32_add_device_abdac(0);" 

Must I include more code in setup.c or it's all?

I use Buildroot 2.2.1 with kernel 2.6.23.

Donni Duck

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You also need to enable the ABDAC driver as well, it is in drivers -> sound -> OSS -> AVR32 or something like that.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is there any information which describes the procedure of adding any audio-device (ac97 or abdac) on NGW100 with actual kernel 2.6.30 (git-checkout 30.06.2009 master branch)?
I've been searchin' for quite some time now, but e.g. "at32_add_device_abdac(0)" is not practical any more (no such function).

Any help is appreciated.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Take a look in arch/avr32/mach-at32ap/include/mach/board.h for a description of at32_add_device_abdac() parameters. And in arch/avr32/boards/favr-32/setup.c for an example usage.

For AC97 you could look at the arch/avr32/boards/atngw100/evklcd10x.c file.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks a lot. As soon as I'm at home again, I will have a look.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Getting ready to submit my ac97 board design to the fab house, but before I do, I thought I'd try compiling a kernel with the appropriate modules in it, and try loading the abdac module, since it's built in to the AP7000 ...

/lib/modules/2.6.32.8/kernel/sound/atmel # ls
snd-atmel-abdac.ko  snd-atmel-ac97c.ko
/lib/modules/2.6.32.8/kernel/sound/atmel # uname -a
Linux ngw.example.net 2.6.32.8 #2 Fri Feb 12 09:42:16 EST 2010 avr32 unknown
/lib/modules/2.6.32.8/kernel/sound/atmel # modprobe snd-atmel-abdac
modprobe: Failed to load module snd_atmel_abdac: No such device.
/lib/modules/2.6.32.8/kernel/sound/atmel #

Should I be loading some other module first? Or is the problem likely related to having different kernel and userland versions? Or am I mistaken in thinking that no external hardware is required to make the abdac work? Or is there some other way in which I'm Doing It Wrong?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In your board code, do you add the abdac platform device?

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In my board code? Where is that?

I'm just trying to load the module I'd compiled, which is what I'm used to doing on linux on regular PCs.

If you're referring to the "Select an NGW100 add-on board to support" in the kernel, I've tried both options there ... or do I need to write my own board support code from scratch? If so, is there a quick-and-dirty getting started guide for someone who has a fairly good knowledge of C already?

I've read a few posts about people doing things to some sort of setup.c ... is that the one in linux-2.6.32.8/arch/avr32/boards/atngw100? Is that what I need to be modifying, and is there some sort of guide for that?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aha!

So, unlike a regular PC, these things have pins that can be used for multiple purposes, and we get to configure those purposes in linux-2.6.32.8/arch/avr32/boards/atngw100/setup.c. This is explained here

http://avr32linux.org/twiki/bin/...

and here

http://avr32linux.org/twiki/bin/...

Just had to dig around a bit more. And add "#include " to setup.c also.

Cool. Now I'm well on my way. Thanks for the pointers.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

bradn8vi wrote:
linux-2.6.32.8/arch/avr32/boards/atngw100

Where can I find a guide to use the newer kernel with a NGW100?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well.. no updates here, unfortunately the webside which explained how to include the ac97 module is also dead.
I'm trying to make the AC97 work with the cyrrus logic audio coded, but don't know how to include these modules to the kernel.
Any help is appreciated.
I've managed to build the toolchain, also compiled alsa and mplayer, but it complains of course for no audio device.
modprobe snd_atmel_ac97 gives error that the module is missing.
So i'm wondering how can i provided it as a module or compile it directly to the kernel.