This is for Raspberry Pi 3B, installed with the full 2.5GB version of the latest Raspberry Pi OS downloaded in October 2020. On being unable to play audio via a 2.1W USB speaker with a 3.5mm jack, I found these answers, but PulseAudio wasn't installed and installing alsa-utils etc. didn't work. Surprisingly,
omxplayer -o local xxx.mp3 worked. But audio wasn't playing with VLC or Audacious or Youtube. Audacity is able to record inputs from a USB microphone, but is unable to play the audio. But when I went to the audio settings of Audacious, and selected Alsa, I saw options for
defaultCARD=Headphones - bcm2835. When I selected this, Audacious was able to play audio. But surprisingly, the audio was playing even though the Audacious GUI showed audio as muted. Even using the RPi OS sound level adjustment, I could not control the volume level of the music being played by Audacious. It just played at a constant volume. These are the settings that worked. Every other configuration didn't work.
I'm very puzzled by this behaviour. It's recognizing a speaker as a headphone? Why is it functioning this way and what can I do to send audio output to the system default in such a way that audio in all applications would work and I'd be able to control the volume?
ps: I dearly hope the RPi community would do something about providing the necessary audio and microphone drivers etc. by default, like Ubuntu does. This is not something users should have to break their heads over.