0

It is possible to get information about the sound chip or at least the sound capabilities of the device programatically?

I can't find nothing about it

NullPointerException
  • 36,107
  • 79
  • 222
  • 382
  • Define _"sound chip"_ and _"capabilities"_. What kind of information are you looking for? – Michael Sep 06 '14 at 06:33
  • *sound chip* An obsolete misnomer - almost as bad as *sound card*. Audio functionality is so often a functional unit of larger devices these days. – marko Sep 07 '14 at 17:39

1 Answers1

0

sound chip An obsolete misnomer - almost as bad as sound card.

As you've tagged this question as Android, I assume you're talking about mobile devices. In these systems there two components to the audio system:

  • A streaming engine which is responsible for streaming a stream of serial audio (usually as I2S) to and from memory using DMA. This is implemented as a part of the System On Chip (SoC). These are typically none-enumerable and have a SoC specific device-driver.
  • A codec - really a misnomer as well - which contains at least analoge-digital and digital-analogue converters, and more often has audio mixing and DSP capabilities. The only reason that codecs exist as separate components - rather than getting borged into SoC devices - is manufacturability.

The hardware implementation details are entirely abstracted away from you by Android as can be seen in this architecture diagram. An application's view of the world is essentially a stereo audio at an arbitrary sample rate (the system will convert as necessary).

If you want to know the capabilities in order to circumvent AudioFlinger, or to get a measure of precisely what the hardware of the device comprised - which I imagine you would need to do for any application that is to perform any kind of accurate analysis of incoming audio - this is an entirely different proposition.

Many (but not all) Android devices implement the Audio HAL on top of Alsa, so using its APIs is one possibility. This obviously has to be done in native code.

It's the codec that has the real impact on device capabilities rather than the streaming engine. Codecs are invariable attached by I2C, so you'll be able to discover them in the appropriate directory of sysfs. They also tend to have their own kernel modules as well, so this might be another approach.

marko
  • 9,029
  • 4
  • 30
  • 46
  • _"Codecs are invariable attached by I2C"_. Not necessarily. There are platforms where SLIMbus is used instead, IIRC. – Michael Sep 08 '14 at 05:47