SlideShare una empresa de Scribd logo
1 de 11
Audio Drivers



© 2010 Anil Kumar Pugalia <email@sarika-pugs.com>
               All Rights Reserved.
What to Expect?
Introduction to Linux' Audio Subsystem
Audio Vertical: Sound Core
Audio Horizontal
Putting 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 Interface
Header: <linux/sound/core.h>
Data Structure: struct snd_card
APIs
  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 Interface
Header: <linux/sound/pcm.h>
Data Structure
  struct snd_pcm
  struct snd_pcm_ops
APIs
  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_ops
int (*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 Interface
Header: <linux/sound/control.h>
Data Structure: struct snd_kcontrol_new
APIs
  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 Driver
Standard Audio Codec
 Mostly involves changing pin assignments as
 per the Board Design
New 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 Drivers
ALSA driver examples: sound/
 arm/aaci.c
 soc/soc-*.c {core, pcm, utils}
Codec driver examples: sound/
 arm/aaci.c
 soc/codecs/twl4030.c
Browse & Discuss any


        © 2010 Anil Kumar Pugalia <email@sarika-pugs.com>   9
                       All Rights Reserved.
What all have we learnt?
Introduction to Linux' Audio Subsystem
Audio Vertical
  ALSA Sound Core & its Programming I/f
Audio Horizontal
  Audio Codec Driver
  Audio Controller Driver
Putting 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.

Más contenido relacionado

La actualidad más candente

Android audio system(audio_hardwareinterace)
Android audio system(audio_hardwareinterace)Android audio system(audio_hardwareinterace)
Android audio system(audio_hardwareinterace)fefe7270
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchlinuxlab_conf
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequenceHoucheng Lin
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overviewArjun Reddy
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal BootloaderSatpal Parmar
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALOpersys inc.
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device driversHoucheng Lin
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardAnne Nicolas
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)Nanik Tolaram
 
Android audio system(audioplicy_service)
Android audio system(audioplicy_service)Android audio system(audioplicy_service)
Android audio system(audioplicy_service)fefe7270
 

La actualidad más candente (20)

Embedded Android : System Development - Part III
Embedded Android : System Development - Part IIIEmbedded Android : System Development - Part III
Embedded Android : System Development - Part III
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Embedded Android : System Development - Part IV
Embedded Android : System Development - Part IVEmbedded Android : System Development - Part IV
Embedded Android : System Development - Part IV
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Android audio system(audio_hardwareinterace)
Android audio system(audio_hardwareinterace)Android audio system(audio_hardwareinterace)
Android audio system(audio_hardwareinterace)
 
SPI Drivers
SPI DriversSPI Drivers
SPI Drivers
 
Embedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernelEmbedded Linux Kernel - Build your custom kernel
Embedded Linux Kernel - Build your custom kernel
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Jagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratchJagan Teki - U-boot from scratch
Jagan Teki - U-boot from scratch
 
USB Drivers
USB DriversUSB Drivers
USB Drivers
 
Uboot startup sequence
Uboot startup sequenceUboot startup sequence
Uboot startup sequence
 
08 android multimedia_framework_overview
08 android multimedia_framework_overview08 android multimedia_framework_overview
08 android multimedia_framework_overview
 
U Boot or Universal Bootloader
U Boot or Universal BootloaderU Boot or Universal Bootloader
U Boot or Universal Bootloader
 
Linux Porting
Linux PortingLinux Porting
Linux Porting
 
Android's HIDL: Treble in the HAL
Android's HIDL: Treble in the HALAndroid's HIDL: Treble in the HAL
Android's HIDL: Treble in the HAL
 
Video Drivers
Video DriversVideo Drivers
Video Drivers
 
Arm device tree and linux device drivers
Arm device tree and linux device driversArm device tree and linux device drivers
Arm device tree and linux device drivers
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
"Learning AOSP" - Android Hardware Abstraction Layer (HAL)
 
