Ticket #133 (closed defect: fixed)
ALSA's SND_PCM_FORMAT_U16_BE (and LE) not supported, Allegro fails to initialize sound
| Reported by: | izm | Owned by: | lennart |
|---|---|---|---|
| Milestone: | Component: | module-alsa-* | |
| Keywords: | allegro alsa format snd_pcm_format | Cc: | steven.w.j.brown@… |
Description
Not sure which project this is a bug of, but I figured I'd let you guys know and sort it out, since you'd be much more capable than me. :)
I'm using Pulseaudio o.9.5, Advanced Linux Sound Architecture Driver Version 1.0.14rc1, and Allegro 4.2. When Allegro (it's a cross-platform game development library, similar to SDL) attempts to initialize sound using ALSA, it fails with this message:
ALSA: snd_pcm_hw_params_set_format(pcm_handle, hwparams, format) : Invalid argument
If I kill the pulseaudio daemon, it works (not going through pulseaudio, I guess). I'm unfamiliar with all this, but I looked at the allegro sources, and it looks like they're supporting alsa version 0.9 (and 0.5)... which is backwards compatible with ALSA but not Pulseaudio?
I've attached a simple program that performs a few tests and will generate the error on my system. I'm sorry if this is the wrong place to post this bug, but I wasn't sure where to put it. Suggestions?
Thanks.
Here's the output from the sample program when pulseaudio is running:
detect_digi_driver() attempts:_____________
DIGI_AUTODETECT: num channels: 65535
DIGI_NONE: num channels: 65535
DIGI_OSS: not detected
DIGI_ESD: num channels: 64
DIGI_ARTS: num channels: 65535
DIGI_ALSA: num channels: 64
DIGI_JACK: num channels: 65535
install_sound attempts:_____________
install_sound ()
using: DIGI/MIDI_AUTODETECT and DIGI/MIDI_AUTODETECT
ALSA lib rawmidi_hw.c:233:(snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failed: No such file or directory
Failed
ALSA: snd_pcm_hw_params_set_format(pcm_handle, hwparams, format) : Invalid argument
install_sound ()
using: DIGI/MIDI_AUTODETECT and DIGI/MIDI_NONE
Failed
ALSA: snd_pcm_hw_params_set_format(pcm_handle, hwparams, format) : Invalid argument
install_sound ()
using: DIGI_OSS and DIGI/MIDI_NONE
Failed
/dev/dsp: Device or resource busy
install_sound ()
using: DIGI_ESD and DIGI/MIDI_NONE
Succeeded
install_sound ()
using: DIGI_ARTS and DIGI/MIDI_NONE
Failed
ALSA: snd_pcm_hw_params_set_format(pcm_handle, hwparams, format) : Invalid argument
install_sound ()
using: DIGI_ALSA and DIGI/MIDI_NONE
Failed
ALSA: snd_pcm_hw_params_set_format(pcm_handle, hwparams, format) : Invalid argument
install_sound ()
using: DIGI_JACK and DIGI/MIDI_NONE
Failed
ALSA: snd_pcm_hw_params_set_format(pcm_handle, hwparams, format) : Invalid argument
After I kill pulseaudio, I get this output:
detect_digi_driver() attempts:_____________
DIGI_AUTODETECT: num channels: 65535
DIGI_NONE: num channels: 65535
DIGI_OSS: num channels: 64
DIGI_ESD: not detected
DIGI_ARTS: num channels: 65535
*** PULSEAUDIO: Unable to connect: Connection refused
DIGI_ALSA: not detected
DIGI_JACK: num channels: 65535
install_sound attempts:_____________
install_sound ()
using: DIGI/MIDI_AUTODETECT and DIGI/MIDI_AUTODETECT
*** PULSEAUDIO: Unable to connect: Connection refused
ALSA lib rawmidi_hw.c:233:(snd_rawmidi_hw_open) open /dev/snd/midiC0D0 failed: No such file or directory
Failed
No supported synth type found
install_sound ()
using: DIGI/MIDI_AUTODETECT and DIGI/MIDI_NONE
*** PULSEAUDIO: Unable to connect: Connection refused
Succeeded
install_sound ()
using: DIGI_OSS and DIGI/MIDI_NONE
Succeeded
install_sound ()
using: DIGI_ESD and DIGI/MIDI_NONE
Failed
No server: can not open
install_sound ()
using: DIGI_ARTS and DIGI/MIDI_NONE
*** PULSEAUDIO: Unable to connect: Connection refused
Succeeded
install_sound ()
using: DIGI_ALSA and DIGI/MIDI_NONE
*** PULSEAUDIO: Unable to connect: Connection refused
Failed
Can not open card/pcm device
install_sound ()
using: DIGI_JACK and DIGI/MIDI_NONE
*** PULSEAUDIO: Unable to connect: Connection refused
Succeeded
(not sure if that's useful... .)
