2008-02-28 12:37:35     ad1980 mmap support in 2008R1

Document created by Aaronwu Employee on Aug 5, 2013
Version 1Show Document
  • View in full screen mode

2008-02-28 12:37:35     ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51814    It looks like mmap support for the ad1980/1 broke at some point in the 2008 branch.

 

root:/> aplay

ALSA lib ../../../alsa-lib-1.0.12/src/pcm/pcm_mmap.c:369:(snd_pcm_mmap) mmap failed: No such device

ALSA lib ../../../alsa-lib-1.0.12/src/pcm/pcm_direct.c:985:(snd_pcm_direct_initialize_slave) unable to install hw params

ALSA lib ../../../alsa-lib-1.0.12/src/pcm/pcm_dmix.c:876:(snd_pcm_dmix_open) unable to initialize slave

aplay: main:550: audio open error: No such device

 

"True MMAP Support" is enabled (along with everything else I've always had enabled).

 

If I disable mmap support, alsa can find the sound device.

 

root:/> ls /dev/

console    pf11       pf23       pf35       pf47       ram13      snd

full       pf12       pf24       pf36       pf5        ram14      sport0

kmem       pf13       pf25       pf37       pf6        ram15      sport1

kmsg       pf14       pf26       pf38       pf7        ram2       tty

log        pf15       pf27       pf39       pf8        ram3       ttyBF0

mem        pf16       pf28       pf4        pf9        ram4       urandom

mtd0       pf17       pf29       pf40       ptmx       ram5       watchdog

mtd0ro     pf18       pf3        pf41       pts        ram6       zero

mtdblock0  pf19       pf30       pf42       ram0       ram7

null       pf2        pf31       pf43       ram1       ram8

pf0        pf20       pf32       pf44       ram10      ram9

pf1        pf21       pf33       pf45       ram11      random

pf10       pf22       pf34       pf46       ram12      root

root:/> ls /dev/snd/

controlC0  pcmC0D0c   pcmC0D0p   timer

root:/>            

QuoteReplyEditDelete

 

 

2008-02-28 13:29:25     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 51819    verify you properly updated the alsa-lib subdirectory with all the config files

QuoteReplyEditDelete

 

 

2008-02-28 13:44:33     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51822    cameron@camlinux:~/src/blackfin/svn/uClinux-dist.2008/lib$ cd ..

cameron@camlinux:~/src/blackfin/svn/uClinux-dist.2008$ svn info

Path: .

URL: svn://sources.blackfin.uclinux.org/uclinux-dist/branches/2008R1

Repository Root: svn://sources.blackfin.uclinux.org/uclinux-dist

Repository UUID: 3e2a5524-39e8-4cb9-84a9-c49da69cba3a

Revision: 6323

Node Kind: directory

Schedule: normal

Last Changed Author: vivili

Last Changed Rev: 6322

Last Changed Date: 2008-02-28 05:27:20 -0800 (Thu, 28 Feb 2008)

 

 

cameron@camlinux:~/src/blackfin/svn/uClinux-dist.2008/lib/alsa-lib/alsa-lib-1.0.12/src/conf/cards$ ls

AACI.conf            ATIIXP.conf    CA0106.conf         ENS1370.conf    ICH-MODEM.conf   PMac.conf          VIA8233.conf      aliases.conf

AD1836.conf          AU8810.conf    CMI8338-SWIEC.conf  ENS1371.conf    ICH.conf         PMacToonie.conf    VIA8233A.conf

AD1980-MMAP.conf     AU8820.conf    CMI8338.conf        ES1968.conf     ICH4.conf        RME9636.conf       VIA8237.conf

AD1980-no-mmap.conf  AU8830.conf    CMI8738-MC6.conf    FM801.conf      Maestro3.conf    RME9652.conf       VX222.conf

AD1980.conf          Audigy.conf    CMI8738-MC8.conf    GUS.conf        Makefile.am      SI7018/            VXPocket.conf

AD73311.conf         Audigy2.conf   CS46xx.conf         HDA-Intel.conf  Makefile.in      SI7018.conf        VXPocket440.conf

ATIIXP-MODEM.conf    Aureon51.conf  EMU10K1.conf        ICE1712.conf    NFORCE.conf      TRID4DWAVENX.conf  YMF744.conf

ATIIXP-SPDMA.conf    Aureon71.conf  EMU10K1X.conf       ICE1724.conf    PC-Speaker.conf  VIA686A.conf       aliases.alisp

cameron@camlinux:~/src/blackfin/svn/uClinux-dist.2008/lib/alsa-lib/alsa-lib-1.0.12/src/conf/cards$

 

 

I even put the old AD1980-MMAP.conf back in to verify that wasn't what was causing the problem.

QuoteReplyEditDelete

 

 

2008-02-28 14:29:12     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 51828    the AD1980-MMAP.conf is not used ... it never was

 

make sure the AD1980.conf file specifies dmix/dsnoop and that the AD1980-no-mmap.conf does not

 

then verify the AD1980.conf file in your romfs directory corresponds to your kernel config

QuoteReplyEditDelete

 

 

2008-02-28 15:04:30     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51832    AD1980.conf references dmix.

 

AD1980-no-mmap.conf does not.

 

Files are straight from branch SVN but are attached anyway.

 

When I build with mmap disabled, AD1980.conf in romfs does not reference dmix. Audio plays.

 

When I build with mmap enabled, AD1980.conf in romfs does reference dmix. It's identical to the file in the source tree.

AD1980-no-mmap.conf

AD1980.conf

QuoteReplyEditDelete

 

 

2008-02-28 15:29:09     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 51836    and you've made sure your kernel tree is also up to date ?  if you did not update the codec driver, things wont work

QuoteReplyEditDelete

 

 

2008-02-28 15:57:14     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51839    I'm running 'svn update' at the top level of my distro. svn is fetching the external kernel into the right place. As long as it's fetching the proper branch kernel, I'd hope everything is correct.

 

I'm pretty sure everything is correct on my end because this is the same code base (save the latest svn updates I've run) that I tested the config file against before you committed it to the repository.

