[pulseaudio-discuss] pulseaudio cannot recognise ALSA plughw
Aleksander Kamenik
aleksander at krediidiinfo.ee
Mon Jan 19 16:21:37 PST 2009
Lennart Poettering wrote:
> On Tue, 20.01.09 00:45, Aleksander Kamenik (aleksander at krediidiinfo.ee) wrote:
>
>>> One thing you might try before you file that bug is commenting the
>>> invocation of snd_pcm_hw_params_set_periods_integer() in that
>>> function, recompiling and testing whether that changes the behaviour.
>> I guess your idea was to include a goto finish; right before the
>> problematic code with snd_pcm_hw_params_set_periods_near() by commenting
>> the 'if ((ret = snd_pcm_hw_params_set_periods_integer(pcm_handle,
>> hwparams)) < 0)' line?
>
> No, my idea was to comment the two lines that deal with
> snd_pcm_hw_params_set_periods_integer(), as I said.
>
> i.e., comment these two lines:
>
> <snip>
> if ((ret = snd_pcm_hw_params_set_periods_integer(pcm_handle, hwparams)) < 0)
> goto finish;
> </snip>
Oh, that's how I understood it at the beginning and tried it. This
didn't do anything at all, cause the comparison fails and goto finish;
is not executed. I got exactly the same errors at the same place when
running gdb. And the same behaviour. Of course I might have missed
something, but it looked exactly like my previous run with the original
code. That's why I thought you meant something else.
>
>> However I also tried commenting out the
>> snd_pcm_hw_params_set_periods_near() function calls. Thanks to this my
>> USB sound card popped up in the pulse audio volume control. My
>> integrated nvidia chip worked.
>
> Ah, that's interesting. Apparently your sound card does not support
> integral number of periods. Weird thing. Could you please paste the
> output of "pulseaudio -vvvv" with that minimal commenting change made?
Right. Starting up pulseaudio with this patch:
diff -Naur pulseaudio-0.9.14/src/modules/alsa-util.c
pulseaudio-0.9.14.changed/src/modules/alsa-util.c
--- pulseaudio-0.9.14/src/modules/alsa-util.c 2009-01-13
01:11:38.000000000 +0200
+++ pulseaudio-0.9.14.changed/src/modules/alsa-util.c 2009-01-20
00:25:46.000000000 +0200
@@ -369,11 +369,11 @@
if ((ret = snd_pcm_hw_params_set_periods_integer(pcm_handle,
hwparams)) < 0)
goto finish;
-
+/*
if (_periods > 0) {
- /* First we pass 0 as direction to get exactly what we asked
- * for. That this is necessary is presumably a bug in ALSA */
+ * First we pass 0 as direction to get exactly what we asked
+ * for. That this is necessary is presumably a bug in ALSA *
dir = 0;
if ((ret = snd_pcm_hw_params_set_periods_near(pcm_handle,
hwparams, &_periods, &dir)) < 0) {
@@ -385,7 +385,7 @@
}
}
}
-
+*/
if (_period_size > 0)
if ((ret = snd_pcm_hw_params_set_buffer_size_near(pcm_handle,
hwparams, &buffer_size)) < 0)
goto finish;
Result:
http://pastebin.com/m5eb3e962
>
>> I could send the output stream to the usb card, though no sound would
>> come out nor would the sliders move to indicate playback. Though that
>> didn't crash anything and I could transfer the stream back to the built
>> in sound chip which works.
>>
>> But when tried changing the volume of the USB card, pulseaudio
>> crashed.
>
> It crashed? How? Please provide a "pulsaudio -vvvv" output for the
> crash. And also a stack trace:
>
> http://fedoraproject.org/wiki/StackTraces
I'm unable to reproduce it unfortunately. I'll send the logs once I'll
do though.
About the how part. I tried changing the USB cards volume slider and
suddenly pavucontrol as well as amarok which was playing wouldn't
respond. I had to kill pulseaudio and pavucontrol with the killall
command. Amarok was killed too. Though amarok crashes always when the
sound server goes away, so that's no indicator. Unfortunately I think I
was running pulseaudio without the -vvvv switch.
I'll try to make a habit of running pulseaudio with -vvvv and syslog
logging from gdb.
Regards,
--
Aleksander Kamenik
System Administrator
Krediidiinfo AS
an Experian Company
Phone: +372 665 9649
Email: aleksander at krediidiinfo.ee
http://www.krediidiinfo.ee/
http://www.experiangroup.com/
More information about the pulseaudio-discuss
mailing list