Android audio system(audioplicy_service)
Android audio system(audioplicy_service)Android audio system(audioplicy_service)
Android audio system(audioplicy_service)
 

Destacado (12)

Kernel Programming
Kernel ProgrammingKernel Programming
Kernel Programming
 
Low-level Accesses
Low-level AccessesLow-level Accesses
Low-level Accesses
 
Block Drivers
Block DriversBlock Drivers
Block Drivers
 
Serial Drivers
Serial DriversSerial Drivers
Serial Drivers
 
Platform Drivers
Platform DriversPlatform Drivers
Platform Drivers
 
Network Drivers
Network DriversNetwork Drivers
Network Drivers
 
PCI Drivers
PCI DriversPCI Drivers
PCI Drivers
 
File System Modules
File System ModulesFile System Modules
File System Modules
 
Interrupts
InterruptsInterrupts
Interrupts
 
Introduction to Linux Drivers
Introduction to Linux DriversIntroduction to Linux Drivers
Introduction to Linux Drivers
 
Character Drivers
Character DriversCharacter Drivers
Character Drivers
 
I2C Drivers
I2C DriversI2C Drivers
I2C Drivers
 

Similar a Audio Drivers

Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversAnil Kumar Pugalia
 
my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 infoisky guard
 
SBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board ComputerSBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board Computeryclinda666
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)ijceronline
 
Electronics Engineer Portfolio
Electronics Engineer PortfolioElectronics Engineer Portfolio
Electronics Engineer PortfolioAnupama Sujith
 
Industry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solutionIndustry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solutionAnalog Devices, Inc.
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android晓东 杜
 
Nios2 and ip core
Nios2 and ip coreNios2 and ip core
Nios2 and ip coreanishgoel
 
Motherboard and its components
Motherboard and its componentsMotherboard and its components
Motherboard and its componentskshirsagarmrk
 
Track F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicsTrack F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicschiportal
 
Asterisk - el futuro es REST
Asterisk - el futuro es RESTAsterisk - el futuro es REST
Asterisk - el futuro es RESTOpenDireito
 
System_on_Chip_SOC.ppt
System_on_Chip_SOC.pptSystem_on_Chip_SOC.ppt
System_on_Chip_SOC.pptzahixdd
 

Similar a Audio Drivers (20)

Embedded I/O Management
Embedded I/O ManagementEmbedded I/O Management
Embedded I/O Management
 
Mobile Hacking using Linux Drivers
Mobile Hacking using Linux DriversMobile Hacking using Linux Drivers
Mobile Hacking using Linux Drivers
 
Choosing the right processor
Choosing the right processorChoosing the right processor
Choosing the right processor
 
my Windows 7 info
my Windows 7 infomy Windows 7 info
my Windows 7 info
 
SBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board ComputerSBC6020 SAM9G20 based Single Board Computer
SBC6020 SAM9G20 based Single Board Computer
 
International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)International Journal of Computational Engineering Research(IJCER)
International Journal of Computational Engineering Research(IJCER)
 
Electronics Engineer Portfolio
Electronics Engineer PortfolioElectronics Engineer Portfolio
Electronics Engineer Portfolio
 
Industry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solutionIndustry’s performance leading ultra low-power dsp solution
Industry’s performance leading ultra low-power dsp solution
 
Embedded Android
Embedded AndroidEmbedded Android
Embedded Android
 
AXONIM Devices presentation
AXONIM Devices presentationAXONIM Devices presentation
AXONIM Devices presentation
 
Nios2 and ip core
Nios2 and ip coreNios2 and ip core
Nios2 and ip core
 
Motherboard and its components
Motherboard and its componentsMotherboard and its components
Motherboard and its components
 
Arduino
ArduinoArduino
Arduino
 
Track F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonicsTrack F- Designing the kiler soc - sonics
Track F- Designing the kiler soc - sonics
 
