Bug 98475

Summary: pacat fails in pa_stream_write() for some channel counts
Product: PulseAudio Reporter: Tanu Kaskinen <tanuk>
Component: clientsAssignee: Ahmed S. Darwish <darwish.07>
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 96750    

Description Tanu Kaskinen 2016-10-28 15:22:25 UTC
pacat --channels=1 /dev/zero    works
pacat --channels=2 /dev/zero    works
pacat --channels=3 /dev/zero    pa_stream_write() failed: Invalid argument
pacat --channels=4 /dev/zero    works
pacat --channels=5 /dev/zero    pa_stream_write() failed: Invalid argument
pacat --channels=6 /dev/zero    pa_stream_write() failed: Invalid argument
pacat --channels=7 /dev/zero    pa_stream_write() failed: Invalid argument
pacat --channels=8 /dev/zero    works
Comment 1 Tanu Kaskinen 2016-10-28 15:23:08 UTC
It looks like some very basic stuff is broken. Marking as a release blocker.
Comment 2 Ahmed S. Darwish 2016-11-22 20:37:21 UTC
These are 3 bugs in one psymptom ;-) Fixes for the first two are sent here:

    https://lists.freedesktop.org/archives/pulseaudio-discuss/2016-November/027175.html

    https://lists.freedesktop.org/archives/pulseaudio-discuss/2016-November/027176.html

Due to the above two fixes, commands like below ones now work succesfully:

    pacat --channels=3 /dev/urandom
    pacat --channels=5 /dev/urandom

Third issue can be reproduced with the following command:

    pacat  --channels=3 /dev/random

Note device change from urandom to random. Above final issue makes pa_stream_write() fails with EINVAL due to misaligned audio - which resulted from an incomplete pa_read() due to /dev/random strict randomness semantics. Maybe we should use a ring buffer in that case. Third patch to be sent soon.
Comment 3 Tanu Kaskinen 2016-11-24 19:13:28 UTC
The two patches have now been applied.
Comment 4 Ahmed S. Darwish 2016-11-28 04:08:22 UTC
Fixes for the third and final issue mentioned in the above is now submitted at:

    https://lists.freedesktop.org/archives/pulseaudio-discuss/2016-November/027193.html

    https://lists.freedesktop.org/archives/pulseaudio-discuss/2016-November/027194.html
Comment 5 Ahmed S. Darwish 2016-12-17 07:07:23 UTC
Updated version of the last patch sent here:

    https://lists.freedesktop.org/archives/pulseaudio-discuss/2016-December/027254.html

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.