Commit Graph

78 Commits

Author SHA1 Message Date
reimar a91702125c Explain why we still disable the ALSA resampler even though it is probably
actually working nowadays.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30452 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-28 18:26:12 +00:00
reimar 4c211d8851 Declare variable closer to where it is used.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30444 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-27 18:23:19 +00:00
reimar 882ce0cd5e Remove a useless global variable.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30443 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-27 18:21:27 +00:00
reimar 5f326498f7 Do not needlessly make local variable static.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30442 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-27 18:16:41 +00:00
reimar 051d3210c7 Remove useless initializers.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30441 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-27 18:11:15 +00:00
reimar 01a39f2fc3 Do not needlessly use (file-)global variables.
Since they also were initialized to a value and non-constant (changed
by ALSA) this might actually have caused bugs.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30440 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-27 18:10:07 +00:00
reimar 33bc71f10d Add support for distinguishing between little- and big-endian SPDIF AC3
and converting between both.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30283 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-11 20:27:52 +00:00
reimar e3c9e9a09b Use af_fmt2bits, it should give more sensible values than snd_pcm_format_physical_width,
especially for AC3.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30279 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-11 19:40:58 +00:00
reimar 6910cdaae1 Add and use AF_FORMAT_IS_AC3 macro.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30276 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-11 19:23:18 +00:00
reimar 92cd6dc3e9 Simplify range-checking functions for subopt parsing.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30165 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-01 13:23:16 +00:00
reimar f102ac7a8c Fix function declarations to avoid casting function pointers.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30164 b3059339-0415-0410-9bf9-f77b7e298cf2
2010-01-01 13:18:49 +00:00
tack 3c2afd6786 Add support for 8 channel audio.
Where 8 channel support is non-trivial (e.g. ao_dsound), at least ensure we
fail gracefully.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29868 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-11-10 00:45:19 +00:00
reimar a79706df46 Make the ao_alsa play function always process a multiple of ao_data.outburst
except for the last chunk.
Should fix high CPU usage reported e.g. here: http://bugs.gentoo.org/show_bug.cgi?id=286020


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29748 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-10-02 16:49:41 +00:00
reimar 790e41cf8f The suboption parser now takes a const options list, so mark them all const.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29628 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-09-02 11:33:37 +00:00
cladisch f17ed52432 Use a buffer of about half a second, instead of sizing it to have
a constant number of frames.  This improves the behaviour at very
small or large sample rates, and gets rid of lots of obsolete code.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29549 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-08-24 07:32:25 +00:00
cladisch 806d0c21c2 Do not leak the mixer handle if setting of a volume fails.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29478 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-08-06 09:43:10 +00:00
diego e5751ced4f Replace WORDS_BIGENDIAN by HAVE_BIGENDIAN in all internal code.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29443 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-07-26 19:53:00 +00:00
cladisch dc8bb7837a Use correct ALSA sample format for 24-bit samples packed in three bytes.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29434 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-07-21 08:20:22 +00:00
iive 968a51cfef Handle 24bit audio formats natively by ALSA.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29428 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-07-19 10:26:48 +00:00
diego 6e9cbdc104 whitespace cosmetics: Remove all trailing whitespace.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29305 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-05-13 02:58:57 +00:00
reimar d6bf2e318e Make ao_info_t structs const.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28858 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-03-06 19:43:12 +00:00
diego 390a1afef0 1) HAVE_SYS_ASOUNDLIB_H/HAVE_ALSA_ASOUNDLIB_H are defined to 0/1,
not defined/undefined, use them accordingly.
2) Add ESD definitions to avoid undefined preprocessor directives warnings.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28397 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-01-30 23:21:23 +00:00
diego c1cd81818a Add standard license headers.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28378 b3059339-0415-0410-9bf9-f77b7e298cf2
2009-01-26 15:06:44 +00:00
reimar 6574e5da34 100l, reorder check for AC3 format to avoid a possible memleak
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@28153 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-12-15 20:19:27 +00:00
cehoyos 22bb046adc Replace numeric constants by their defines.
Fixes icc warning #188: enumerated type mixed with another type


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27738 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-10-09 17:08:47 +00:00
ranma cb8c70d6c2 Fix "format '%d' expects type 'int', but argument 6 has type 'size_t'" warning.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27714 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-10-04 15:11:39 +00:00
ranma 68fa9667ec Make alsa resume after suspend to disk (would say 'file descriptor is in bad state' before this change)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27712 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-10-04 15:03:10 +00:00
reimar 6dfb85dc9e Our ALSA code needs alloca, so check for it in configure and include alloca.h
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27313 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-07-17 17:11:30 +00:00
diego bc0058c63e cosmetics: Remove pointless parentheses from return statements.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@26789 b3059339-0415-0410-9bf9-f77b7e298cf2
2008-05-16 09:31:55 +00:00
uau 50e46d7681 ao_alsa: Fix get_space() return values larger than buffersize
After a buffer underrun the ALSA get_space() function sometimes returned
values larger than the ao had set in ao_data.buffersize. Fix this by
replacing the old check against MAX_OUTBURST by one against
ao_data.buffersize. There should be no need for the MAX_OUTBURST check;
the current MPlayer side should no longer have any constant limit on the
amount of data an ao can buffer or request at once.

