Commit graph

2481 commits

Author SHA1 Message Date
Jaroslav Kysela
6e3ecb1dfd Release v1.0.18
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-10-29 13:42:10 +01:00
Jaroslav Kysela
8feae77e13 Merge branch 'master' of git@git.alsa-project.org:alsa-lib 2008-10-23 09:58:10 +02:00
Jaroslav Kysela
cc7fec138e Add snd_pcm_avail() and snd_pcm_avail_delay() prototypes
Prototypes for new functions from commit
	fe5391c9da
were lost somehow.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-10-23 09:57:11 +02:00
Takashi Iwai
3b3eac25ab Add iec958 PCM definition for PS3
Added the iec958 PCM definition for PS3.
Since it's a new feature, the definition is marked as optional.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-20 11:26:20 +02:00
Takashi Iwai
3b2c53c2a6 Fix sort-out of non-existing devices in namehint
get_dev_name() checks wrongly the device_output, and it doesn't check
properly the case when only device is set and device_input and output
are unset.  This resulted in listing of non-existing HDMI device, for
example.  The patch fixes both issues.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-17 17:51:45 +02:00
Takashi Iwai
ce3df03135 Increase the components array size
Increase the components array size from 80 to 128 chars.
The string there is supposed to be null-terminated, so it can cover
the smaller array size in the older version, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-10-07 12:08:29 +02:00
Takashi Iwai
1cf904e894 Fix return value of snd_ctl_hw_subscribe_events()
snd_ctl_subscribe_events() must return 0 when succeeded.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-09-30 14:44:12 +02:00
Takashi Iwai
5cee69b47b Replace some assert() with runtime checks
assert() for sanity checks that can happen in runtime isn't a good idea.
Replaced it with the real check.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-09-30 14:43:14 +02:00
Jaroslav Kysela
16cc295a3c test/pcm: Fix error messages in async callback and add snd_pcm_start() condition
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-15 15:14:58 +02:00
Jaroslav Kysela
1dd1ba94a3 Fix comment typos for snd_pcm_read[in]()
From: William Estrada <MrUmunhum@popdial.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-09 19:58:59 +02:00
Jaroslav Kysela
33083eb3e3 Release v1.0.18rc3
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-09 18:55:49 +02:00
Jaroslav Kysela
a13707da6b pcm_softvol plugin: remove access type change for refine
The softvol plugin does in-place sample recalculation. The access type
cannot be changed like in linear plugins. Remove access type change
in refine functions.

This bug was detected with PulseAudio on Sony PS3 platform.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-09 13:10:55 +02:00
Jaroslav Kysela
fe5391c9da Add snd_pcm_avail() and snd_pcm_avail_delay() functions. Make snd_pcm_hwsync() deprecated.
As proposed in http://mailman.alsa-project.org/pipermail/alsa-devel/2008-June/008558.html
the snd_pcm_avail() and snd_pcm_avail_delay() functions are now available
to get accurate stream position in a straight way. The snd_pcm_avail_delay()
function was added to ensure full sync between avail and delay values. It's
actually implemented using delay() + avail_update() calls but it might be
changed in future.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-09-01 11:38:53 +02:00
Lennart Poettering
8d6838450a alsa-lib: Don't call the simple mixer interface "legacy"
The simpler mixer interface is not legacy, so the header file shouldn't claim
otherwise.

Fixes bug#3569

From: Lennart Poettering <mznyfn@0pointer.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-31 15:46:56 +02:00
Lennart Poettering
bd7b73a621 alsa-lib: Reword doxygen doc for snd_pcm_delay()
snd_pcm_delay() is for synchronization purposes, it returns the overall latency
of the stream, not just the latency induced by the hardware playback buffer.
The documentation is a bit misleading about this fact, and some people already
misunderstood it. So let's reword this to make the explanation clearer and
explicit.

This is a result of the discussions of the thread this mail belongs to:

http://mailman.alsa-project.org/pipermail/alsa-devel/2008-June/008456.html

From: Lennart Poettering <mznyfn@0pointer.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-31 15:46:22 +02:00
Lennart Poettering
73d20069e0 alsa-lib: Make sure SND_PCM_NO_xxx flags don't get lost when nonblocking mode is enabled
The plug PCM copies the 'mode' field from the slave PCM. If blocking mode is
enabled for the plug PCM the mode is subsequently overwritten with the original
requested 'mode'. If non-blocking mode is requested this does not happen.

