Sound
Microphone, speaker, ringtone speaker and stereo headset are all attached to PCAP2
The original Motorola kernel (the one used in stock EZX phones firmwares) uses an OSS sound driver to access these. There are three sound devices: /dev/dsp, /dev/dsp16 and /dev/audio. I do not know, if /dev/audio has any purpose. /dev/dsp can only output stereo, and /dev/dsp16 can only output mono. Both use signed 16-bit (2'complements) integers. You set /dev/dsp to 8000 or 44100Hz, and /dev/dsp16 only to 8000Hz. (See The Opensound Programmers Guide for a quick howto). You can write raw audio or PCM wave file to the devices and read raw audio from them.
To select the input or output source, open /dev/mixer and ioctl SOUND_MIXER_WRITE_OUTSRC or SOUND_MIXER_RECSRC. OUTSRC can be HEADSET_OUT (mono), LOUDERSPEAKER_OUT, EARPIECE_OUT or HEADJACK_OUT (see ezx-common.h in the kernel). SOUND_MIXER_RECSRC doesnt accept all values it should according to the kernel header file. Setting it to 2 should enable the builtin mono microphone.
For more information on audio support on openezx please refer to PCAP2 Sound