Commit Graph

59 Commits

Author SHA1 Message Date
Lars Immisch
f07627543c Update documentation 2020-07-10 00:45:57 +02:00
Lars Immisch
2a21bf6c42 Support all essential parameters in alsapcm_new. 2020-07-08 22:39:46 +02:00
stalkerg
8fbc04e18d fix generate switch capabilities 2020-05-21 17:21:40 +09:00
Lars Immisch
8ed9f924cd Attempt to fix #45 2020-04-23 21:36:29 +01:00
Lars Immisch
046e7c4e87 Get rid of warnings, adjust CHANGES 2020-04-01 22:47:11 +02:00
Lars Immisch
a4c4c7cb62 Consistent indentation and some code style changes (whould be ws only) 2020-03-09 22:28:08 +01:00
Lars Immisch
f478797f6f Merge branch 'dev/card-detail' of https://github.com/jdstmporter/pyalsaaudio into jdstmporter-dev/card-detail 2020-03-09 22:07:23 +01:00
Julian Porter
f244a70111 tidied up 2020-03-06 20:06:59 +00:00
Julian Porter
be1b3e131d demo 2020-03-05 00:50:30 +00:00
Danny
8abf06bedf Prevent hang on close after capturing audio
Currently, after recording audio using pyalsaaudio, the client is unable to close the device.

The reason is that PulseAudio client tries to drain the pipe to the PulseAudio server (presumably in order to prevent Broken Pipe error) on closing. That will never finish since new data will always arrive in the pipe.

Worse, the __del__ handler was auto-closing and thus auto-hanging.

Therefore, pause before de-allocating.
2019-12-02 21:39:44 +00:00
Lars Immisch
dcc831e607 Merge pull request #44 from Oranos25/contribution
add support for snd_pcm_drop function
2019-11-14 13:24:36 +01:00
Lars Immisch
25717020ef Transactional semantics for the alsapcm_set* calls 2018-02-28 09:52:53 +00:00
Lars Immisch
1aae655d24 Update periodsize only after alsapcm_setup succeeded 2018-02-28 00:35:26 +01:00
Jesus Cea
f2fb61d324 Unlimited setperiod buffer size when reading frames 2018-02-20 11:52:47 +01:00
Anthony Piau
9e79494a95 add support for snd_pcm_drop function 2017-12-28 16:30:32 +00:00
Michał Šrajer
40a1219dac Support 24bit audio
SND_PCM_FORMAT_S24_LE and similar are for 24bit ints packed in 4-bytes each.
There is a similar family of formats for 3-bytes packed data (as stored in 24bit wave files).

This commit:
 - adds S24_3LE, S24_3BE, U24_3LE, U24_3BE PCM formats to the alsaaudio.c
 - updates documentation
 - updates playwav.py to correctly play typical 24Bit PCM wave files

Closes #38
2017-08-29 19:09:54 +02:00
Lars Immisch
f19d139f64 Fix C-API usage for Python 3. Closes #29 2017-02-24 13:25:36 +01:00
Lars Immisch
88f38284bb Update documentation. Closes #18
Make sure no other setup.py from `sys.path` is accidentally loaded
2017-02-22 19:41:57 +01:00
Chris Diamand
2314aaeb7e Add functions for listing cards and their names
The cards() method does not guarantee that the index in its return
value is the same as the actual card index. Provide a way to get this
information in the form of a card_indexes() function, returning a
list of available card indexes.

Add another method, card_name(), which, given a card index, returns
the short and long names of that card.
2017-02-08 21:48:49 +00:00
Chris Diamand
bf24ec65ca Add a method for setting enums
Add a method, setenum(), for setting the value of an enumerated mixer
element. The argument is an integer index into the list of possible
values returned by getenum().
2017-02-08 20:50:23 +00:00
Paul Donohue
891a30eb08 Add Mixer.handleevents() to acknowledge events identified by select.poll 2016-10-21 12:21:14 -04:00
Jurgen Kramer
fa10bf6999 Make DSD support depend on ALSA lib version
This patch makes ALSA DSD sample format support depend on the ALSA lib version.
2015-09-25 15:07:49 +02:00
Jurgen Kramer
7de446c3c7 Add DSD sample formats
This patch adds support for using the ALSA DSD sample formats avaiable in
recents kernel/ALSA versions.
2015-09-25 13:34:10 +02:00
Lars Immisch
0e84b51a08 device=None is an error 2015-05-12 09:34:10 +02:00
Lars Immisch
8de9c92791 Undo the argument name/order incompatibility
(Most of it, anyway - the mixers functions have slightly different
defaults now)