Because the hw PCM synthesizes the 'mode' from the actual file descriptor flags
no SND_PCM_NO_xxx will ever be set for it. This has the effect that the 'mode'
of the plug PCM will also not include those flags anymore -- unless they are
overwritten as mentioned above. This basically means SND_PCM_NO_xxx is ignored
for plug:hw:4711 style device strings opened in non-blocking mode.

You can easily test this with "aplay --channels 7 --disable-channels -f S16_LE
-r 44100 -D plug:hw:0" on a device that cannot do 7 channels. Normally this
call should fail, however if you add "-N" to the command line this call will
succeed.

This patch simply copies the SND_PCM_NO_xxx flags back into the 'mode' field in
case we don't overwrite it with the original anyway.

Probably closes bug 3571 for good.

From: Lennart Poettering <mznyfn@0pointer.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-31 15:45:18 +02:00
Jaroslav Kysela
119bfd6594 Release v1.0.17a
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-15 13:28:55 +02:00
Pawel MOLL
6d426e3e92 IEC958 definition for consumer status channel update
Updated IEC958 consumer status channel definitions according
to the third edition of IEC60958-3 spec.

Signed-off-by: Pawel Moll <pawel.moll@st.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-08-01 13:17:52 +02:00
Takashi Iwai
ddf063f499 Fix non-tread mode with PCM direct plugins
tread=0 wasn't set properly for very old ALSA drivers with no timer
tread support.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-07-31 12:18:08 +02:00
Takashi Iwai
118fedb90a Fix interleave check in pcm_direct.c
Fix the check of interleaved format.  It checked a totally bogus value
as PCM format.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-07-29 14:41:51 +02:00
Lennart Poettering
8d3fb3102f fix return value of snd_pcm_rewind()/snd_pcm_forward() to return how much actually has been rewound, instead of what actually could have rewound
Make snd_pcm_plugin_rewind()/_forward() actually return how much has
been rewound/forwarded instead of how much could have been
rewounded/forwarded. This makes the code actually do what the
documentation of snd_pcm_rewind() suggests.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-07-20 17:27:57 +02:00
Lennart Poettering
15769ead72 fix type of internally used sframes variable, to avoid unnecessary casts
This minor patch fixes the type of the sframes variable in
snd_pcm_plugin_forward(). With this fix we need to cast less and the
code is less confusing.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-07-20 17:26:55 +02:00
Lennart Poettering
0fbfe2d8d6 clamp snd_pcm_rewind()/snd_pcm_forward() into the right direction
The clamping of the input parameter in snd_pcm_rewind()/_forward() is
in the wrong direction.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-07-20 17:25:53 +02:00
Takashi Iwai
f78af4ab04 Add boolean (mute) functionality to softvol plugin
When the resolution is set to 2, a boolean control is created as a
mute switch instead of a volume control.
Also, fixed the possible zero-division error.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-07-16 12:37:51 +02:00
Jaroslav Kysela
e24cc8d247 Release v1.0.17
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-07-14 10:57:56 +02:00
Takashi Iwai
d31fd52e74 test/pcm.c: Fix SND_PCM_FORMAT_S24 support
The program uses snd_pcm_format_width() wrongly to calculate the sample
size.  It must be snd_pcm_format_physical_width() instead.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-07-10 18:45:23 +02:00
Takashi Iwai
af2c3fbe7d Fix type-punning in test/pcm.c
The cast won't work well with strict aliasing.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-07-10 18:44:15 +02:00
Jaroslav Kysela
5e91207586 pcm: fix comment for snd_pcm_avail_update()
In some cases, value might be used for r/w ops, too.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-16 13:23:22 +02:00
Jaroslav Kysela
68641714a8 Release v1.0.17rc2
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-16 09:40:42 +02:00
Josh Green
2076b88a77 Fix segfault with dmix of 3-bytes formats
The i386 and x86-64 dmix may cause segfaults when 3-bytes formats are used
due to btsl asm code, which may overcome the buffer end-boundary.
The patch changes btsl to btsw so that it doesn't happen.

ALSA bug#3341:
	https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3341

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-06-07 10:10:49 +02:00
Takashi Iwai
1467f4e238 PCM: allow mmap-access conversion in plug
The plug plugin has a long-standing problem that it can handle only
slaves that support mmap because of format/rate/access conversions
(these corresponding plugins work only with mmap).