QuoteReplyEditDelete

 

 

2008-02-28 16:30:36     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 51845    i only sent you config files to work without changing anything else ... when i committed, i cleaned up the kernel side of things as well

 

verify your board looks like:

root:/> cat /proc/asound/cards

0 [bf5xxboard     ]: AD1980 - bf5xx-board

                      bf5xx-board (AD1980)

 

but assuming the dmesg you posted in the physmap thread is the same, it seems your codec is up to date (it does not read the old value of "AD1980-MMAP")

QuoteReplyEditDelete

 

 

2008-02-28 16:46:39     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51848    root:/> cat /proc/asound/cards

0 [bf5xxboard     ]: AD1980 - bf5xx-board

                      bf5xx-board (AD1980)

 

 

dmesg from the other thread is correct.

 

I've attached the output from make bugreport, just in case.

bugreport.tgz

QuoteReplyEditDelete

 

 

2008-02-28 16:58:22     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51850    It also appears to be broken in trunk r6296, or I've got a messed up config that I can't seem to track in both versions.

QuoteReplyEditDelete

 

 

2008-02-28 17:30:29     Re: ad1980 mmap support in 2008R1

Robin Getz (UNITED STATES)

Message: 51853    Cameron:

 

The config files for trunk and the 2008R1 are not 100% compatible - since we did a kernel upgrade there are now new options, and old options are gone.

 

-Robin

QuoteReplyEditDelete

 

 

2008-02-28 18:47:25     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 51860    i just took vanilla 2008R1 svn branch and built it up using the default BF537-STAMP config (well, i changed userspace to FDPIC and added alsa-utils) and it works fine for me

 

root:/> aplay /bugsbunny1.wav  &

133

root:/> Playing WAVE '/bugsbunny1.wav' : Unsigned 8 bit, Rate 11025 Hz, Mono

root:/> aplay /bugsbunny1.wav  &

134

root:/> Playing WAVE '/bugsbunny1.wav' : Unsigned 8 bit, Rate 11025 Hz, Mono

root:/> aplay /bugsbunny1.wav  &

135

root:/> Playing WAVE '/bugsbunny1.wav' : Unsigned 8 bit, Rate 11025 Hz, Mono

root:/> aplay /bugsbunny1.wav  &

136

root:/> Playing WAVE '/bugsbunny1.wav' : Unsigned 8 bit, Rate 11025 Hz, Mono

root:/> aplay /bugsbunny1.wav  &

137

 

root:/> cat /proc/asound/cards

0 [bf5xxboard     ]: AD1980 - bf5xx-board

                      bf5xx-board (AD1980)

 

root:/> cat /usr/share/alsa/cards/AD1980.conf

AD1980.pcm.default {

        @args [ CARD ]

        @args.CARD {

                type string

        }

        type asym

        playback.pcm {

                type plug

                slave.pcm {

                        @func concat

                        strings [ "dmix:CARD=" $CARD ]

                }

        }

        capture.pcm {

                type plug

                slave.pcm {

                        @func concat

                        strings [ "dsnoop:CARD=" $CARD ]

                }

        }

}

QuoteReplyEditDelete

 

 

2008-02-28 23:00:21     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51867    Well ****. I'll do a fresh checkout in the morning. Maybe something is borked in my svn checkout after all.

QuoteReplyEditDelete

 

 

2008-02-29 14:34:44     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51917    It's still not working for me...what kernel config options do you have set under sound/alsa?

QuoteReplyEditDelete

 

 

