Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-SoundCard for openSUSE:Factory checked in at 2021-08-29 21:33:59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-SoundCard (Old) and /work/SRC/openSUSE:Factory/.python-SoundCard.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-SoundCard" Sun Aug 29 21:33:59 2021 rev:8 rq:914854 version:0.4.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-SoundCard/python-SoundCard.changes 2021-03-05 13:45:35.163639088 +0100 +++ /work/SRC/openSUSE:Factory/.python-SoundCard.new.1899/python-SoundCard.changes 2021-08-29 21:34:13.594699269 +0200 @@ -1,0 +2,9 @@ +Wed Aug 25 08:51:57 UTC 2021 - John Paul Adrian Glaubitz <adrian.glaub...@suse.com> + +- Update to 0.4.1: + * fixes freezing bug on Linux during startup + * improves error reporting on Linux + * fixes crash due to use-after-free on Linux + * fixes unicode error on Windows + +------------------------------------------------------------------- Old: ---- SoundCard-0.4.0.tar.gz New: ---- SoundCard-0.4.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-SoundCard.spec ++++++ --- /var/tmp/diff_new_pack.5pjpFY/_old 2021-08-29 21:34:14.070699928 +0200 +++ /var/tmp/diff_new_pack.5pjpFY/_new 2021-08-29 21:34:14.070699928 +0200 @@ -22,7 +22,7 @@ %define skip_python36 1 %endif Name: python-SoundCard -Version: 0.4.0 +Version: 0.4.1 Release: 0 Summary: Python package to play and record audio License: BSD-3-Clause ++++++ SoundCard-0.4.0.tar.gz -> SoundCard-0.4.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoundCard-0.4.0/PKG-INFO new/SoundCard-0.4.1/PKG-INFO --- old/SoundCard-0.4.0/PKG-INFO 2020-05-26 08:39:19.095513000 +0200 +++ new/SoundCard-0.4.1/PKG-INFO 2021-03-14 13:40:59.074842700 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: SoundCard -Version: 0.4.0 +Version: 0.4.1 Summary: Play and record audio without resorting to CPython extensions Home-page: https://github.com/bastibe/SoundCard Author: Bastian Bechtold @@ -157,6 +157,19 @@ channels for both playback and recording. CoreAudio/macOS defines channel ``-1`` as silence for both playback and recording. + FAQ + --- + Q: How to make it work on a headless Raspberry Pi? + + A: PulseAudio is not installed by default on the Raspberry Pi OS Lite distribution (https://www.raspberrypi.org/software/operating-systems/). In order to use ``soundcard``, you have to install PulseAudio first, and edit the configuration (with a fix to avoid the main output to be in mono-only). :: + + sudo apt install -y python3-pip python3-numpy pulseaudio + sudo nano /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf + # comment the block [Mapping analog-mono] with ';' + pulseaudio -D + python3 -m pip install soundcard + + Known Issues: ------------- @@ -202,6 +215,14 @@ (Thank you, Bob Thomas!) - 2020-05-19 adds compatibility with Windows 7 (Thank you, demberto!) + - 2020-07-22 fixes freezing bug on Linux during startup + (Thank you, zhujisheng!) + - 2020-08-01 improves error reporting on Linux + (Thank you, Rik van Riel!) + - 2020-08-13 fixes crash due to use-after-free on Linux + (Thank you, Rik van Riel!) + - 2021-01-13 fixes unicode error on Windows + (Thank you, paulzzh!) Platform: UNKNOWN Classifier: Development Status :: 4 - Beta diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoundCard-0.4.0/README.rst new/SoundCard-0.4.1/README.rst --- old/SoundCard-0.4.0/README.rst 2020-05-26 08:37:41.000000000 +0200 +++ new/SoundCard-0.4.1/README.rst 2021-03-14 13:37:19.000000000 +0100 @@ -150,6 +150,19 @@ channels for both playback and recording. CoreAudio/macOS defines channel ``-1`` as silence for both playback and recording. +FAQ +--- +Q: How to make it work on a headless Raspberry Pi? + +A: PulseAudio is not installed by default on the Raspberry Pi OS Lite distribution (https://www.raspberrypi.org/software/operating-systems/). In order to use ``soundcard``, you have to install PulseAudio first, and edit the configuration (with a fix to avoid the main output to be in mono-only). :: + + sudo apt install -y python3-pip python3-numpy pulseaudio + sudo nano /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf + # comment the block [Mapping analog-mono] with ';' + pulseaudio -D + python3 -m pip install soundcard + + Known Issues: ------------- @@ -195,3 +208,11 @@ (Thank you, Bob Thomas!) - 2020-05-19 adds compatibility with Windows 7 (Thank you, demberto!) +- 2020-07-22 fixes freezing bug on Linux during startup + (Thank you, zhujisheng!) +- 2020-08-01 improves error reporting on Linux + (Thank you, Rik van Riel!) +- 2020-08-13 fixes crash due to use-after-free on Linux + (Thank you, Rik van Riel!) +- 2021-01-13 fixes unicode error on Windows + (Thank you, paulzzh!) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoundCard-0.4.0/SoundCard.egg-info/PKG-INFO new/SoundCard-0.4.1/SoundCard.egg-info/PKG-INFO --- old/SoundCard-0.4.0/SoundCard.egg-info/PKG-INFO 2020-05-26 08:39:18.000000000 +0200 +++ new/SoundCard-0.4.1/SoundCard.egg-info/PKG-INFO 2021-03-14 13:40:57.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.2 Name: SoundCard -Version: 0.4.0 +Version: 0.4.1 Summary: Play and record audio without resorting to CPython extensions Home-page: https://github.com/bastibe/SoundCard Author: Bastian Bechtold @@ -157,6 +157,19 @@ channels for both playback and recording. CoreAudio/macOS defines channel ``-1`` as silence for both playback and recording. + FAQ + --- + Q: How to make it work on a headless Raspberry Pi? + + A: PulseAudio is not installed by default on the Raspberry Pi OS Lite distribution (https://www.raspberrypi.org/software/operating-systems/). In order to use ``soundcard``, you have to install PulseAudio first, and edit the configuration (with a fix to avoid the main output to be in mono-only). :: + + sudo apt install -y python3-pip python3-numpy pulseaudio + sudo nano /usr/share/pulseaudio/alsa-mixer/profile-sets/default.conf + # comment the block [Mapping analog-mono] with ';' + pulseaudio -D + python3 -m pip install soundcard + + Known Issues: ------------- @@ -202,6 +215,14 @@ (Thank you, Bob Thomas!) - 2020-05-19 adds compatibility with Windows 7 (Thank you, demberto!) + - 2020-07-22 fixes freezing bug on Linux during startup + (Thank you, zhujisheng!) + - 2020-08-01 improves error reporting on Linux + (Thank you, Rik van Riel!) + - 2020-08-13 fixes crash due to use-after-free on Linux + (Thank you, Rik van Riel!) + - 2021-01-13 fixes unicode error on Windows + (Thank you, paulzzh!) Platform: UNKNOWN Classifier: Development Status :: 4 - Beta diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoundCard-0.4.0/SoundCard.egg-info/requires.txt new/SoundCard-0.4.1/SoundCard.egg-info/requires.txt --- old/SoundCard-0.4.0/SoundCard.egg-info/requires.txt 2020-05-26 08:39:18.000000000 +0200 +++ new/SoundCard-0.4.1/SoundCard.egg-info/requires.txt 2021-03-14 13:40:57.000000000 +0100 @@ -1,2 +1,2 @@ -cffi numpy +cffi diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoundCard-0.4.0/setup.py new/SoundCard-0.4.1/setup.py --- old/SoundCard-0.4.0/setup.py 2020-05-26 08:37:56.000000000 +0200 +++ new/SoundCard-0.4.1/setup.py 2021-03-14 13:32:12.000000000 +0100 @@ -2,7 +2,7 @@ setup( name='SoundCard', - version='0.4.0', + version='0.4.1', description='Play and record audio without resorting to CPython extensions', author='Bastian Bechtold', url='https://github.com/bastibe/SoundCard', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoundCard-0.4.0/soundcard/mediafoundation.py new/SoundCard-0.4.1/soundcard/mediafoundation.py --- old/SoundCard-0.4.0/soundcard/mediafoundation.py 2020-05-26 08:29:37.000000000 +0200 +++ new/SoundCard-0.4.1/soundcard/mediafoundation.py 2021-03-14 13:30:27.000000000 +0100 @@ -2,12 +2,14 @@ import os import cffi -import numpy -import time import re +import time +import struct import collections import platform +import numpy + _ffi = cffi.FFI() _package_dir, _ = os.path.split(__file__) with open(os.path.join(_package_dir, 'mediafoundation.py.h'), 'rt') as f: @@ -369,7 +371,7 @@ for idx in range(256): if data[idx] == 0: break - devicename = ''.join(chr(c) for c in data[0:idx]) + devicename = struct.pack('h' * idx, *data[0:idx]).decode('utf-16') _com.release(ppPropertyStore) return devicename diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoundCard-0.4.0/soundcard/pulseaudio.py new/SoundCard-0.4.1/soundcard/pulseaudio.py --- old/SoundCard-0.4.0/soundcard/pulseaudio.py 2020-04-28 16:14:27.000000000 +0200 +++ new/SoundCard-0.4.1/soundcard/pulseaudio.py 2021-03-14 13:30:27.000000000 +0100 @@ -67,8 +67,9 @@ _pa.pa_context_connect(self.context, _ffi.NULL, _pa.PA_CONTEXT_NOFLAGS, _ffi.NULL) _pa.pa_threaded_mainloop_start(self.mainloop) - while self._pa_context_get_state(self.context) != _pa.PA_CONTEXT_READY: + while self._pa_context_get_state(self.context) in (_pa.PA_CONTEXT_UNCONNECTED, _pa.PA_CONTEXT_CONNECTING, _pa.PA_CONTEXT_AUTHORIZING, _pa.PA_CONTEXT_SETTING_NAME): time.sleep(0.001) + assert self._pa_context_get_state(self.context)==_pa.PA_CONTEXT_READY @staticmethod def _infer_program_name(): @@ -236,6 +237,7 @@ _pa_context_drain = _lock(_pa.pa_context_drain) _pa_context_disconnect = _lock(_pa.pa_context_disconnect) _pa_context_unref = _lock(_pa.pa_context_unref) + _pa_context_errno = _lock(_pa.pa_context_errno) _pa_operation_get_state = _lock(_pa.pa_operation_get_state) _pa_operation_unref = _lock(_pa.pa_operation_unref) _pa_stream_get_state = _lock(_pa.pa_stream_get_state) @@ -288,7 +290,7 @@ Parameters ---------- id : int or str - can be an int index, a backend id, a substring of the + can be a backend id string (Windows, Linux) or a device id int (MacOS), a substring of the speaker name, or a fuzzy-matched pattern for the speaker name. Returns @@ -350,7 +352,7 @@ Parameters ---------- id : int or str - can be an int index, a backend id, a substring of the + can be a backend id string (Windows, Linux) or a device id int (MacOS), a substring of the speaker name, or a fuzzy-matched pattern for the speaker name. include_loopback : bool allow recording of speaker outputs @@ -642,8 +644,10 @@ if not _pulse._pa_sample_spec_valid(samplespec): raise RuntimeError('invalid sample spec') - channelmap = _ffi.new("pa_channel_map*") - channelmap = _pa.pa_channel_map_init_auto(channelmap, samplespec.channels, _pa.PA_CHANNEL_MAP_DEFAULT) + # pam and channelmap refer to the same object, but need different + # names to avoid garbage collection trouble on the Python/C boundary + pam = _ffi.new("pa_channel_map*") + channelmap = _pa.pa_channel_map_init_auto(pam, samplespec.channels, _pa.PA_CHANNEL_MAP_DEFAULT) if isinstance(self.channels, collections.Iterable): for idx, ch in enumerate(self.channels): channelmap.map[idx] = ch+1 @@ -651,6 +655,9 @@ raise RuntimeError('invalid channel map') self.stream = _pulse._pa_stream_new(_pulse.context, self._name.encode(), samplespec, channelmap) + if not self.stream: + errno = _pulse._pa_context_errno(_pulse.context) + raise RuntimeError("stream creation failed with error ", errno) bufattr = _ffi.new("pa_buffer_attr*") bufattr.maxlength = 2**32-1 # max buffer length numchannels = self.channels if isinstance(self.channels, int) else len(self.channels) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/SoundCard-0.4.0/soundcard/pulseaudio.py.h new/SoundCard-0.4.1/soundcard/pulseaudio.py.h --- old/SoundCard-0.4.0/soundcard/pulseaudio.py.h 2020-04-28 16:14:27.000000000 +0200 +++ new/SoundCard-0.4.1/soundcard/pulseaudio.py.h 2021-03-14 13:30:27.000000000 +0100 @@ -159,6 +159,7 @@ typedef struct pa_spawn_api pa_spawn_api; int pa_context_connect(pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api); void pa_context_disconnect(pa_context *c); +int pa_context_errno(const pa_context *c); typedef enum pa_context_state { PA_CONTEXT_UNCONNECTED, PA_CONTEXT_CONNECTING,