aboutsummaryrefslogtreecommitdiffstats
path: root/src/output/jack_plugin.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2009-01-30jack: don't override output_ports in connect()Max Kellermann1-10/+22
If no ports are configured, don't overwrite the (NULL) configuration with the port names of the first JACK server. If the server changes after a JACK reconnect, MPD won't attempt to auto-detect again.
2009-01-30jack: removed sample_rate callbackMax Kellermann1-20/+7
Currently, the JACK plugin manipulates the audio_format struct which was passed to the open() method. This is very likely to break, because the plugin must not permanently store this pointer. After this patch, MPD ignores sample rate changes. It looks like other software is doing the same, and I guess this is a non-issue. This patch converts the audio_format pointer within jack_data into a static audio_format struct.
2009-01-30configure.ac: detect jack_set_info_function()Max Kellermann1-0/+5
jack_set_info_function() is not provided by older libjack versions. Attempt to detect if it is available.
2009-01-30jack: print info messagesMax Kellermann1-0/+7
Use jack_set_info_function() to install an info callback. Don't let libjack print them to stderr.
2009-01-29jack: don't manually close on shutdownMax Kellermann1-3/+1
Return false from mpd_jack_play(), let the MPD core close the device.
2009-01-29jack: initialize output_ports if not configuredMax Kellermann1-0/+3
Don't leave uninitialized bytes in the jack_data struct.
2009-01-29jack: close JACK client on stopMax Kellermann1-4/+4
When MPD stops playback, close the JACK client connection.
2009-01-29jack: removed "bps" attributeMax Kellermann1-5/+1
The "bps" attribute is calculated, but never used.
2009-01-29jack: make mpd_jack_connect() return boolMax Kellermann1-10/+10
Return true/false instead of 1/-1.
2009-01-29jack: use loops for allocating/freeing ports/buffersMax Kellermann1-36/+32
Preparation for supporting other channel numbers than stereo: use loops instead of duplicating code for the second channel. Most likely, gcc will unroll these loops, so the binary won't be any different.
2009-01-29jack: fail if jack_get_ports() returns NULLMax Kellermann1-19/+23
When jack_get_ports() returns NULL, we cannot have any ports to connect to, and the device cannot play anything.
2009-01-29jack: use jack_port_name() instead of g_malloc()+sprintf()Max Kellermann1-12/+2
libjack's jack_port_name() function returns the effective port name, we don't need to do it manually.
2009-01-29jack: initialize libjack's error function in mpd_jack_init()Max Kellermann1-1/+2
Do the global libjack initialization in the global plugin initialization function.
2009-01-29jack: reduced sleep time to 1msMax Kellermann1-1/+1
When waiting for free space in the ring buffer, the JACK plugin sleeped 10ms until there is enough space. This delay was too large for low-latency setups (<10ms), and created a lot of xruns. Work around that by reducing the sleep time to 1ms. A proper solution for this would be to use an event based approach, and we will do it, just not now.
2009-01-29jack: clear "shutdown" flag on reconnectMax Kellermann1-0/+2
When the connection failed once, you had to restart MPD, because it never cleared the jack_data.shutdown flag. Instead, it refused to play anything "because there is no client thread" (which is wrong at that point).
2009-01-29jack: allocate ring buffers before connectingMax Kellermann1-5/+3
If the ring buffers are allocated after jack_activate(), mpd_jack_process() might segfault because it attempts to access them.
2009-01-29jack: register ports before activating clientsMax Kellermann1-5/+5
Call jack_port_register() before jack_activate().
2009-01-25use g_free() instead of free()Max Kellermann1-4/+4
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.
2009-01-25conf: allow param==NULLMax Kellermann1-13/+1
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.
2009-01-25conf: const pointers in block get functionsMax Kellermann1-1/+1
All config_get_block_*() functions should accept constant config_param pointers.
2009-01-18conf: added config_get_block_unsigned()Max Kellermann1-15/+2
Eliminate some more getBlockParam() invocations.
2009-01-18conf: added config_get_block_string()Max Kellermann1-3/+5
This replaces lots of getBlockParam() invocations.
2009-01-18jack: parse "ports" setting with g_strsplit()Max Kellermann1-20/+7
Don't modify the configured string.
2009-01-18jack: use audio_output_get_name()Max Kellermann1-11/+1
Determine the audio output name with audio_output_get_name() instead of obtaining the name from the configuration again.
2009-01-17conf: no CamelCase, part IMax Kellermann1-2/+2
Renamed functions, types, variables.
2009-01-02jack: use GLib instead of utils.hMax Kellermann1-15/+14
2009-01-02jack: duplicate jack_get_ports() return valuesMax Kellermann1-3/+4
JACK documentation states: "The caller is responsible for calling free(3) any non-NULL returned value." This does not seem to include the array elements. Duplicate them after jack_get_ports(), and free only the array. Convert JackData.output_ports to non-const.
2009-01-01output plugins: don't include gcc.hMax Kellermann1-4/+4
Use GLib's G_GNUC_UNUSED instead of gcc.h's mpd_unused.
2008-12-29jack: use GLib loggingMax Kellermann1-28/+30
2008-11-01alsa, jack: no const pointers for allocated stringsMax Kellermann1-9/+17
Make the pointers "device" and "name" non-const, so we don't need the xfree() hack. The default value is expressed as NULL.
2008-10-29output: use bool for return values and flagsMax Kellermann1-8/+8
Don't return 0/-1 on success/error, but true/false. Instead of int, use bool for storing flags.
2008-10-26output: don't compile plugins which are disabledMax Kellermann1-9/+0
Don't compile the sources of disabled output plugins at all.
2008-10-26renamed src/audioOutputs/ to src/output/Max Kellermann1-0/+0
Again, no CamelCase in the directory name.
2008-10-24jack: support for 24 bit samplesMax Kellermann1-1/+32
When the audio source provides 24 bit samples, don't bother to convert (lossily) them to 16 bit before jack's floating point conversion - go directly from 24 bit to float.
2008-10-24jack: moved code to jack_write_samples_16()Max Kellermann1-14/+42
Move sample format dependent code to a separate function.
2008-10-24jack: eliminated CamelCaseMax Kellermann1-73/+76
Renamed all variables and functions. Add the prefix "mpd_jack_" to function names.
2008-10-24jack: added assertions against partial framesMax Kellermann1-0/+2
We must never pass partial frames. Added assertions to debug this.
2008-10-24jack: optimize local variablesMax Kellermann1-9/+8
Merge the variables "avail_data" and "avail_frames" into "available". Both variables are never used at the same time.
2008-10-24jack: lockless data transfer to jack threadMax Kellermann1-47/+15
The JACK documentation postulates that the process() callback must not block, therefore locking is forbidden. Anyway, the old code was racy. Remove all locks, and don't wait for more data to become available - just send to the port what is already in the buffer.
2008-10-24jack: partial writes to ring bufferMax Kellermann1-15/+15
Don't wait until there is room for the full data chunk passed to jack_playAudio(). Try to incrementally send as much as possible into the ring buffer.
2008-10-24jack: added constant "frame_size"Max Kellermann1-1/+2
Don't hard-code a frame size of "4" (16 bit stereo), calculate the sample size from sizeof(*buffer), and create the constant "frame_size".
2008-10-24jack: fix indentationMax Kellermann1-33/+33
Indent with tabs.
2008-10-10audio_format: renamed sampleRate to sample_rateMax Kellermann1-4/+4
The last bit of CamelCase in audio_format.h. Additionally, rename a bunch of local variables.
2008-10-08don't include os_compat.hMax Kellermann1-0/+2
When there are standardized headers, use these instead of the bloated os_compat.h.
2008-09-29use C99 struct initializersMax Kellermann1-9/+8
The old struct initializers are error prone and don't allow moving elements around. Since we are going to overhaul some of the APIs soon, it's easier to have all implementations use C99 initializers.
2008-09-24output: make "struct audio_output" opaque for output pluginsMax Kellermann1-30/+27
We have eliminated direct accesses to the audio_output struct from the all output plugins. Make it opaque for them, and move its real declaration to output_internal.h, similar to decoder_internal.h. Pass the opaque structure to plugin.init() only, which will return the plugin's data pointer on success, and NULL on failure. This data pointer will be passed to all other methods instead of the audio_output struct.
2008-09-24output: added audio_output_closed()Max Kellermann1-1/+1
The JACK output plugin needs to reset its "opened" flag when the JACK server fails. To prevent it from accessing the audio_output struct directly introduce the API function audio_output_closed().
2008-09-24output: set audio_output->open=1 in audio_output_task()Max Kellermann1-4/+1
Since the output plugin returns a value indicating success or error, we can have the output core code assign the "open" flag.
2008-09-24output: pass audio_format to plugin.init() and plugin.open()Max Kellermann1-8/+18
Pass the globally configured audio_format as a const pointer to plugin.init(). plugin.open() gets a writable pointer which contains the audio_format requested by the plugin. Its initial value is either the configured audio_format or the input file's audio_format.
2008-09-08output: const plugin structuresMax Kellermann1-1/+1
Since the plugin struct is never modified, we should store it in constant locations.