| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Again, no CamelCase in the directory name.
|
|
|
|
|
|
|
|
|
| |
PA_SAMPLE_S16NE is the only sample format which is suported by both
MPD and pulseaudio. Unfortunately, pulse does not accept 24 bit
samples.
Instead of bailing out with an error message, we should tell the MPD
core to convert all samples to 16 bit for pulse.
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
Move sample format dependent code to a separate function.
|
|
|
|
|
| |
Renamed all variables and functions. Add the prefix "mpd_jack_" to
function names.
|
|
|
|
| |
We must never pass partial frames. Added assertions to debug this.
|
|
|
|
|
| |
Merge the variables "avail_data" and "avail_frames" into "available".
Both variables are never used at the same time.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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".
|
|
|
|
| |
Indent with tabs.
|
|
|
|
|
|
| |
These macros are not available in older libasound versions (1.0.13
fails, 1.0.16 is ok). Ignore the configuration if the constants are
not defined.
|
|
|
|
| |
The OSS constants overflow a signed integer, use unsigned instead.
|
|
|
|
| |
C enums are nicer than CPP macros.
|
|
|
|
|
|
| |
Added mpd.conf options for disabling automatic resamling, sample
format and channel conversion. This way, users may choose to override
ALSA's automatic resampling, and use libsamplerate instead.
|
|
|
|
|
| |
Added configuration parameter "protocol" which lets the user choose
from 3 shout protocols. This adds support for real shoutcast servers.
|
|
|
|
|
|
| |
Case insensitivity isn't helpful, and comparing only the first 3 bytes
of a configured value may encourage users to supply wrong or
misleading values.
|
|
|
|
|
|
| |
If the sample format isn't supported by the device (i.e. 24 bit on
low-end sound chips), fall back to 16 bit output. There is code in
pcm_utils.c which converts PCM data to 16 bit.
|
|
|
|
|
| |
Move code which loads configuration to alsa_configure(). This removes
one indent level.
|
|
|
|
|
| |
ALSA does a good job measuring its buffer_time and period_time. Don't
override its defaults, unless the user demands it.
|
|
|
|
|
|
|
|
| |
Revert e4f5d6bd "re-enable-nonblocking, but sleep if busy".
Non-blocking mode with manual sleeping doesn't help at all (by the
way, the patch should have used snd_pcm_wait() instead of
my_usleep()). ALSA knows much more about the hardware quirks, so we
just let it do the job.
|
|
|
|
|
|
| |
Leftover from the output API changes: oss_open_default() was changed
to return a void*, but it still returned "0" to report success.
Report the OssData pointer instead.
|
|
|
|
|
|
| |
Fix some gcc warnings by using unsigned where appropriate. Declare
numfrequencies as "const", and replaced the magic number 12 with a
sizeof.
|
| |
|
|
|
|
|
| |
Again, a plugin which was disabled in my test environment and suffered
from compilation errors.
|
|
|
|
| |
This replaces the separate properties channels, sampleRate, bits.
|
|
|
|
|
|
|
| |
A frame contains one sample per channel, thus it is sample_size *
channels. This patch includes some cleanup for various locations
where the sample size for 24 bit audio was still 3 bytes (instead of
4).
|
|
|
|
|
| |
The last bit of CamelCase in audio_format.h. Additionally, rename a
bunch of local variables.
|
|
|
|
| |
"bits" and "channels" cannot be negative.
|
|
|
|
|
|
|
| |
Having an array with disabled entries sucks. Removed that
DISABLED_SHOUT_ENCODER_PLUGIN macro, and fill the plugin list only
with plugins which are actually enabled. This should be done for all
plugin types.
|
|
|
|
|
| |
When there are standardized headers, use these instead of the bloated
os_compat.h.
|
|
|
|
|
|
|
|
|
|
|
|
| |
pause() puts the audio output into pause mode: if supported, it may
perform a special action, which keeps the device open, but does not
play anything. Output plugins like "shout" might want to play silence
during pause, so their clients won't be disconnected. Plugins which
do not support pausing will simply be closed, and have to be reopened
when unpaused.
This pach includes an implementation for the shout plugin, which
sends silence chunks.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
The union const_hack is only used at one place in the shout plugin.
Remove its global type declaration.
|
|
|
|
|
| |
Do full C99 integer type conversion in all modules which were not
touched by Eric's merged patch.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Seeing the "mpd_" prefix _everywhere_ is mind-numbing as the
mind needs to retrain itself to skip over the first 4 tokens of
a type to get to its meaning. So avoid having extra characters
on my terminal to make it easier to follow code at 2:30 am in
the morning.
Please report any new issues you may come across on Free
toolchains. I realize how difficult it can be to build/maintain
cross-compiling toolchains and I have no intention of forcing
people to upgrade their toolchains to build mpd.
Tested with gcc 2.95.4 and and gcc 4.3.1 on x86-32.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
| |
Reduce direct accesses to the audio_output struct from the plugins:
this time, eliminate all accesses to audio_output.name. The name is
required by some plugins for log messages.
|
|
|
|
|
| |
Since the output plugin returns a value indicating success or error,
we can have the output core code assign the "open" flag.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
The inline function audio_format_sample_size() calculates how many
bytes each sample consumes. This function already takes into account
that 24 bit samples are 4 bytes long, not 3.
|
|
|
|
|
|
|
| |
Instead of letting ALSA block for us (and potentially allowing
something stupid on certain hardware or drivers), we do the
sleeping ourselves. We calculate the sleep to be a fraction of
period_time to avoid oversleeping (and thus audible skipping).
|
|
|
|
|
| |
Add a check to write_page() which checks if there is actually data.
Don't bother to call shout_send() if there is not.
|
|
|
|
|
| |
The function is trivial, without a benefit. Also don't initialize
buf.data[0], this is not a null terminated string.
|
|
|
|
|
|
|
| |
Since the buffer size is known at compile time, we can save an
indirection by declaring it as a char array instead of a pointer.
That saves an extra allocation, and we can calculate with the
compile-time constant sizeof(data) instead of the attribute "max_len".
|
|
|
|
|
| |
Declare both shout plugins "const", since they will never change, once
initialized at compile time.
|
|
|
|
|
|
| |
Shout encoder plugins are known at compile time. There is no reason
to use a complex data structure as "List" to manage them at runtime -
just put the pointers into a static array.
|
|
|
|
|
|
|
| |
Don't typedef the structs at all. It is easier to forward-declare
this way.
Don't typedef methods. They are used exactly once, a few lines below.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
[mk: moved this patch after "Refactor and cleanup of shout Ogg and MP3
audio outputs". The original commit message follows, although it is
outdated:]
Creation of shout_mp3 audio output plugin. Basically I just copied the
existing shout plugin and replaced ogg with lame. Uses lame for mp3
encoding. Next step is to pull common functionality out of each shout
plugin and share it between them.
Configuration options for "shout_mp3" are the same as for "shout".
|