2008-02-29 14:44:35     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 51919    #

# Sound

#

CONFIG_SOUND=y

 

#

# Advanced Linux Sound Architecture

#

CONFIG_SND=y

CONFIG_SND_TIMER=y

CONFIG_SND_PCM=y

# CONFIG_SND_SEQUENCER is not set

CONFIG_SND_OSSEMUL=y

CONFIG_SND_MIXER_OSS=y

CONFIG_SND_PCM_OSS=y

CONFIG_SND_PCM_OSS_PLUGINS=y

# CONFIG_SND_DYNAMIC_MINORS is not set

CONFIG_SND_SUPPORT_OLD_API=y

CONFIG_SND_VERBOSE_PROCFS=y

# CONFIG_SND_VERBOSE_PRINTK is not set

# CONFIG_SND_DEBUG is not set

 

#

# Generic devices

#

# CONFIG_SND_DUMMY is not set

# CONFIG_SND_MTPAV is not set

# CONFIG_SND_SERIAL_U16550 is not set

# CONFIG_SND_MPU401 is not set

 

#

# ALSA Blackfin devices

#

# CONFIG_SND_BLACKFIN_AD1836 is not set

# CONFIG_SND_BFIN_AD73311 is not set

 

#

# System on Chip audio support

#

CONFIG_SND_SOC_AC97_BUS=y

CONFIG_SND_SOC=y

CONFIG_SND_BF5XX_SOC=y

CONFIG_SND_MMAP_SUPPORT=y

CONFIG_SND_BF5XX_SOC_AC97=y

# CONFIG_SND_BF5XX_SOC_WM8750 is not set

# CONFIG_SND_BF5XX_SOC_WM8731 is not set

CONFIG_SND_BF5XX_SOC_BF5xx=y

CONFIG_SND_BF5XX_SPORT_NUM=0

CONFIG_SND_BF5XX_HAVE_COLD_RESET=y

CONFIG_SND_BF5XX_RESET_GPIO_NUM=5

CONFIG_SND_SOC_AD1980=y

QuoteReplyEditDelete

 

 

2008-02-29 15:35:34     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51922    What is going on then?

 

#

# Sound

#

CONFIG_SOUND=y

 

#

# Advanced Linux Sound Architecture

#

CONFIG_SND=y

CONFIG_SND_TIMER=y

CONFIG_SND_PCM=y

# CONFIG_SND_SEQUENCER is not set

CONFIG_SND_OSSEMUL=y

CONFIG_SND_MIXER_OSS=y

CONFIG_SND_PCM_OSS=y

CONFIG_SND_PCM_OSS_PLUGINS=y

# CONFIG_SND_DYNAMIC_MINORS is not set

CONFIG_SND_SUPPORT_OLD_API=y

CONFIG_SND_VERBOSE_PROCFS=y

# CONFIG_SND_VERBOSE_PRINTK is not set

# CONFIG_SND_DEBUG is not set

 

#

# Generic devices

#

# CONFIG_SND_DUMMY is not set

# CONFIG_SND_MTPAV is not set

# CONFIG_SND_SERIAL_U16550 is not set

# CONFIG_SND_MPU401 is not set

 

#

# ALSA Blackfin devices

#

# CONFIG_SND_BLACKFIN_AD1836 is not set

# CONFIG_SND_BFIN_AD73311 is not set

 

#

# System on Chip audio support

#

CONFIG_SND_SOC_AC97_BUS=y

CONFIG_SND_SOC=y

CONFIG_SND_BF5XX_SOC=y

CONFIG_SND_MMAP_SUPPORT=y

CONFIG_SND_BF5XX_SOC_AC97=y

# CONFIG_SND_BF5XX_SOC_WM8750 is not set

# CONFIG_SND_BF5XX_SOC_WM8731 is not set

CONFIG_SND_BF5XX_SOC_BF5xx=y

CONFIG_SND_BF5XX_SPORT_NUM=0

CONFIG_SND_BF5XX_HAVE_COLD_RESET=y

CONFIG_SND_BF5XX_RESET_GPIO_NUM=5

CONFIG_SND_SOC_AD1980=y

 

#

# Open Sound System

#

# CONFIG_SOUND_PRIME is not set

CONFIG_AC97_BUS=y

QuoteReplyEditDelete

 

 

2008-02-29 17:52:55     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51933    Do I still need to set:

 

CONFIG_BFIN_DMA_5XX=y

# CONFIG_DMA_UNCACHED_2M is not set

CONFIG_DMA_UNCACHED_1M=y

# CONFIG_DMA_UNCACHED_NONE is not set

QuoteReplyEditDelete

 

 

2008-02-29 18:03:46     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 51934    yes, you will need to have an uncachable dma region in order for things to work

QuoteReplyEditDelete

 

 

