Hi Dan, 

Sorry for the delay - busy weekend here!  I'll do more testing as requested 
an update you with the results.
An observation I had is that the behavior is a bit strange when viewed in 
the system mixer (for example, the "applications" tab of the "Sounds" 
section under the Gnome environment). When using OpenAL, you see a single 
application appear, even when using the fire and forget Players. With 
PulseAudio, you see a new "application" appear for each and every Player 
created. For fire and forget Players, they appear and dissapear rapidly as 
the Players are garbage collected. With normal reusable Players, you just 
see a few redundant PulseAudio clients connected and sitting there (instead 
of just one, like with OpenAL). 

In the PulseAudio documentation, there is a section at the bottom of this 
page entitled "Synchronizing Multiple Playback Streams":
https://freedesktop.org/software/pulseaudio/doxygen/streams.html
It looks like we might need to reuse a main PulseAudio "master stream".
I looked in the pulseaudio/interface.py file, there is a #TODO next to this 
exact thing in the "connect_playback" method from line 477. My 
understanding is that we need to keep a reference to a single "master 
stream" somewhere, and all Players created after that will send data to 
this same stream. 

Sorry if that is hard to follow, but let me know and I'll try to clarify. 
In the mean time, I'll see if I can do those tests. 
-Ben






On Sunday, December 10, 2017 at 5:39:12 PM UTC+9, Daniel Gillet wrote:
>
> I'm still investigating the issue with playing multiple sounds on 
> PulseAudio.
>
> Benjamin, if I try to use a list of Players, instead of using 
> fire-and-forget players, I still have the sound problem. Could you please 
> try again on your end and let me know if this is indeed the case. Maybe 
> also create more players - say 20 instead of 5 - to allow a lot of players 
> to play together. I would also recommend increasing the duration of the 
> notes in synthesizer.py to have the time to play enough Player 
> simultaneously.
>
> I also noticed a problem in examples/noisy/noisy.py. With PulseAudio it 
> seems that the sound is cut too ealry and I don't hear correctly the sound. 
> Could you please also let me know if you've got the same problem?
>
> I must say I've spent hours on this but I don't seem to find the culprit. 
> The thing that worried me in the PulseAudio Stream documentation 
> <https://freedesktop.org/software/pulseaudio/doxygen/streams.html> was :
>
>
>
> *Note: there is a user-controllable slider in mixer applications such as 
> pavucontrol corresponding to each of the created streams. Multiple 
> (especially identically named) volume sliders for the same application 
> might confuse the user. Also, the server supports only a limited number of 
> simultaneous streams. Because of this, it is not always appropriate to 
> create multiple streams in one application that needs to output multiple 
> sounds. The rough guideline is: if there is no use case that would require 
> separate user-initiated volume changes for each stream, perform the mixing 
> inside the application.*Still digging...
> Dan
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/pyglet-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to