The get_space() values larger than ao_data.buffersize triggered errors
in audio decoding causing the current attempt to fill audio buffers to
be aborted. I'm not sure how often that caused behavior noticeably worse
then an underrun already is.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@24610 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-09-24 21:49:58 +00:00
cladisch d091c1165b When setting the non-audio bit for hwac3 output, just try to set the
AES0 parameter in the device name instead of poking around inside ALSA's
configuration structures.  This means that the non-audio bit will be set
even if the user-specified device name tries to clear it.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22184 b3059339-0415-0410-9bf9-f77b7e298cf2
2007-02-09 19:49:31 +00:00
kraymer 7043e4a0a7 MSGTRs for ao_alsa.c
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20780 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-08 14:52:33 +00:00
diego c24e344fae typo
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20759 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-11-07 21:09:10 +00:00
diego fcd45c5111 slight overall verbosity reduction
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20191 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-12 22:24:19 +00:00
diego 77347df36f Remove bogus #ifndef WORDS_BIGENDIAN.
patch by Emanuele Giaquinta, e.giaquinta glauco it


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20026 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-10-04 08:46:32 +00:00
cladisch bcebc89ef4 When the hardware sample format is AC3, do not force using an hardcoded
device name.

The setting of the non-audio bit is now done by changing the default
value of the AES0 parameter in the ALSA configuration structures. This
works with user-specified devices, too.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19895 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-09-18 16:58:21 +00:00
cladisch ec56167e11 When one of the PCM configuration function in init() fails, abort
immediately instead of continuing with the remaining calls that would
fail anyway because the device or some variable wasn't properly
initialized in this case.

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19893 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-09-18 16:29:27 +00:00
cladisch e7941a0ef3 Add workarounds for old prerelease versions of alsa-lib 0.9.0 that did
not allow reading the buffer boundary value.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18010 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-31 09:28:37 +00:00
cladisch b263a6618e To avoid a bug in ALSA's rate plugin that causes spurious overruns, try
to disable it so that mplayer's resampler is used.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17850 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-13 10:50:37 +00:00
cladisch 6bab259faf Do not try to count hardware sound cards because there might be none
when using a software plugin for JACK/OSS/Polypaudio/Bluetooth/etc.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17849 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-03-13 10:49:12 +00:00
cladisch 6ccd999a89 Output error messages from the ALSA library through mp_msg() instead of
the default stderr.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17692 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-27 10:09:05 +00:00
cladisch 434f6b2347 Show the actual ALSA version instead of the version mplayer was compiled
with, if possible.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17691 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-27 10:06:27 +00:00
cladisch 7673cbf6a7 Fix the error handling in the play() function: add a handler for EINTR,
improve the reporting of other errors, and don't try to call
snd_pcm_writei() repeatedly when it aborts after a partial write due to
an error.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17622 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-13 11:48:29 +00:00
cladisch 7d319f4b75 This changes the software parameters to be more compatible with the
behaviour of the OSS driver.  This implies that underruns are not longer
reported.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17621 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-13 11:43:25 +00:00
cladisch 0fc0814fcd Using non-blocking writes makes sense when the program wants to do other
things instead of waiting for the device to become ready.  However, just
calling snd_pcm_wait() is identical to blocking mode, so we can just as
well remove support for non-blocking writes.

Besides, the waiting code was never actually used because play() is
never called with more data than reported by get_space().


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17620 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-13 11:38:12 +00:00
cladisch 1328f3731c Remove the now superfluous mmap suboption.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17619 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-13 11:17:43 +00:00
cladisch 7f9397276b After removing play_mmap(), the play() function just unconditionally
calls play_normal().  This indirection is now superfluous.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17618 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-13 11:16:29 +00:00
cladisch cc8359e4e8 This patch removes mmap support because it doesn't have any benefit.
Directly accessing the sample buffer makes sense only when the samples
can be constructed in-place.  When the samples are just copied from
another buffer (as is the case with libao2 drivers), the code to copy
those samples is just a reimplementation of snd_pcm_writei(), so we
could as well use that function.

Besides, the current mmap code does not work except in the most simple
cases: it claims to support non-interleaved and complex sample formats,
but treats them the same as interleaved formats and writes to the wrong
memory location.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17617 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-13 11:15:25 +00:00
cladisch ddfe8e253e Small fixes: make all global variables static, remove some unused
variables, and remove the unused dir parameter from set_xxx_near()
calls.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17576 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-10 09:28:08 +00:00
cladisch 18ca43b048 Remove a call to snd_pcm_prepare() because snd_pcm_hw_params() does it
automatically, and remove a call to snd_pcm_drop() because
snd_pcm_close() does it automatically.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17575 b3059339-0415-0410-9bf9-f77b7e298cf2
2006-02-10 09:26:11 +00:00