Thanks @Giedrius,
you have been helping me tremendously. Just disabling jack and having
defaults.ctl.card 1
defaults.pcm.card 1
in /etc/asound.conf
was not enough to set the pisound card (card 1) as default.
aplay -D default ~/path/to/my_audio48kHz16bit.wav
would still be playing the audio through the 3.5 mm headphone jack.
I investigated further and read on the Raspberry StackExchange a lengthy post about how to Set an external USB as default ALSA device. And assured by your comment from 6,5 years ago, as an experiment, I removed PulseAudio
sudo apt-get remove pulseaudio
Only then, after a reboot, the default ALSA device really is the pisound card.
aplay -D default ~/path/to/my_audio48kHz16bit.wav
is finally playing from the pisound card.
However, … this is still not a solution for my problem
(I want to play multiple .wav files simultaneously using the python simpleaudio
library )
Because if I remove PulseAudio, the python script is only playing the first note. When it attempts to play the second note it crashes:
Traceback (most recent call last):
[...]
play_id = _sa._play_buffer(audio_data, num_channels, bytes_per_sample,
_simpleaudio.SimpleaudioError: Error opening PCM device. -- CODE: -16 -- MSG: Device or resource busy
So this Device or resource busy
tells me that indeed, like you wrote
And it seems not just one program exclusively (it is one python script), but even only one play call invocation at a time. This is clearly not the way to go for my sequencer/sampler.
So I think I do need PulseAudio, and the pulseaudio-module-jack if I want to use this python library.