* Driver for AK4555 codec @ 2010-07-29 7:18 Yoran Brondsema 2010-07-29 18:42 ` Mark Brown 0 siblings, 1 reply; 5+ messages in thread From: Yoran Brondsema @ 2010-07-29 7:18 UTC (permalink / raw) To: alsa-devel Hi, For a system here at work, we have a simple audio system consisting of an I2S-bus audio controller embedded in the CPU (an NXP LPC3250) and a AK4555 codec which communicates with the CPU through the I2S-bus and produces (or captures) analog signals. The codec is extremely simple; it is basically an A/D & D/A converter and it doesn't support a control interface such as I2C. There is a driver available for the LPC3250 but none for the AK4555 codec, so I have to write it myself. I checked the document "Writing an ALSA Driver" by Takashi Iwai but it seems to focus on full-featured sound cards; I'm just dealing with a "simple" codec. I checked at the code of the uda1380 in linux/sound/soc/lpc3xxx/lpc3xxx-uda1380.c and it seems to be calling some functions like platform_device_alloc, platform_set_drvdata,... but I can't find the documentation of what these functions do. Can someone give me some pointers to some documentation or some rough idea of how it needs to be done? Thank you, Yoran ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Driver for AK4555 codec 2010-07-29 7:18 Driver for AK4555 codec Yoran Brondsema @ 2010-07-29 18:42 ` Mark Brown [not found] ` <AANLkTinWJT36u99_vxOqXOADRNBT9VMy_5mOsBLE1PLO@mail.gmail.com> 0 siblings, 1 reply; 5+ messages in thread From: Mark Brown @ 2010-07-29 18:42 UTC (permalink / raw) To: Yoran Brondsema; +Cc: alsa-devel On Thu, Jul 29, 2010 at 09:18:43AM +0200, Yoran Brondsema wrote: > There is a driver available for the LPC3250 but none for the AK4555 codec, > so I have to write it myself. I checked the document "Writing an ALSA > Driver" by Takashi Iwai but it seems to focus on full-featured sound cards; > I'm just dealing with a "simple" codec. I checked at the code of the uda1380 > in linux/sound/soc/lpc3xxx/lpc3xxx-uda1380.c and it seems to be calling some > functions like platform_device_alloc, platform_set_drvdata,... but I can't > find the documentation of what these functions do. > Can someone give me some pointers to some documentation or some rough idea > of how it needs to be done? The documentation for ASoC is in: Documentation/sound/alsa/soc which should give you a reasonable structural overview of things. Probably the easiest thing for you to do is to clone the driver for a simple I2C controlled CODEC such as the WM8523 and then replace all the specifics of the register access with those for your CODEC. ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <AANLkTinWJT36u99_vxOqXOADRNBT9VMy_5mOsBLE1PLO@mail.gmail.com>]
* Re: Driver for AK4555 codec [not found] ` <AANLkTinWJT36u99_vxOqXOADRNBT9VMy_5mOsBLE1PLO@mail.gmail.com> @ 2010-07-30 6:59 ` Mark Brown 2010-07-30 8:00 ` Yoran Brondsema 0 siblings, 1 reply; 5+ messages in thread From: Mark Brown @ 2010-07-30 6:59 UTC (permalink / raw) To: Yoran Brondsema; +Cc: alsa-devel On 29 Jul 2010, at 23:45, Yoran Brondsema <yoran.brondsema@gmail.com> wrote: > On 29 July 2010 20:42, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote: > On Thu, Jul 29, 2010 at 09:18:43AM +0200, Yoran Brondsema wrote: Don't drop CCs to the mailing lists; if nothing else advice is often useful to other people searching the mailing list archives. > So my main question is whether I have to write this lpc3xxx-ak4555.c. It would be great if someone could clear me up on this. Yes, you'll have to write a driver for your machine. It says how the CODEC and CPU are wired up on your particular board - either component could also be used with another device, or another machine may have a different way of connecting the same components which requires a different setup. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Driver for AK4555 codec 2010-07-30 6:59 ` Mark Brown @ 2010-07-30 8:00 ` Yoran Brondsema 2010-08-03 15:05 ` Mark Brown 0 siblings, 1 reply; 5+ messages in thread From: Yoran Brondsema @ 2010-07-30 8:00 UTC (permalink / raw) To: Mark Brown; +Cc: alsa-devel On 30 July 2010 08:59, Mark Brown <broonie@opensource.wolfsonmicro.com>wrote: > On 29 Jul 2010, at 23:45, Yoran Brondsema <yoran.brondsema@gmail.com> > wrote: > > On 29 July 2010 20:42, Mark Brown <broonie@opensource.wolfsonmicro.com>wrote: > >> On Thu, Jul 29, 2010 at 09:18:43AM +0200, Yoran Brondsema wrote: >> > > Don't drop CCs to the mailing lists; if nothing else advice is often useful > to other people searching the mailing list archives. > > So my main question is whether I have to write this lpc3xxx-ak4555.c. It > would be great if someone could clear me up on this. > > > Yes, you'll have to write a driver for your machine. It says how the CODEC > and CPU are wired up on your particular board - either component could also > be used with another device, or another machine may have a different way of > connecting the same components which requires a different setup. > I'm sorry for the CC, did "reply" instead of "reply-to-all". I've modified an existing driver, and the two driver modules load fine when insmod'ing them. However, when I run speaker-test I get the following message. -bash-3.2# ./../../../../../../../tools/alsa-arm-utils/bin/speaker-test speaker-test 1.0.17 Playback device is default Stream parameters are 48000Hz, S16_LE, 1 channels Using 16 octaves of pink noise Rate set to 48000Hz (requested 48000Hz) Buffer size range from 128 to 32768 Period size range from 64 to 1024 Using max buffer size 32768 Periods = 4 was set period_size = 1024 was set buffer_size = 32768 0 - Front Left Write error: -5,Input/output error xrun_recovery failed: -5,Input/output error Transfer failed: Operation not permitted I checked the speaker-test code, and this happens after a call to snd_pcm_writei(). The error code is -5, which corresponds to -EIO. In the snd_pcm_writei() definition, the following code fails. if (CHECK_SANITY(! pcm->setup)) { SNDMSG("PCM not set up"); return -EIO; } However, in the init function of the codec driver (linux/sound/soc/codecs/ak4555.c), I do ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); if (ret < 0) { pr_err("uda1380: failed to create pcms\n"); goto pcm_err; } and every time ret >= 0. What could be wrong? Thank you, Yoran ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Driver for AK4555 codec 2010-07-30 8:00 ` Yoran Brondsema @ 2010-08-03 15:05 ` Mark Brown 0 siblings, 0 replies; 5+ messages in thread From: Mark Brown @ 2010-08-03 15:05 UTC (permalink / raw) To: Yoran Brondsema; +Cc: alsa-devel On Fri, Jul 30, 2010 at 10:00:12AM +0200, Yoran Brondsema wrote: > I checked the speaker-test code, and this happens after a call to > snd_pcm_writei(). The error code is -5, which corresponds to -EIO. In the > snd_pcm_writei() definition, the following code fails. > However, in the init function of the codec driver > (linux/sound/soc/codecs/ak4555.c), I do Any of the drivers involved in the audio stream can generate an error, you need to make sure all of them are happy. > What could be wrong? You'll need to debug this. Check how the core expects the stream to be marked as configured and diagnose why that's not happening. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-08-03 15:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-29 7:18 Driver for AK4555 codec Yoran Brondsema
2010-07-29 18:42 ` Mark Brown
[not found] ` <AANLkTinWJT36u99_vxOqXOADRNBT9VMy_5mOsBLE1PLO@mail.gmail.com>
2010-07-30 6:59 ` Mark Brown
2010-07-30 8:00 ` Yoran Brondsema
2010-08-03 15:05 ` Mark Brown
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.