• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Audio Drivers

Audio Drivers






Total Views
Views on SlideShare
Embed Views



4 Embeds 4,969

http://www.sysplay.in 2852
http://sysplay.in 2104
http://translate.googleusercontent.com 9
http://localhost 4



Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment

    Audio Drivers Audio Drivers Presentation Transcript

    • Audio Drivers© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> All Rights Reserved.
    • What to Expect?Introduction to Linux Audio SubsystemAudio Vertical: Sound CoreAudio HorizontalPutting them all together: Porting © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2 All Rights Reserved.
    • Audio Subsystem ALSA conforming Apps User Space OSS conforming Apps(aplay, arecord, mplayer, ...) (rawplay, rawrec, ...) /dev/snd/pcmCXDYz, /proc/asound /dev/dsp, /dev/adsp, /dev/snd/controlCX, /sys/class/sound /dev/mixer, /dev/audio /dev/snd/timer OSS Emulation Layer (snd_pcm_oss, snd_mixer_oss) ALSA (Sound) Core Control Data Audio Codec Driver I2C Audio Controller Driver Kernel Space I2S Hardware Space MIC Audio Controller Audio Codec Speaker © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 3 All Rights Reserved.
    • ALSA Sound Card InterfaceHeader: <linux/sound/core.h>Data Structure: struct snd_cardAPIs int snd_card_create(int idx, const char *id, struct module *module, int extra_size, struct snd_card **card_ret); int snd_card_register(struct snd_card *card); int snd_card_free(struct snd_card *card); Inverse of both the above © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 4 All Rights Reserved.
    • ALSA PCM InterfaceHeader: <linux/sound/pcm.h>Data Structure struct snd_pcm struct snd_pcm_opsAPIs int snd_pcm_new(struct snd_card *card, const char *id, int device, int playback_count, int capture_count, struct snd_pcm **rpcm); void snd_pcm_set_ops(struct snd_pcm * pcm, int direction, struct snd_pcm_ops *ops); int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); // Typically used in hw_params int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); // Typically used in hw_free © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 5 All Rights Reserved.
    • struct pcm_opsint (*open)(struct snd_pcm_substream *substream);int (*close)(struct snd_pcm_substream *substream);int (*ioctl) /* Miscellaneous controls */ (struct snd_pcm_substream * substream, unsigned int cmd, void *arg);int (*hw_params) /* Set h/w params & allocate the buffer */ (struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);int (*hw_free) /* Free the buffer */ (struct snd_pcm_substream *substream);int (*prepare) /* Set audio parameters for transfer */ (struct snd_pcm_substream *substream);int (*trigger) /* Trigger the transfer */ (struct snd_pcm_substream *substream, int cmd); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 6 All Rights Reserved.
    • ALSA Sound Card InterfaceHeader: <linux/sound/control.h>Data Structure: struct snd_kcontrol_newAPIs int snd_ctl_add(struct snd_card * card, struct snd_kcontrol * kcontrol); int snd_ctl_remove(struct snd_card * card, struct snd_kcontrol * kcontrol); © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 7 All Rights Reserved.
    • Porting a Audio DriverStandard Audio Codec Mostly involves changing pin assignments as per the Board DesignNew Audio Codec Complete Driver as per the preceeding discussions, need to be implemented © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 8 All Rights Reserved.
    • Browse some Audio DriversALSA driver examples: sound/ arm/aaci.c soc/soc-*.c {core, pcm, utils}Codec driver examples: sound/ arm/aaci.c soc/codecs/twl4030.cBrowse & Discuss any © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9 All Rights Reserved.
    • What all have we learnt?Introduction to Linux Audio SubsystemAudio Vertical ALSA Sound Core & its Programming I/fAudio Horizontal Audio Codec Driver Audio Controller DriverPutting them all together: Porting © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 10 All Rights Reserved.
    • Any Queries?© 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 11 All Rights Reserved.