On 10/02/2012 10:38 PM, Tanu Kaskinen wrote: > On Mon, 2012-10-01 at 17:06 +0200, David Henningsson wrote: >> If there is no silence memblock and no data, pa_memblockq_peek can >> return NULL. In this case, do not crash on an assertion in >> pa_memblock_acquire, but instead return a proper error to the client. > > If there is no data in the buffer, pa_stream_peek() is supposed to > return NULL according to the documentation. And it does that: if there's > no data, pa_memblock_peek() will return a negative value, causing > pa_stream_peek() to return NULL. > > The problem is the case where the buffer does contain data, but not at > the read index. That is, there is a hole in the buffer. The client > documentation doesn't have any warnings about holes, so the only safe > way to handle holes is to return silence. Fixing this should be a simple > matter of giving a silence memchunk when creating record_memblockq.
I'm not so sure. Silence, as in all zeroes, might work for S16 audio data, but what about other formats? Compressed audio? Peak audio (which I think is the case here)? Etc. Also maybe it could also be valuable for the client to distinguish between no data available, and valid zero data. How about returning NULL and adding to the documentation something like: -If no data is available this will return a NULL pointer. +If no data is available (at the current read position), this will return a NULL pointer. -- David Henningsson, Canonical Ltd. https://launchpad.net/~diwic -- You received this bug notification because you are a member of Desktop Packages, which is subscribed to pulseaudio in Ubuntu. https://bugs.launchpad.net/bugs/1058200 Title: [sound]: gnome-control-center crashed with SIGABRT in pa_memblock_acquire() Status in “pulseaudio” package in Ubuntu: In Progress Bug description: The Sound panel has been extremely crash-prone for the past oh, maybe 2 weeks. ProblemType: Crash DistroRelease: Ubuntu 12.10 Package: gnome-control-center 1:3.4.2-0ubuntu15 ProcVersionSignature: Ubuntu 3.5.0-15.23-generic 3.5.4 Uname: Linux 3.5.0-15-generic x86_64 ApportVersion: 2.5.2-0ubuntu4 Architecture: amd64 CrashCounter: 1 Date: Wed Sep 26 15:34:20 2012 ExecutablePath: /usr/bin/gnome-control-center ProcCmdline: gnome-control-center --overview Signal: 6 SourcePackage: gnome-control-center StacktraceTop: raise () from /lib/x86_64-linux-gnu/libc.so.6 abort () from /lib/x86_64-linux-gnu/libc.so.6 pa_memblock_acquire () from /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon-2.1.so pa_stream_peek () from /usr/lib/x86_64-linux-gnu/libpulse.so.0 ?? () from /usr/lib/control-center-1/panels/libsound.so Title: [sound]: gnome-control-center crashed with SIGABRT in raise() UpgradeStatus: No upgrade log present (probably fresh install) UserGroups: adm cdrom dip libvirtd lpadmin plugdev sambashare sbuild sudo usr_lib_gnome-control-center: activity-log-manager-control-center 0.9.4-0ubuntu3 deja-dup 23.92-0ubuntu1 gnome-control-center-signon 0.0.17-0ubuntu1 indicator-datetime 12.10.1-0ubuntu1 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1058200/+subscriptions -- Mailing list: https://launchpad.net/~desktop-packages Post to : desktop-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~desktop-packages More help : https://help.launchpad.net/ListHelp