2008-02-29 18:19:17     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51935    Wow, this is driving me nuts. It's still not working with mmap support...

QuoteReplyEditDelete

 

 

2008-02-29 18:44:41     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 51936    post the strace output as a log

 

strace -o out -s 4096 aplay < /dev/null

QuoteReplyEditDelete

 

 

2008-03-03 12:01:54     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 51995    Log attached (nasty formatting from some of the strace output).

 

strace_output.txt

QuoteReplyEditDelete

 

 

2008-03-05 14:38:49     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 52125    I still can't get this working.

 

Any other ideas?

QuoteReplyEditDelete

 

 

2008-03-07 17:24:33     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 52205    [obseleted by next post]

QuoteReplyEditDelete

 

 

2008-03-07 17:50:46     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 52206    I think the cause of the problem is ext2...

 

I managed to get it working using ramboot (stock image was too big too for my flash). I disabled a bunch of stuff so I could fit uImage.initramfs in my flash and it was still working. When I switched to ext2 and "generic uclinux filesystem support" it died again. I've tried booting from flash with uImage.ext and from ram with linux.ext2. DMIX/MMAP doesn't work with either choice.

QuoteReplyEditDelete

 

 

2008-03-10 15:02:31     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 52274    sorry, we were out of town last week ...

 

the default image boots out of initramfs rather than ramdisk/uclinux-mtd ... you're saying that when you boot out of initramfs it works but when you boot out of ramdisk/uclinux-mtd it does not ?

QuoteReplyEditDelete

 

 

2008-03-10 16:50:24     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 52285    Not exactly. If I enable (in kernel config) ext2 and generic uclinux ram/rom filesystem support then either burn the uimage.ext2 image to flash or run a ramboot (tftpboot $(loadaddr) linux.ext;run ramargs;run addip;bootelf), I get the errors about alsa not being able to find the device.

QuoteReplyEditDelete

 

 

2008-03-10 17:08:15     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 52288    that is booting the ramdisk/uclinux-mtd kernel ... which is not the default with 2008R1+

 

i'll tweak my config accordingly and retest

QuoteReplyEditDelete

 

 

2008-03-10 17:19:52     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 52289    Yeah, sorry about the confusion. I was trying to get the mtd partitioning to work at the same time and was absent mindedly using that config.

 

I've attached my kernel config, if it'll be any help.

kernel_ip6.config

QuoteReplyEditDelete

 

 

2008-03-12 14:51:33     Re: ad1980 mmap support in 2008R1

Robin Getz (UNITED STATES)

Message: 52403    Cameron:

 

Sorry for the delay - did this get resolved?

 

-Robin

QuoteReplyEditDelete

 

 

2008-03-12 16:03:28     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 52406    No prob. I didn't realize you were all out of the office last week.

 

Not as far as I know. I can get it to work in Mike's environment (default settings), but can't get it to work if I'm running ext2.

QuoteReplyEditDelete

 

 

2008-03-12 16:18:21     Re: ad1980 mmap support in 2008R1

Robin Getz (UNITED STATES)

Message: 52408    Cameron:

 

When you say ext2 - you mean ext2 ram backed file system?

 

-Robin

QuoteReplyEditDelete

 

 

2008-03-12 16:40:34     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 52410    Sorry, but I'm not really sure...I think so, though.

 

    I managed to get it working using ramboot (stock image was too big too for my flash). I disabled a bunch of stuff so I could fit uImage.initramfs in my flash and it was still working. When I switched to ext2 and "generic uclinux filesystem support" it died again. I've tried booting from flash with uImage.ext and from ram with linux.ext2. DMIX/MMAP doesn't work with either choice.

 

 

I posted my kernel config a few messages up from here.

QuoteReplyEditDelete

 

 

2008-03-12 20:12:54     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 52414    you cant disable CONFIG_HOTPLUG and expect things to work if you dont turn around and create all the necessary device nodes ahead of time

QuoteReplyEditDelete

 

 

2008-03-13 11:28:15     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 52460    Wouldn't hotplug only be necessary if I were building the driver as a module?

 

Either way, enabling hotplug doesn't fix the problem.

QuoteReplyEditDelete

 

 

2008-03-13 13:10:48     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 52463    hotplug is not related to modules in any way ... the default behavior in 2008R1 is to create device nodes dynamically which cannot happen without hotplug

QuoteReplyEditDelete

 

 

2008-03-13 13:34:43     Re: ad1980 mmap support in 2008R1

Cameron Barfield (UNITED STATES)

Message: 52466    Ah.

QuoteReplyEditDelete

 

 

2008-03-13 15:26:23     Re: ad1980 mmap support in 2008R1

Mike Frysinger (UNITED STATES)

Message: 52478    when i take your kernel config and just enable hotplugging, things work for me

 

verify that you have the required device nodes in /dev after loading the module

Outcomes