aboutsummaryrefslogtreecommitdiffstats
path: root/src/output (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-03-10alsa: use snd_pcm_sframes_t instead of intMax Kellermann1-2/+1
snd_pcm_writei() returns the type snd_pcm_sframes_t, not int. Use the correct variable type.
2009-03-10alsa: don't close PCM handle in alsa_recover()Max Kellermann1-13/+3
If the PCM handle gets disconnected, don't close and clear it in alsa_recover(). The MPD core will call alsa_close() anyway. This way, we can always assume that alsa_data.pcm is always valid.
2009-03-08alsa: determine buffer_time if not already knownMax Kellermann1-0/+5
This patch fixes a theoretical (but practically impossible) flaw: the variable "buffer_time" may be uninitialized when it is used. Initialize the variable with snd_pcm_hw_params_get_buffer_time().
2009-03-08alsa: better period_time default value for high sample ratesMax Kellermann1-3/+8
The default values for buffer_time and period_time were both capped by the hardware limits on practically all chips. The result was a period_time which was half as big as the buffer_time. On some chips, this led to lots of underruns when using a high sample rate (192 kHz), because MPD had very little time to send new samples to ALSA. A period time which is one fourth of the buffer time turned out to be much better. If no period_time is configured, see how much buffer_time the hardware accepts, and try to configure one fourth of it as period_time, instead of hard-coding the default period_time value. This is yet another attempt to provide a solution which is valid for all sound chips. Using the SND_PCM_NONBLOCK flag also seemed to solve the underruns, but put a lot more CPU load to MPD.
2009-03-07pulse mixerDavid Guibert1-0/+16
This patch introduces the mixer for the pulse output. Technically speaking, the pulse index is needed to get or set the volume. You must define callback fonctions to get this index since the pulse output in mpd is done using the simpe api. The pulse simple api does not provide the index of the newly defined output. So callback fonctions are associated to the pulse context. The list of all the sink input is then retreived. Then we select the name of the mpd pulse output and control its volume by its associated index number. Signed-off-by: Patrice Linel <patnathanael@gmail.com> Signed-off-by: David Guibert <david.guibert@gmail.com> [mk: fixed whitespace errors and broke long lines; removed daemonization changes from main.c]
2009-03-03alsa: log period and buffer sizeMax Kellermann1-0/+3
Log the real period and buffer size. This might be useful when debugging xruns. Note that the same information is available in /proc/asound/card*/pcm*p/sub*/hw_params
2009-03-03alsa: fall back to 32 bit samples if 16 is not supportedMax Kellermann1-1/+2
There are a few high-end devices (e.g. ICE1724) which cannot even play 16 bit audio. Try the 32 bit fallback, which we already implemented for 24 bit.
2009-03-02alsa: fall back to 32 bit samples if 24 is not supportedMax Kellermann1-0/+8
Some sound chips/drivers (e.g. Intel HDA) don't support 24 bit samples, they want to get 32 bit instead. Now that MPD's PCM library supports 32 bit, add a 32 bit fallback when 24 bit is not supported.
2009-03-01output: removed duplicate debug messages from pluginsMax Kellermann4-16/+0
The MPD core logs the audio format of all audio outputs. Remove the duplicate message from the plugins.
2009-02-28pipe: new audio output plugin which runs a commandMichal Nazarewicz1-0/+110
[mk: adapted to new output plugin API]
2009-02-27tag: no CamelCaseMax Kellermann1-2/+1
Renamed numOfItems to num_items.
2009-02-26mvp: fixed default device detectionMax Kellermann1-1/+1
The check "open()!=0" is wrong, you have to write "open()>=0", because -1 means error, and 0 is a valid file handle.
2009-02-26output_plugin: report errors with GErrorMax Kellermann10-239/+393
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.
2009-02-26osx: use OSStatus and GetMacOSStatusCommentString()Max Kellermann1-15/+24
The return type of most OS X functions is OSStatus, not int. We can get a nice error message from GetMacOSStatusCommentString(), log it.
2009-02-26osx: start the audio device in the open() methodMax Kellermann1-17/+8
Don't call AudioOutputUnitStart() in the play() method, do it after the device has been opened. We can eliminate the "started" property now, because the device is always started when it's open.
2009-02-26osx: removed commented codeMax Kellermann1-23/+2
We don't need to keep commented code forever. If we want that test_default_device() implementation back one day, we'll pick it from the git history.
2009-02-26osx: no CamelCaseMax Kellermann1-89/+85
Renamed types, functions, variables.
2009-02-26shout: use config_get_block_unsigned()Max Kellermann1-6/+3
Eliminated manual integer parsing.
2009-02-26pulse: removed pa_simple!=NULL checksMax Kellermann1-10/+2
The MPD core guarantees that the audio_output object is always consistent, and our pa_simple!=NULL checks are superfluous. Also don't manually close the device on error in pulse_play(), since the MPD core does this automatically when the play() method returns 0.
2009-02-26oss: moved code from oss_open() to oss_setup()Max Kellermann1-13/+26
Eliminate one label and a bunch of gotos.
2009-02-26oss: convert OSS_STAT_* to an enumMax Kellermann1-10/+15
Use C instead of CPP.
2009-02-26oss: return bool instead of intMax Kellermann1-10/+10
Return type of oss_find_supported_param(), oss_can_convert() and oss_find_unsupported_param() should be bool instead of int.
2009-02-26oss: use unsigned integersMax Kellermann1-14/+9
Convert the num_supported and num_unsupported variables from signed to unsigned.
2009-02-26oss: no CamelCaseMax Kellermann1-107/+125
Renamed types, functions and variables.
2009-02-25alsa: fall back to 16 bit audioMax Kellermann1-3/+8
When the sample format is unknown, fall back to 16 bit samples.
2009-02-25alsa: moved code from alsa_open() to alsa_setup()Max Kellermann1-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.
2009-02-25mvp: check for reopen errorsMax Kellermann1-2/+7
When the MVP device has been closed in the cancel() method, and the play() method attempts to reopen it, check for errors.
2009-02-25mvp: moved code to mvp_find_sample_rate()Max Kellermann1-9/+17
Moved the table lookup code to a separate function.
2009-02-25mvp: make the mvp_sample_rates array constMax Kellermann1-1/+1
The array must never be modified, it's a constant lookup table.
2009-02-25mvp: fall back to 16 bit audio samplesMax Kellermann1-1/+5
Looks like the MVP audio output only supports 16 and 24 bit audio samples. If MPD generates any other sample formats, force it to use 16 bit.
2009-02-25mvp: fall back to stereoMax Kellermann1-1/+5
When the channel count is greater than 2, fall back to stereo sound.
2009-02-25mvp: mvp_set_pcm_params() returns boolMax Kellermann1-9/+14
Return true/false instead of 0/-1. Also check its return value in mvp_output_open().
2009-02-25mvp: pass audio_format struct to mvp_set_pcm_params()Max Kellermann1-13/+23
Pass a pointer to the audio_format struct instead of 3 separate integers.
2009-02-25mvp: removed big_endian parameter from mvp_set_pcm_params()Max Kellermann1-16/+3
Don't pass the big_endian flag to mvp_set_pcm_params(), do a simple "G_BYTE_ORDER==G_LITTLE_ENDIAN" instead.
2009-02-25mvp: use G_N_ELEMENTS(mvp_sample_rates)Max Kellermann1-5/+2
Instead of manually calculating the number of elements in the mvp_sample_rates array, use GLib's convenience macro G_N_ELEMENTS().
2009-02-25mvp: no CamelCaseMax Kellermann1-34/+38
Renamed types, functions and variables.
2009-02-25fifo: return bool valuesMax Kellermann1-12/+12
Return true/false for success/failure instead of returning 0/-1.
2009-02-25fifo: no CamelCaseMax Kellermann1-43/+50
Renamed types, functions and variables.
2009-02-25fifo: removed timer!=NULL checksMax Kellermann1-12/+1
The MPD core guarantees that the audio_output object is always consistent, and our timer!=NULL checks are superfluous.
2009-02-25ao: no CamelCaseMax Kellermann1-48/+41
Renamed functions and variables.
2009-02-25ao: removed AoData.device!=NULL checksMax Kellermann1-12/+1
The MPD core guarantees that the audio_output object is always in a consistent state: either open or closed. When open, it will not call the open() method again, and when closed, it will not call play(). Removed several checks and the NULL initialization.
2009-02-25ao: removed implementation of method cancel()Max Kellermann1-6/+0
The method is empty, and we can simply set the method pointer to NULL instead.
2009-02-25output_plugin: don't pass audio_output object to method init()Max Kellermann10-28/+16
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.
2009-02-25output_api: removed audio_output_get_name()Max Kellermann3-23/+14
Use config_get_block_string("name") instead of audio_output_get_name().
2009-02-24jack: initialize local variable "space"Max Kellermann1-1/+1
Fix a gcc warning, initialize the "space" variable at the beginning of mpd_jack_play().
2009-02-23output: pass the music chunk pointer as void*, not char*Max Kellermann10-17/+17
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.
2009-02-23output_api: play() returns a lengthMax Kellermann10-112/+82
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.
2009-02-22shout: removed shout_plugin.hMax Kellermann2-53/+28
There are no plugins left which require shout_plugin.h. Moved the struct declaration to shout_plugin.c.
2009-02-22shout: removed shout_encoder_pluginsMax Kellermann1-11/+0
This array is empty, and is not used anymore.
2009-02-22shout: use the new encoder APIMax Kellermann4-551/+102
Removed shout's encoder plugin API in favor of the new generic encoder plugin API.