2010-03-22 15:36:34 Kernel 09r2 - Custom ALSA driver AD1938 not loading at startup.
Matt Gilg (UNITED STATES)
Message: 87579
After a kernel update, it seems that our ad1938 driver doesn't load on system startup. The driver is very similar to the AD1836.
Has anybody else noticed a change in Alsa that would prevent sound drivers from loading correctly? The AD1836 seems to load, so I'm assuming something has changed...
I've tried building both the 1836 and 1938 as modules and loading them with insmod to no avail...
Thanks,
-Matt
QuoteReplyEditDelete
2010-03-22 15:43:44 Re: Kernel 09r2 - Custom ALSA driver AD1938 not loading at startup.
Matt Gilg (UNITED STATES)
Message: 87581
Oops. 2009R1.1
root:~> version
kernel: Linux release 2.6.28.10-ADI-2009R1.1-svn763, build #197 Mon Mar 22 12:13:12 MDT 2010
toolchain: bfin-linux-uclibc-gcc release gcc version 4.1.2 (ADI svn)
user-dist: release svn-763, build #129 Mon Mar 22 12:13:29 MDT 2010
- Matt
QuoteReplyEditDelete
2010-03-22 16:16:27 Re: Kernel 09r2 - Custom ALSA driver AD1938 not loading at startup.
Mike Frysinger (UNITED STATES)
Message: 87587
did you update your board resources to match the new driver ?
figure out which functions exactly are being called in your code.
QuoteReplyEditDelete
2010-03-23 14:12:39 Re: Kernel 09r2 - Custom ALSA driver AD1938 not loading at startup.
Matt Gilg (UNITED STATES)
Message: 87625
snd_ad1938_init() is getting called, platform_driver_register() returns success, but snd_ad1938_probe() doesn't seem to be getting executed. On startup:
Advanced Linux Sound Architecture Driver Version 1.0.18rc3.
snd_ad1938_init
AD1938 Initialization complete. (ret=0)
ALSA device list:
No soundcards found.
I've attached the driver. Any idea why probe might not get executed? There must be a discontinuity somewhere...
ad1938.c
QuoteReplyEditDelete
2010-03-23 15:25:08 Re: Kernel 09r2 - Custom ALSA driver AD1938 not loading at startup.
Mike Frysinger (UNITED STATES)
Message: 87627
like i said, check your platform resources. that's what a missing probe is usually indicative of.
QuoteReplyEditDelete
2010-03-24 19:11:03 Re: Kernel 09r2 - Custom ALSA driver AD1938 not loading at startup.
Matt Gilg (UNITED STATES)
Message: 87676
Turns out the problem was related to num_chipselect in spi_master. (we use a blackfin-specific bitbanged spi driver) For whatever reason, spi_get_master was zeroing the spi_master.num_chipselects field specified in the board file. Hard-coding num_chipselects to a sane value after calling spi_get_master seemed to correct the problem...
The soundcard is recognized and starts, the asound interface in proc shows up, all appears to be working....
root:/proc/asound> ls
ad1938 card0 cards devices pcm timers version
root:/proc/asound> cat cards
0 [ad1938 ]: AD1938 - ADI ad1938
ADI ad1938 at PF3 SPORT0 rx/tx dma 3/4 err irq 45
root:/proc/asound> cat pcm
00-00: AD1938_PCM : AD1938_PCM : playback 1 : capture 1
root:/proc/asound> cat devices
0: [ 0] : control
16: [ 0- 0]: digital audio playback
24: [ 0- 0]: digital audio capture
33: : timer
However, when I call alsamixer, I get the following:
root:~> alsamixer
alsamixer: function snd_ctl_open failed for default: No such file or directory
Hmmmm....noticed that our dev directory doesn't contain a sound directory with driver nodes like the old kernel, even though they are specified in the device table as follows:
# Sound devices (ALSA)
/dev/snd d 755 0 0 - - - - -
/dev/snd/controlC0 c 664 0 0 116 0 0 0 -
/dev/snd/pcmC0D0c c 664 0 0 116 24 0 0 -
/dev/snd/pcmC0D0p c 664 0 0 116 16 0 0 -
/dev/snd/timer c 664 0 0 116 33 0 0 -
After manually creating them with mknod...
root:/dev/snd> ls -l
crw-r--r-- 1 root root 116, 0 Jan 1 00:03 controlC0
crw-r--r-- 1 root root 116, 24 Jan 1 00:04 pcmC0D0c
crw-r--r-- 1 root root 116, 16 Jan 1 00:04 pcmC0D0p
crw-r--r-- 1 root root 116, 33 Jan 1 00:04 timer
root:/dev/snd>alsamixer
alsamixer: ../../../alsa-lib-1.0.18/src/mixer/simple_none.c: 1486: simple_add1: Assertion `0' failed.
Abort
Any idea what might be happening here?
-Matt
QuoteReplyEditDelete
2010-03-25 11:20:42 Re: Kernel 09r2 - Custom ALSA driver AD1938 not loading at startup.
Matt Gilg (UNITED STATES)
Message: 87692
An Update: After I manually create the device nodes in /dev/snd, our audio applications work correctly. I can send/receive audio to/from the ad1938 and it works as expected. Alsamixer still fails with an assertion. This problem might be related to the fact that enabling the "Alsa Utils" option in menuconfig builds alsamixer v1.0.12, even when the kernel defaults to building v1.0.18?
I could add scripts to create the device nodes for alsa (in /dev/snd) on startup, but is there an option that creates those automatically?
Thanks,
-Matt
QuoteReplyEditDelete
2010-03-25 12:48:15 Re: Kernel 09r2 - Custom ALSA driver AD1938 not loading at startup.
Mike Frysinger (UNITED STATES)
Message: 87694
please read the documentation:
docs.blackfin.uclinux.org/doku.php?id=uclinux-dist:dev-management