User Tools

Site Tools


alsa

This is an old revision of the document!


Alsa

Alsa is used for audio playback.

NX does some initialization of audio:

  • amixer sset PCM 144
  • NxExe prox2 amp

The first command turns up the volume (be aware 144 can be quite loud) and the second asks the PIC32 to enable the power amplifier for the speakers. Keep in mind that the NxExe command toggles the amplifier, and this persists between reboots as long as the pic32 still has power. I assume the proper way is to read out the amp state on boot and toggle if needed.

People have had mixed results with Alsa initialization. One person only had success by running NX:

Saving and restoring alsa device state isn't enough to initialize with from boot. The NX binary is built with miniaudio inside of it so perhaps it does some external hardware initialization of the speaker? Couldn't get miniaudio in a custom binary to work without initializing by running NX. Maybe there's a way to coax out the miniaudio debug logs from a running NX instance.

Another person found that it worked out-of-the-box:

Copying an audio file (in my case, a 44.1kHz mono WAV file) onto the SD card and then playing it with aplay worked even with NX disabled. alsamixer is preinstalled and works for setting the volume.
alsa.1795300868.txt.gz · Last modified: by jazzy