This patch adds the support of automatic mmap->rw conversion via
mmap_emul plugin.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-06-06 17:10:41 +02:00
Takashi Iwai
538726cc55 Export __snd_pcm_mmap_emul_open()
Export __snd_pcm_mmap_emul_open() for plug layer.  This isn't exported
globally, though.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-06-06 17:09:07 +02:00
Takashi Iwai
8843cf11e0 pcm_mmap_emul: clean up
A little bit of code clean up.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-06-06 17:07:45 +02:00
Takashi Iwai
2db108cc72 pcm_mmap_emul: Fix invalid check
The check in snd_pcm_mmap_emul_refine() is bogus and buggy.

Since the changed access type is took back at snd_pcm_mmap_emul_refine
again, it has to check the availability of mmap at each time.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-06-06 17:05:56 +02:00
Takashi Iwai
b6af5e1822 Fix compile warnings in pcm_hw.c
Two trivial compile warning fixes:

- Add a missing return to snd_pcm_hw_clear_timer_queue()
- params->info is no long but int

The second one might have hit already on 64bit machine, but alas,
no one didn't notice it.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-06-06 16:59:47 +02:00
Takashi Iwai
fce17b8c47 Fix cast warning
int64_t and long long isn't strictly identical, and thus gcc gives us
a heartful warning.  Suppress the warning by a pointer cast.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-06-06 16:58:02 +02:00
Jaroslav Kysela
6d4c09346a Release v1.0.17rc1
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-06-03 10:18:14 +02:00
Jaroslav Kysela
d7534b2cee hgcompile -> gitcompile 2008-06-03 10:17:48 +02:00
Jaroslav Kysela
fd61794399 removed .hg files and renamed hgcompile to gitcompile 2008-05-20 13:29:44 +02:00
Jaroslav Kysela
8aaccc9484 Implemented snd_pcm_sw_params_(set|get)_period_event for interrupt wakeup like behaviour
Actually, PCM timer is used as source for poll(). It might be optimized
in the kernel code later.
2008-05-09 16:02:02 +02:00
Jaroslav Kysela
c88672d86f implemented snd_pcm_rewindable() and snd_pcm_forwardable(), removed can_rewind and can_forward 2008-04-21 12:46:50 +02:00
Jaroslav Kysela
058dde8b7d implemented integer volume <-> dB volume conversion functions for simple mixer 2008-04-21 11:44:20 +02:00
Jaroslav Kysela
82af1df465 added snd_pcm_hw_params_is_monotonic/can_forward/can_rewind functions 2008-04-11 14:11:04 +02:00
Jaroslav Kysela
d4250517f0 PCM API - explain more trigger timestamp 2008-04-10 09:46:10 +02:00
Jaroslav Kysela
d555b15914 fix compilation in pcm/pcm_hw.c - monotonic clock 2008-04-10 09:08:08 +02:00
Stas Sergeev
542b12b888 pcsp: remove downsampling
apply softvol before plug as softvol doesn't support U8 as of now.
This also improves the sound quality.

Signed-off-by: Stas Sergeev <stsp@aknet.ru>
2008-03-22 17:40:57 +01:00
Takashi Iwai
87ae12214b Use defaults.pcm.file_format for the default file format of file plugin
Use "defaults.pcm.file_format" for the default file format of
file plugin.  It's set to "raw" as default for compatibility.
2008-03-17 16:11:57 +01:00
Takashi Iwai
fe95bc237a Add the support of WAV format in PCM file plugin
Added the support of WAV format in PCM file plugin.
The infile is still only in raw format.
2008-03-17 16:02:56 +01:00
Takashi Iwai
5c5f135812 Use slave PCM as a timing-source for file ifile
When ifile option is used for the file plugin, it ignores the slave PCM
and just feeds the input data.
This patch changes the behavior a bit - it uses the slave PCM as the
timing source (just read and throw data away) so that the input data
can be read in the right sample rate.
2008-03-14 14:03:54 +01:00
Takashi Iwai
3d0dae9099 Add truncate option to PCM file plugin
Addeed a new option "truncate" to indicate the behavior of creating
the output file.  When it's true (the default), the file is overwritten
and truncated at creation.  When false, the plugin tries to open a
unique file with a number suffix.

The global behavior of "file" and "tee" PCMs is defined via
defaults.pcm.file_truncate option.  You can overwrite it in ~/.asoundrc.
2008-03-12 16:30:26 +01:00