Commit Graph

49 Commits

Author SHA1 Message Date
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
larsimmisch
ba03ad3c75 Added Freddy Spierenburgs patch for alsamixer_getrange and alsamixer_getenum.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@15 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-24 13:36:56 +00:00
larsimmisch
fa12a62e57 Support for multithreading: release the GIL around blocking operations.
git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@13 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-24 12:26:01 +00:00
larsimmisch
8fa9d27a88 Import from divmod. Added css. Original log message:
r1585 | casper | 2005-07-09 23:26:15 +0200 (Sat, 09 Jul 2005) | 3 lines

Last checkin before version 0.2





git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@12 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-24 12:22:41 +00:00
larsimmisch
470d6140df Import from divmod. Original log message:
r1322 | casper | 2005-03-30 22:44:55 +0200 (Wed, 30 Mar 2005) | 2 lines

Fixed return values for set* functions



git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@11 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-24 11:31:57 +00:00
larsimmisch
8bb39b0ff4 Import from divmod. Original log message:
r1316 | anthony | 2005-03-30 18:46:21 +0200 (Wed, 30 Mar 2005) | 1 line

setchannels() no longer is insane for only-stereo devices



git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@10 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-24 11:31:07 +00:00
larsimmisch
1c9229226c Import from divmod. Original log message:
r1269 | anthony | 2005-03-17 07:18:47 +0100 (Thu, 17 Mar 2005) | 1 line

make write() return the number of bytes actually written



git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@8 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-24 11:25:47 +00:00
larsimmisch
0acbf9b345 Import from divmod. Original log message:
r835 | casper | 2004-10-05 23:43:58 +0200 (Tue, 05 Oct 2004) | 1 line

Added mixer example script. A few mixer fixes as well



git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@5 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-24 11:23:22 +00:00
larsimmisch
dc68788ebf Import from divmod. Original log message:
r833 | casper | 2004-10-05 21:43:58 +0200 (Tue, 05 Oct 2004) | 1 line

Completed mixer read/write support. Docs to follow



git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@4 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-24 11:22:37 +00:00
larsimmisch
47795bcc72 Import from divmod. Original log message:
r820 | anthony | 2004-10-04 15:28:33 +0200 (Mon, 04 Oct 2004) | 2 lines

Import of PyAlsaAudio, by Casper Wilstrup (cwi@unispeed.dk)



git-svn-id: svn://svn.code.sf.net/p/pyalsaaudio/code/trunk@2 ec2f30ec-7544-0410-870e-f70ca00c83f0
2008-01-24 11:20:35 +00:00