aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/alsa_plugin.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* output_plugin: report errors with GErrorMax Kellermann2009-02-261-20/+35
| | | | | | | Use GLib's GError library for reporting output device failures. Note that some init() methods don't clean up properly after a failure, but that's ok for now, because the MPD core will abort anyway.
* alsa: fall back to 16 bit audioMax Kellermann2009-02-251-3/+8
| | | | When the sample format is unknown, fall back to 16 bit samples.
* alsa: moved code from alsa_open() to alsa_setup()Max Kellermann2009-02-251-32/+49
| | | | | | Simplify error handling a bit by moving some code into a separate function. This eliminates a good bunch of gotos, but that's not finished yet.
* output_plugin: don't pass audio_output object to method init()Max Kellermann2009-02-251-2/+1
| | | | | | audio_output_get_name() has been removed, which was the only function left in output_api.h. The output plugin doesn't need the audio_output object at all, remove the parameter from the init() method.
* output: pass the music chunk pointer as void*, not char*Max Kellermann2009-02-231-1/+1
| | | | | | The meaning of the chunk depends on the audio format; don't suggest a specific format by declaring the pointer as "char*", pass "void*" instead.
* output_api: play() returns a lengthMax Kellermann2009-02-231-20/+11
| | | | | | | | The old API required an output plugin to not return until all data passed to the play() method is consumed. Some output plugins have to loop to fulfill that requirement, and may block during that. Simplify these, by letting them consume only part of the buffer: make play() return the length of the consumed data.
* output_plugin: replaced method "control()" with "mixer()"Max Kellermann2009-02-161-8/+9
| | | | | The output plugin shouldn't know any specifics of the mixer API. Make it return the mixer object, and let the caller deal with it.
* use g_free() instead of free()Max Kellermann2009-01-251-1/+1
| | | | | | On some platforms, g_free() must be used for memory allocated by GLib. This patch intends to correct a lot of occurrences, but is probably not complete.
* mixer: removed mixer_configure(), configure mixer in mixer_new()Max Kellermann2009-01-251-7/+1
| | | | | | | Allocate the mixer object when it is configured. Merged mixer_configure() into mixer_new(). mixer_new() was quite useless anyway.
* mixer: return a mixer struct pointerMax Kellermann2009-01-251-7/+7
| | | | Don't use statically allocated mixer objects.
* conf: allow param==NULLMax Kellermann2009-01-251-5/+2
| | | | | | | | Return the default value in the conf_get_block_*() functions when param==NULL was passed. This simplifies a lot of code, because all initialization can be done in one code path, regardless whether configuration is present.
* conf: const pointers in block get functionsMax Kellermann2009-01-251-2/+2
| | | | | All config_get_block_*() functions should accept constant config_param pointers.
* alsa: added commentsMax Kellermann2009-01-251-3/+21
| | | | Document alsa_data members.
* alsa: frame_size is size_t, not intMax Kellermann2009-01-251-1/+1
| | | | frame_size is a memory size and should be a size_t, not a signed integer.
* alsa: no CamelCaseMax Kellermann2009-01-251-93/+103
| | | | Renamed types, functions, variables.
* alsa: fix option parsing and restore default period_timeDan McGee2009-01-251-3/+6
| | | | | | | | | | | | | | | | | | | Two bugs here led to a large number of interrupts being generated on the sound card when ALSA output is being used. Because we specify no default period_time, the sound card gives us 3000 interrupts/sec rather than a more sane 20 or 30. This completes the revert of dd7711 already started by 4ca24f. The larger bug was in the change to config_get_block_unsigned() and using 0 as the default value for both 'buffer_time' and 'period_time'. This means any pre-setting of these options in newAlsaData() gets wiped out. Add a new default for period_time, and ensure default values for buffer_time and period_time are used if none are provided by the user. Signed-off-by: Dan McGee <dan@archlinux.org> [mk: set defaults in newAlsaData() to fix auto-configuration; renamed "_MS" back to "_US" because ALSA expects microseconds, not milliseconds] Signed-off-by: Max Kellermann <max@duempel.org>
* conf: added config_get_block_unsigned()Max Kellermann2009-01-181-6/+2
| | | | Eliminate some more getBlockParam() invocations.
* conf: added config_get_block_string()Max Kellermann2009-01-181-2/+1
| | | | This replaces lots of getBlockParam() invocations.
* conf: replaced getBoolBlockParam() with config_get_block_bool()Max Kellermann2009-01-171-6/+5
| | | | No "force" parameter, pass a default value instead.
* conf: no CamelCase, part IMax Kellermann2009-01-171-5/+6
| | | | Renamed functions, types, variables.
* Introducing mixer apiViliam Mateicka2009-01-101-7/+8
| | | | | This patch tryes to introduce pluggable mixer (struct mixer_plugin) along with some basic infrastructure (mixer_* functions). Instance of mixer (struct mixer) is used in alsa and oss output plugin
* pcm_utils: moved conversion code to pcm_convert.cMax Kellermann2009-01-071-1/+1
| | | | | All what's left in pcm_utils.h is the pcm_range() utility function, which is only used internally by pcm_volume and pcm_mix.
* renaming mixer.h to mixer_api.hViliam Mateicka2009-01-041-1/+1
|
* alsa: use GLib instead of utils.hMax Kellermann2009-01-021-3/+2
|
* output plugins: don't include gcc.hMax Kellermann2009-01-011-2/+2
| | | | Use GLib's G_GNUC_UNUSED instead of gcc.h's mpd_unused.
* Moving mixers to audio outputsViliam Mateicka2008-12-311-1/+21
|
* alsa: use GLib loggingMax Kellermann2008-12-291-29/+30
|
* alsa: reverted the default buffer_time to 500 msMax Kellermann2008-12-011-1/+5
| | | | | | | Commit dd7711d8 removed MPD's default ALSA buffer_time. The result was a buffer size which was way too small for playing streams on some sound hardware, and caused skips and distorted sound. Revert the default to 500 ms.
* alsa: initialize "device" with NULLMax Kellermann2008-11-031-2/+1
| | | | | When using autodetection, AlsaData.device wasn't properly initialized with NULL. This broke autodetection randomly.
* alsa, jack: no const pointers for allocated stringsMax Kellermann2008-11-011-17/+25
| | | | | Make the pointers "device" and "name" non-const, so we don't need the xfree() hack. The default value is expressed as NULL.
* output: close device on play errorMax Kellermann2008-10-291-1/+0
| | | | | When an output plugin fails to play a chunk, close it. This replaces various manual close() calls in nearly all plugins.
* output: use bool for return values and flagsMax Kellermann2008-10-291-9/+10
| | | | | Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
* output: don't compile plugins which are disabledMax Kellermann2008-10-261-11/+3
| | | | Don't compile the sources of disabled output plugins at all.
* renamed src/audioOutputs/ to src/output/Max Kellermann2008-10-261-0/+444
Again, no CamelCase in the directory name.