I found the following workaround.
After booting, the output device in the audio controller is:
"ear piece"
After plugging in headphones, this switches to
"wired headphones"
(They work with aplay.)
After unplugging, the audio controller switches to
"speaker"
And aplay outputs to the speaker! Here we are.
Summary: Plugging and unplugging the headphones did the trick.