Bug#697121: vlc: sudden very loud sound to cause hearing demage

Felipe Sateler fsateler at debian.org
Mon Jun 9 18:51:53 UTC 2014


On Sat, Jun 7, 2014 at 1:18 AM, Rémi Denis-Courmont <remi at remlab.net> wrote:
> Le vendredi 6 juin 2014, 19:32:30 Felipe Sateler a écrit :
>> > Unfortunately, VLC cannot get the PulseAudio volume until after audio
>> > playback starts. There is no way to fix this on VLC side: there is no API
>> > in libpulse to get the volume of an application until after a sink
>> > input/stream is created.
>> What about pa_context_get_sink_info_by_name? With that you can get the
>> volume of the default sink by specifying NULL as the sink name.
>
> That will only work the first time you use a media player ever. Afterward,
> PulseAudio will remember a volume for the media player role, that is distinct
> from the default sink volume - with default settings.
>
> In other words, this does not work.

OK, thanks for explaining. I see that vlc creates the stream when it
starts playback and destroys it when stopped (although not pause).

This leaves the following options:

1. Pulseaudio could add a function to get the volume an output/input
sink/source stream would get if it were created.
2. VLC could create the stream on startup and destroy it on exit. This
is what Clementine seems to do.
3. VLC could, at startup, create a stream, get the volume and destroy
the stream.

Are there problems with going with option 2? This option has the added
benefit the volume can potentially be controlled by another program
before starting playback.


-- 

Saludos,
Felipe Sateler



More information about the pkg-pulseaudio-devel mailing list