Commit graph

28 commits

Author SHA1 Message Date
Takashi Sakamoto
ad3fe5824c pcm: remove unused macros of COPY_LABELS/COPY_END
A commit 7b054f4dce obsoleted usage of a pair of COPY_LABELS/COPY_END,
however it did not remove some codes in 'src/pcm/plugin_ops.h'.

This commit removes them in a point to reduce the amount of code to
maintain.

Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-22 10:22:35 +01:00
Maciej S. Szmigiero
0c081ebbed pcm: linear, route: handle linear formats with 20-bit sample on 4 bytes
The previous patch has added 20-bit PCM formats SND_PCM_FORMAT_{S,U}20 to
alsa-lib.
We need to extend the linear format conversion code with handling of these
sample formats so they can also be utilized by applications that only
recognize the more typical ones like SND_PCM_FORMAT_S16.

Since the conversion arrays are indexed by a format bit width divided by 8
the easiest way to handle these formats is to treat them like they were
40-bit wide (the next free integer multiple of 8 bits).
This doesn't create a collision risk with a future format since there can't
really be a 40-bit sample format that occupies 4 bytes.

Make sure we use the getput conversion method for these formats since a
direct conversion from / to them is not supported.

Signed-off-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-12-18 15:41:08 +01:00
Jaroslav Kysela
5b9041bced Change FSF address (Franklin Street)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2017-11-14 14:29:26 +01:00
Natanael Copa
adab355f35 cleanup: Use uint*_t instead of u_int*_t everythwere
Use the standard uint{8,16,32,64}_t everywhere instead of the
non-standard u_int{8,16,32,64}_t.

This changes the types in the public headers and removes the u_int*_t
defines. This may break things. However, indentifiers ending with _t are
reserved by POSIX[1]; defining those can lead to undefined behavior.

So if you rely on alsa-lib defining those for you, then you want the
compiler to error so things can be fixed properly.

[1]: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_02_02

Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2017-07-15 09:50:17 +02:00
Takashi Iwai
fd84adc63e pcm: route: Use get32 for multi-source route calculation
The PCM route plugin can assign the destination value from average of
multiple sources with attenuation.  This requires the read of each
channel value, sums and writes the resultant value in the requested
format.

Currently, get_labels is used for reading source values while
put32_labels is used for writing the dest value.  This is, however,
a buggy implementation; get_labels gives the value as is only with
endianness and signedness conversions, but put32_labels assumes that
the value is normalized to 32bit int and it shifts down to the dest
format.  In addition, the current code lacks get_labels entries for
the 24bit formats, as Shengjiu Wang spotted out.

For fixing these bugs, this patch replaces the read with
get32_labels and use always 64bit int for sum.  This simplifies the
code a lot and drops many lines.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2014-07-22 14:06:12 +02:00
Takashi Iwai
18b377dec2 Add missing support for 3-byte formats for 16bit put conversion
In the put conversion, the support for 3-byte formats was missing.
This resulted in inaudible volume with rate plugin & co.

Typos fixed by Mark Hills <mark@pogo.org.uk>

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-13 16:11:36 +02:00
Diego E. 'Flameeyes' Pettenò
8ed98db259 Make some static tables and strings constants.
By doing this we move them from the .data section to .rodata setion,
or from .data.rel to .data.rel.ro.

The .rodata section is mapped directly from the on-disk file, which is
always a save, while .data.rel.ro is mapped directly when using
prelink, which is a save in a lot of cases.

Signed-off-by: Diego E. 'Flameeyes' Pettenò <flameeyes@gmail.com>
2008-11-21 13:04:41 +01:00
Clemens Ladisch
86456d21e0 revert revision 2264:23c4c0f5de40
The rounding done when converting to smaller sample widths fails for
saturated positive samples; in this case, the sample value overflows and
becomes negative.  We are better off without rounding, even if we then
have quantization noise (of at most half the resolution of the least
significant bit).

ALSA bug#3360; Debian #437827; GNOME #436192; LP #116990; Mandriva #33908
2007-12-14 09:11:01 +01:00
Jaroslav Kysela
d25e281230 Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
Takashi Iwai
6329db3af1 Improve the sample conversion in plug layer
Improve the sample conversion in plug layer for the sample bits
reduction.  Use round instead of truncating, which introduces
more quantization noise.

Original patch by Jean-Marc Valin <jean-marc.valin@usherbrooke.ca>
2007-03-09 17:06:23 +01:00
Takashi Iwai
6333b48061 Fix S24_BE format conversions
Fix S24_BE format conversions by René Rebe <rene@exactcode.de>.
2006-01-09 14:40:08 +00:00
Takashi Iwai
08874160c8 - fixed the type punning (compilation warnings with the recent GCC). 2004-01-31 12:16:32 +00:00
Jaroslav Kysela
2db6b18b39 Fixed silence_64 and added support for 24-bit samples to area_silence 2002-07-21 08:19:40 +00:00
Abramo Bagnara
a81bf16bc9 Fixed normalization 2002-07-09 20:21:00 +00:00
Takashi Iwai
c4a0be5c5c - removed bad get_triple_* for i386. this can access over pages.
- fixed get16_1230_B2.
- fixed the size of put16_labels.
2002-07-09 12:44:34 +00:00
Abramo Bagnara
503dfb7162 Fixed interchanged max/min 2002-07-09 09:03:00 +00:00
Jaroslav Kysela
16b3bf447c Enhanced bitmasks in PCM - added support for more formats by Takashi and me 2002-06-26 02:04:11 +00:00
Jaroslav Kysela
3e3df2d32b Updated GNU GPL license (address).
Changed GNU LGPL licence from 2.0 to 2.1.
2001-12-30 09:22:54 +00:00
Jaroslav Kysela
095cbbb467 Finished lfloat plugin.
Added code to plug plugin to handle linear float / integer conversions.
2001-11-27 14:24:44 +00:00
Jaroslav Kysela
35b9951cec Add norm code back for mix plugin 2001-10-26 07:08:34 +00:00
Jaroslav Kysela
63a11a974c Added GETS helpers, removed norm 2001-10-25 18:22:14 +00:00
Abramo Bagnara
fcd164e622 Permit to PCM plug configuration to specify unchanged parameters. Added support for RT signals to async interface. Added ops for PCM mix. 2001-07-07 15:53:20 +00:00
Abramo Bagnara
5b50ec848a Lot of cleanings with the help of gcc3 2001-03-29 17:50:28 +00:00
Abramo Bagnara
82fcfe1ab5 pcm_share cleaning 2001-03-21 16:31:31 +00:00
Abramo Bagnara
a275d66356 Improved .asoundrc changes 2001-03-17 16:34:43 +00:00
Abramo Bagnara
aecf625c00 Clearer name 2001-03-10 10:09:34 +00:00
Abramo Bagnara
8a625fd63b Cleaned and fixed plugin ops 2000-10-22 09:50:20 +00:00
Jaroslav Kysela
6962a9d6ce Merged pcmplug branch. 2000-09-24 09:57:26 +00:00
Renamed from src/pcm/plugin/plugin_ops.h (Browse further)