Improve the documentation
2015-05-12 09:24:11 +02:00
Lars Immisch
a83979a71e Fix get_pcmtype for Python2.7 2015-05-11 08:18:40 +00:00
Lars Immisch
750140c278 Fix compatibility with Python 2.7 2015-05-10 01:02:10 +00:00
Lars Immisch
d28b117c22 Whitespace 2015-05-10 02:22:24 +02:00
Lars Immisch
ed5ecccc97 Fix logic error, whitespace 2015-05-10 02:21:44 +02:00
Lars Immisch
369b202e04 Unify handling of pcmtype/direction 2015-05-10 02:07:15 +02:00
Lars Immisch
3e5f3bd14b Improve error messages 2015-05-10 00:22:40 +02:00
Lars Immisch
cb6fc6231c Add pcms function, unify arguments.
Also, fix some memory leaks in error cases
2015-05-09 21:39:00 +02:00
Lars Immisch
7e2e99d072 Better (but not 100% backward compatible) device selection for mixers/PCM 2015-05-09 05:52:50 +00:00
Lars Immisch
5e8a08bc26 Fix memory leak on Python 3. Closes #2 2015-05-08 13:27:30 +02:00
Lars Immisch
08b80110b0 Fix channel selection error. Closes #1 2015-05-04 21:18:46 +00:00
Lars Immisch
9188071945 Allow card index or device name for mixers.
This change breaks API compatibility. Sorry.
2015-05-04 21:13:15 +00:00
larsimmisch
039388d1e2 Applied slightly modified patch 3372909 by Erik Kulyk.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@40 ec2f30ec-7544-0410-870e-f70ca00c83f0
2011-08-09 19:32:20 +00:00
larsimmisch
56f8e948c5 Applied a patch from James Cameron that adds polldescriptors to PCM objects.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@39 ec2f30ec-7544-0410-870e-f70ca00c83f0
2010-01-13 23:11:10 +00:00
larsimmisch
707e7947b7 Revert changes from r30; they was one report of failure and they were not necessary in hindsight anyway.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@35 ec2f30ec-7544-0410-870e-f70ca00c83f0
2009-05-27 18:43:42 +00:00
larsimmisch
ef914ca069 Added polldescriptors.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@34 ec2f30ec-7544-0410-870e-f70ca00c83f0
2009-05-14 22:41:22 +00:00
larsimmisch
cf41942ed5 Accepted patches in 2777035 by Cameron Stone.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@31 ec2f30ec-7544-0410-870e-f70ca00c83f0
2009-04-22 22:20:54 +00:00
larsimmisch
83104faa0b Modified version of patch 2594366.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@30 ec2f30ec-7544-0410-870e-f70ca00c83f0
2009-04-22 22:10:14 +00:00
larsimmisch
fc3517b00e This is release 0.4; it was tested with python2.5 and python3.0 (rc2 &
3)


git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@29 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-11-29 03:29:13 +00:00
larsimmisch
c18a957644 Totally gratuitous re-indentation.
(well, it is closer to PEP-8 now)


git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@27 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-11-28 01:09:11 +00:00
larsimmisch
dfb89bde62 - Added close methods to PCM and Mixer
- Avoid internal re-opening of PCM objects when parameters change.

- PCM objects can be opened by card id
- Mixer objects can be openend by card index
  (this is not consistent, but ALSA works this way)

- Adjusted and cleaned up documentation.



git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@26 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-11-28 00:43:12 +00:00
larsimmisch
5c2a006553 Ported to Python3.0
Converted documentation to Sphinx.

Added playwav.py



git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@25 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-11-25 20:12:56 +00:00
larsimmisch
7fa6f1c85c Some preparations for porting to py3k.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@24 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-10-27 18:55:35 +00:00
larsimmisch
df89c12581 Decided that getenum should return the selected item and the available
items.

Argument parsing errors are reported with the methodname (minor 
improvement).

Smallish documentation improvements.


git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@23 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-05-21 14:06:26 +00:00
larsimmisch
40c4386803 PyObject_GenericGetAttr is not used in Python versions < 2.2, so we
should be as backwards compatible as release 0.3 was, but we do have 
nicer docstrings in later versions of Python.

setup.py is an executable.


git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@22 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-28 23:13:41 +00:00
larsimmisch
6fdbd9a2e5 Imported inline documentation for use with the builtin help function.
To make this work better, I have removed tp_getattr in favor of tp_getattro 
and tp_methods.

This method has much better support for inline help, but relies on 
PyObject_GenericGetAttr.

From trawling through the python branches, it looks as if 
PyObject_GenericGetAttr was introduced in Python 2.2.

I think it is an acceptable to trade better inline documentation with no
support for versions earlier than 2.2.

(I *could* do both, but my time is finite).



git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@20 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-25 13:42:39 +00:00