apulse icon indicating copy to clipboard operation
apulse copied to clipboard

Failure setting up channels

Open ismaell opened this issue 8 years ago • 7 comments

The call to snd_pcm_hw_params_set_channels in do_connect_pcm may fail, it should probably be replaced by one of it's alternatives, or at least just not abort if it fails.

ismaell avatar Nov 22 '16 19:11 ismaell

It does for me

[apulse] [error] do_connect_pcm, snd_pcm_hw_params_set_channels, Invalid argument

with Telegram Desktop

sovietspaceship2 avatar Feb 06 '17 22:02 sovietspaceship2

All calls could fail.

In case of snd_pcm_hw_params_set_channels() failing, I don't know what to do. In that case application requested a particular number of channels (1 or 2 usually), but audiodriver said it can't provide that. Should apulse convert/split/mix data in that case?

Also, is this dmix-enabled device? I think, ALSA's plugins should handle format convertions by default.

i-rinat avatar Mar 08 '17 17:03 i-rinat

@sovietspaceship Install alsacap and check with alsacap -d default that the device is configured properly.

You'll probably need to use plug:dmix (playback) and plug:dsnoop (recording) unless you have a high-end card.

You should get something like this:

$ alsacap -d default
*** Exploring configuration space of device `default' for playback ***
1..10000 channels
Sampling rate 4000..4294967295 Hz
Sample formats: S8, U8, S16_LE, S16_BE, U16_LE, U16_BE, S24_LE, S24_BE, U24_LE, U24_BE, S32_LE, S32_BE, U32_LE, U32_BE, FLOAT_LE, FLOAT_BE, FLOAT64_LE, FLOAT64_BE, MU_LAW, A_LAW, IMA_ADPCM, S24_3LE, S24_3BE, U24_3LE, U24_3BE, S20_3LE, S20_3BE, U20_3LE, U20_3BE, S18_3LE, S18_3BE, U18_3LE, U18_3BE

$ alsacap -R -d default
*** Exploring configuration space of device `default' for recording ***
1..10000 channels
Sampling rate 4000..4294967295 Hz
Sample formats: S8, U8, S16_LE, S16_BE, U16_LE, U16_BE, S24_LE, S24_BE, U24_LE, U24_BE, S32_LE, S32_BE, U32_LE, U32_BE, FLOAT_LE, FLOAT_BE, FLOAT64_LE, FLOAT64_BE, MU_LAW, A_LAW, IMA_ADPCM, S24_3LE, S24_3BE, U24_3LE, U24_3BE, S20_3LE, S20_3BE, U20_3LE, U20_3BE, S18_3LE, S18_3BE, U18_3LE, U18_3BE

ismaell avatar Mar 08 '17 19:03 ismaell

I still think it should handle the configuration more dynamically...

ismaell avatar Mar 08 '17 20:03 ismaell

I'm already using dmix and dsnoop; alsacap -d default outputs

*** Exploring configuration space of device `default' for playback *** 1..10000 channels Sampling rate 4000..4294967295 Hz Sample formats: S8, U8, S16_LE, S16_BE, U16_LE, U16_BE, S24_LE, S24_BE, U24_LE, U24_BE, S32_LE, S32_BE, U32_LE, U32_BE, FLOAT_LE, FLOAT_BE, FLOAT64_LE, FLOAT64_BE, MU_LAW, A_LAW, IMA_ADPCM, S24_3LE, S24_3BE, U24_3LE, U24_3BE, S20_3LE, S20_3BE, U20_3LE, U20_3BE, S18_3LE, S18_3BE, U18_3LE, U18_3BE Buffer size range from 170 to 733007751 Period size range from 85 to 91628833 Significant bits: 0

Latest version of Telegram segfaults running under apulse. I opened an issue on their repo because it's probably their fault.

sovietspaceship2 avatar Mar 08 '17 20:03 sovietspaceship2

Can you take a backtrace with GDB?

ismaell avatar Mar 09 '17 22:03 ismaell

Latest version of Telegram segfaults running under apulse.

This is very similar to #43, which was kind of fixed. Also, latest Telegram app seems to be working through apulse just fine. It uses some not implemented functions, but plays audio anyway.

i-rinat avatar Mar 12 '17 19:03 i-rinat