Asterisk - el futuro es REST
Asterisk - el futuro es RESTAsterisk - el futuro es REST
Asterisk - el futuro es REST
 
Начало работы с Intel IoT Dev Kit
Начало работы с Intel IoT Dev KitНачало работы с Intel IoT Dev Kit
Начало работы с Intel IoT Dev Kit
 
Resume
ResumeResume
Resume
 
Craneboard
CraneboardCraneboard
Craneboard
 
Embedded Storage Management
Embedded Storage ManagementEmbedded Storage Management
Embedded Storage Management
 
System_on_Chip_SOC.ppt
System_on_Chip_SOC.pptSystem_on_Chip_SOC.ppt
System_on_Chip_SOC.ppt
 

Más de Anil Kumar Pugalia (20)

File System Modules
File System ModulesFile System Modules
File System Modules
 
Kernel Debugging & Profiling
Kernel Debugging & ProfilingKernel Debugging & Profiling
Kernel Debugging & Profiling
 
Processes
ProcessesProcesses
Processes
 
System Calls
System CallsSystem Calls
System Calls
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 
Embedded C
Embedded CEmbedded C
Embedded C
 
Embedded Software Design
Embedded Software DesignEmbedded Software Design
Embedded Software Design
 
Playing with R L C Circuits
Playing with R L C CircuitsPlaying with R L C Circuits
Playing with R L C Circuits
 
Shell Scripting
Shell ScriptingShell Scripting
Shell Scripting
 
References
ReferencesReferences
References
 
Functional Programming with LISP
Functional Programming with LISPFunctional Programming with LISP
Functional Programming with LISP
 
Power of vi
Power of viPower of vi
Power of vi
 
gcc and friends
gcc and friendsgcc and friends
gcc and friends
 
"make" system
"make" system"make" system
"make" system
 
Hardware Design for Software Hackers
Hardware Design for Software HackersHardware Design for Software Hackers
Hardware Design for Software Hackers
 
RPM Building
RPM BuildingRPM Building
RPM Building
 
Linux User Space Debugging & Profiling
Linux User Space Debugging & ProfilingLinux User Space Debugging & Profiling
Linux User Space Debugging & Profiling
 
Linux Network Management
Linux Network ManagementLinux Network Management
Linux Network Management
 
System Calls
System CallsSystem Calls
System Calls
 
Timers
TimersTimers
Timers
 

Último

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 

Último (20)

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 

Audio Drivers

  • 1. Audio Drivers © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> All Rights Reserved.
  • 2. What to Expect? Introduction to Linux' Audio Subsystem Audio Vertical: Sound Core Audio Horizontal Putting them all together: Porting © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 2 All Rights Reserved.
  • 3. 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.
  • 4. ALSA Sound Card Interface Header: <linux/sound/core.h> Data Structure: struct snd_card APIs 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.
  • 5. ALSA PCM Interface Header: <linux/sound/pcm.h> Data Structure struct snd_pcm struct snd_pcm_ops APIs 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.
  • 6. struct pcm_ops int (*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.
  • 7. ALSA Sound Card Interface Header: <linux/sound/control.h> Data Structure: struct snd_kcontrol_new APIs 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.
  • 8. Porting a Audio Driver Standard Audio Codec Mostly involves changing pin assignments as per the Board Design New 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.
  • 9. Browse some Audio Drivers ALSA driver examples: sound/ arm/aaci.c soc/soc-*.c {core, pcm, utils} Codec driver examples: sound/ arm/aaci.c soc/codecs/twl4030.c Browse & Discuss any © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 9 All Rights Reserved.
  • 10. What all have we learnt? Introduction to Linux' Audio Subsystem Audio Vertical ALSA Sound Core & its Programming I/f Audio Horizontal Audio Codec Driver Audio Controller Driver Putting them all together: Porting © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 10 All Rights Reserved.
  • 11. Any Queries? © 2010 Anil Kumar Pugalia <email@sarika-pugs.com> 11 All Rights Reserved.