* floating point exception triggered by speaker-test on pc-speaker
@ 2008-11-23 9:30 Alexander E. Patrakov
2008-11-26 13:37 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Alexander E. Patrakov @ 2008-11-23 9:30 UTC (permalink / raw)
To: alsa-devel
Hello,
I have hit a strange bug. To reproduce:
1. Build snd-pcsp.ko.
2. alsamixer -c pcsp, set the base frequency to 37286 Hz
3. $ speaker-test -r 22050 -P 4 -D plughw:pcsp
speaker-test 1.0.18
Playback device is plughw:pcsp
Stream parameters are 22050Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Rate set to 22050Hz (requested 22050Hz)
Buffer size range from 37 to 38756
Period size range from 18 to 19379
Using max buffer size 38756
Periods = 4
was set period_size = 0
was set buffer_size = 38756
0 - Front Left
Floating point exception
I.e., as you see, period size somehow became 0. While debugging this with printfs, I
noticed that the interval for periods in snd_pcm_hw_param_set_near() starts with 4,
but doesn't include it (i.e., is open).
Also, I found that snd_interval_refine_first() and snd_interval_refine_last(), when
given an open interval, refine it to something like (n n+1). This is obviously
wrong, as there are no integer points in this interval. Changing i->max++ and
i->min-- there to adjust the value by 2 did eliminate the floating point exception,
but replaced it with "Unable to set nperiods 4 for playback: Invalid argument". So
there must be something else also wrong, but I can't pinpoint it and give you a
ready-made patch :(
--
Alexander E. Patrakov
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: floating point exception triggered by speaker-test on pc-speaker
2008-11-23 9:30 floating point exception triggered by speaker-test on pc-speaker Alexander E. Patrakov
@ 2008-11-26 13:37 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2008-11-26 13:37 UTC (permalink / raw)
To: Alexander E. Patrakov; +Cc: alsa-devel
At Sun, 23 Nov 2008 14:30:24 +0500,
Alexander E. Patrakov wrote:
>
> Hello,
>
> I have hit a strange bug. To reproduce:
>
> 1. Build snd-pcsp.ko.
>
> 2. alsamixer -c pcsp, set the base frequency to 37286 Hz
>
> 3. $ speaker-test -r 22050 -P 4 -D plughw:pcsp
>
> speaker-test 1.0.18
>
> Playback device is plughw:pcsp
> Stream parameters are 22050Hz, S16_LE, 1 channels
> Using 16 octaves of pink noise
> Rate set to 22050Hz (requested 22050Hz)
> Buffer size range from 37 to 38756
> Period size range from 18 to 19379
> Using max buffer size 38756
> Periods = 4
> was set period_size = 0
> was set buffer_size = 38756
> 0 - Front Left
> Floating point exception
>
> I.e., as you see, period size somehow became 0. While debugging this with printfs, I
> noticed that the interval for periods in snd_pcm_hw_param_set_near() starts with 4,
> but doesn't include it (i.e., is open).
>
> Also, I found that snd_interval_refine_first() and snd_interval_refine_last(), when
> given an open interval, refine it to something like (n n+1). This is obviously
> wrong, as there are no integer points in this interval. Changing i->max++ and
> i->min-- there to adjust the value by 2 did eliminate the floating point exception,
> but replaced it with "Unable to set nperiods 4 for playback: Invalid argument". So
> there must be something else also wrong, but I can't pinpoint it and give you a
> ready-made patch :(
Thanks for reporting. The problem is that speaker-test examines the
parameters before calling snd_pcm_hw_params(). After calling, these
are set properly (even with pcsp driver :)
The fix is committed now.
Takashi
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-11-26 13:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-23 9:30 floating point exception triggered by speaker-test on pc-speaker Alexander E. Patrakov
2008-11-26 13:37 ` Takashi Iwai
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.