Blame src/timer/timer.c

Packit 4a16fb
/**
Packit 4a16fb
 * \file timer/timer.c
Packit 4a16fb
 * \brief Timer Interface
Packit 4a16fb
 * \author Jaroslav Kysela <perex@perex.cz>
Packit 4a16fb
 * \date 1998-2001
Packit 4a16fb
 *
Packit 4a16fb
 * Timer Interface is designed to access timers.
Packit 4a16fb
 * See \ref timer page for more details.
Packit 4a16fb
 */
Packit 4a16fb
/*
Packit 4a16fb
 *  Timer Interface - main file
Packit 4a16fb
 *  Copyright (c) 1998-2001 by Jaroslav Kysela <perex@perex.cz>
Packit 4a16fb
 *
Packit 4a16fb
 *
Packit 4a16fb
 *   This library is free software; you can redistribute it and/or modify
Packit 4a16fb
 *   it under the terms of the GNU Lesser General Public License as
Packit 4a16fb
 *   published by the Free Software Foundation; either version 2.1 of
Packit 4a16fb
 *   the License, or (at your option) any later version.
Packit 4a16fb
 *
Packit 4a16fb
 *   This program is distributed in the hope that it will be useful,
Packit 4a16fb
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 4a16fb
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 4a16fb
 *   GNU Lesser General Public License for more details.
Packit 4a16fb
 *
Packit 4a16fb
 *   You should have received a copy of the GNU Lesser General Public
Packit 4a16fb
 *   License along with this library; if not, write to the Free Software
Packit 4a16fb
 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit 4a16fb
 *
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
/*! \page timer Timer interface
Packit 4a16fb
Packit 4a16fb

Timer interface is designed to use internal timers in sound hardware, but

Packit 4a16fb
it can be driven with any timer.
Packit 4a16fb
Packit 4a16fb
\section timer_general_overview General overview
Packit 4a16fb
Packit 4a16fb
The timer implementation uses ring buffer to store information about timing
Packit 4a16fb
events. In this buffer is recorded count of ticks and current tick resolution
Packit 4a16fb
in nanoseconds.
Packit 4a16fb
Packit 4a16fb
\section timer_open Opening
Packit 4a16fb
Packit 4a16fb
Timer devices can be opened in two ways. When #SND_TIMER_OPEN_NONBLOCK flag
Packit 4a16fb
is used, then the open functions return immediately with -EBUSY error code when
Packit 4a16fb
resources are occupied with another application. When #SND_TIMER_OPEN_NONBLOCK
Packit 4a16fb
is not used (by default) the open functions block the application requesting
Packit 4a16fb
device until resources are not free.
Packit 4a16fb
Packit 4a16fb
\section timer_events Events
Packit 4a16fb
Packit 4a16fb
Events are read via snd_timer_read() function.
Packit 4a16fb
Packit 4a16fb
\section timer_examples Examples
Packit 4a16fb
Packit 4a16fb
The full featured examples with cross-links:
Packit 4a16fb
Packit 4a16fb
\par Simple timer test program
Packit 4a16fb
\ref example_test_timer "example code"
Packit 4a16fb
\par
Packit 4a16fb
This example shows opening a timer device and reading of timer events.
Packit 4a16fb
Packit 4a16fb
*/
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \example ../test/timer.c
Packit 4a16fb
 * \anchor example_test_timer
Packit 4a16fb
 */
Packit 4a16fb
Packit 4a16fb
#include "timer_local.h"
Packit 4a16fb
Packit 4a16fb
#include <signal.h>
Packit 4a16fb
Packit 4a16fb
static int snd_timer_open_conf(snd_timer_t **timer,
Packit 4a16fb
			       const char *name, snd_config_t *timer_root,
Packit 4a16fb
			       snd_config_t *timer_conf, int mode)
Packit 4a16fb
{
Packit 4a16fb
	const char *str;
Packit 4a16fb
	char buf[256], errbuf[256];
Packit 4a16fb
	int err;
Packit 4a16fb
	snd_config_t *conf, *type_conf = NULL;
Packit 4a16fb
	snd_config_iterator_t i, next;
Packit 4a16fb
	const char *id;
Packit 4a16fb
	const char *lib = NULL, *open_name = NULL;
Packit 4a16fb
	int (*open_func)(snd_timer_t **, const char *, snd_config_t *, snd_config_t *, int) = NULL;
Packit 4a16fb
#ifndef PIC
Packit 4a16fb
	extern void *snd_timer_open_symbols(void);
Packit 4a16fb
#endif
Packit 4a16fb
	void *h = NULL;
Packit 4a16fb
	if (snd_config_get_type(timer_conf) != SND_CONFIG_TYPE_COMPOUND) {
Packit 4a16fb
		if (name)
Packit 4a16fb
			SNDERR("Invalid type for TIMER %s definition", name);
Packit 4a16fb
		else
Packit 4a16fb
			SNDERR("Invalid type for TIMER definition");
Packit 4a16fb
		return -EINVAL;
Packit 4a16fb
	}
Packit 4a16fb
	err = snd_config_search(timer_conf, "type", &conf;;
Packit 4a16fb
	if (err < 0) {
Packit 4a16fb
		SNDERR("type is not defined");
Packit 4a16fb
		return err;
Packit 4a16fb
	}
Packit 4a16fb
	err = snd_config_get_id(conf, &id;;
Packit 4a16fb
	if (err < 0) {
Packit 4a16fb
		SNDERR("unable to get id");
Packit 4a16fb
		return err;
Packit 4a16fb
	}
Packit 4a16fb
	err = snd_config_get_string(conf, &str);
Packit 4a16fb
	if (err < 0) {
Packit 4a16fb
		SNDERR("Invalid type for %s", id);
Packit 4a16fb
		return err;
Packit 4a16fb
	}
Packit 4a16fb
	err = snd_config_search_definition(timer_root, "timer_type", str, &type_conf);
Packit 4a16fb
	if (err >= 0) {
Packit 4a16fb
		if (snd_config_get_type(type_conf) != SND_CONFIG_TYPE_COMPOUND) {
Packit 4a16fb
			SNDERR("Invalid type for TIMER type %s definition", str);
Packit 4a16fb
			goto _err;
Packit 4a16fb
		}
Packit 4a16fb
		snd_config_for_each(i, next, type_conf) {
Packit 4a16fb
			snd_config_t *n = snd_config_iterator_entry(i);
Packit 4a16fb
			const char *id;
Packit 4a16fb
			if (snd_config_get_id(n, &id) < 0)
Packit 4a16fb
				continue;
Packit 4a16fb
			if (strcmp(id, "comment") == 0)
Packit 4a16fb
				continue;
Packit 4a16fb
			if (strcmp(id, "lib") == 0) {
Packit 4a16fb
				err = snd_config_get_string(n, &lib);
Packit 4a16fb
				if (err < 0) {
Packit 4a16fb
					SNDERR("Invalid type for %s", id);
Packit 4a16fb
					goto _err;
Packit 4a16fb
				}
Packit 4a16fb
				continue;
Packit 4a16fb
			}
Packit 4a16fb
			if (strcmp(id, "open") == 0) {
Packit 4a16fb
				err = snd_config_get_string(n, &open_name);
Packit 4a16fb
				if (err < 0) {
Packit 4a16fb
					SNDERR("Invalid type for %s", id);
Packit 4a16fb
					goto _err;
Packit 4a16fb
				}
Packit 4a16fb
				continue;
Packit 4a16fb
			}
Packit 4a16fb
			SNDERR("Unknown field %s", id);
Packit 4a16fb
			err = -EINVAL;
Packit 4a16fb
			goto _err;
Packit 4a16fb
		}
Packit 4a16fb
	}
Packit 4a16fb
	if (!open_name) {
Packit 4a16fb
		open_name = buf;
Packit 4a16fb
		snprintf(buf, sizeof(buf), "_snd_timer_%s_open", str);
Packit 4a16fb
	}
Packit 4a16fb
#ifndef PIC
Packit 4a16fb
	snd_timer_open_symbols();
Packit 4a16fb
#endif
Packit 4a16fb
	h = INTERNAL(snd_dlopen)(lib, RTLD_NOW, errbuf, sizeof(errbuf));
Packit 4a16fb
	if (h)
Packit 4a16fb
		open_func = snd_dlsym(h, open_name, SND_DLSYM_VERSION(SND_TIMER_DLSYM_VERSION));
Packit 4a16fb
	err = 0;
Packit 4a16fb
	if (!h) {
Packit 4a16fb
		SNDERR("Cannot open shared library %s (%s)", lib, errbuf);
Packit 4a16fb
		err = -ENOENT;
Packit 4a16fb
	} else if (!open_func) {
Packit 4a16fb
		SNDERR("symbol %s is not defined inside %s", open_name, lib);
Packit 4a16fb
		snd_dlclose(h);
Packit 4a16fb
		err = -ENXIO;
Packit 4a16fb
	}
Packit 4a16fb
       _err:
Packit 4a16fb
	if (type_conf)
Packit 4a16fb
		snd_config_delete(type_conf);
Packit 4a16fb
	if (! err) {
Packit 4a16fb
		err = open_func(timer, name, timer_root, timer_conf, mode);
Packit 4a16fb
		if (err < 0)
Packit 4a16fb
			snd_dlclose(h);
Packit 4a16fb
		else
Packit 4a16fb
			(*timer)->dl_handle = h;
Packit 4a16fb
	}
Packit 4a16fb
	return err;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
static int snd_timer_open_noupdate(snd_timer_t **timer, snd_config_t *root, const char *name, int mode)
Packit 4a16fb
{
Packit 4a16fb
	int err;
Packit 4a16fb
	snd_config_t *timer_conf;
Packit 4a16fb
	err = snd_config_search_definition(root, "timer", name, &timer_conf);
Packit 4a16fb
	if (err < 0) {
Packit 4a16fb
		SNDERR("Unknown timer %s", name);
Packit 4a16fb
		return err;
Packit 4a16fb
	}
Packit 4a16fb
	err = snd_timer_open_conf(timer, name, root, timer_conf, mode);
Packit 4a16fb
	snd_config_delete(timer_conf);
Packit 4a16fb
	return err;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief Opens a new connection to the timer interface.
Packit 4a16fb
 * \param timer Returned handle (NULL if not wanted)
Packit 4a16fb
 * \param name ASCII identifier of the timer handle
Packit 4a16fb
 * \param mode Open mode
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 *
Packit 4a16fb
 * Opens a new connection to the timer interface specified with
Packit 4a16fb
 * an ASCII identifier and mode.
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_open(snd_timer_t **timer, const char *name, int mode)
Packit 4a16fb
{
Packit 4a16fb
	snd_config_t *top;
Packit 4a16fb
	int err;
Packit 4a16fb
Packit 4a16fb
	assert(timer && name);
Packit 4a16fb
	err = snd_config_update_ref(&top);
Packit 4a16fb
	if (err < 0)
Packit 4a16fb
		return err;
Packit 4a16fb
	err = snd_timer_open_noupdate(timer, top, name, mode);
Packit 4a16fb
	snd_config_unref(top);
Packit 4a16fb
	return err;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief Opens a new connection to the timer interface using local configuration
Packit 4a16fb
 * \param timer Returned handle (NULL if not wanted)
Packit 4a16fb
 * \param name ASCII identifier of the timer handle
Packit 4a16fb
 * \param mode Open mode
Packit 4a16fb
 * \param lconf Local configuration
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 *
Packit 4a16fb
 * Opens a new connection to the timer interface specified with
Packit 4a16fb
 * an ASCII identifier and mode.
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_open_lconf(snd_timer_t **timer, const char *name,
Packit 4a16fb
			 int mode, snd_config_t *lconf)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer && name && lconf);
Packit 4a16fb
	return snd_timer_open_noupdate(timer, lconf, name, mode);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief close timer handle
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 *
Packit 4a16fb
 * Closes the specified timer handle and frees all associated
Packit 4a16fb
 * resources.
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_close(snd_timer_t *timer)
Packit 4a16fb
{
Packit 4a16fb
	int err;
Packit 4a16fb
  	assert(timer);
Packit 4a16fb
	while (!list_empty(&timer->async_handlers)) {
Packit 4a16fb
		snd_async_handler_t *h = list_entry(timer->async_handlers.next, snd_async_handler_t, hlist);
Packit 4a16fb
		snd_async_del_handler(h);
Packit 4a16fb
	}
Packit 4a16fb
	err = timer->ops->close(timer);
Packit 4a16fb
	if (timer->dl_handle)
Packit 4a16fb
		snd_dlclose(timer->dl_handle);
Packit 4a16fb
	free(timer->name);
Packit 4a16fb
	free(timer);
Packit 4a16fb
	return err;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get identifier of timer handle
Packit 4a16fb
 * \param timer a timer handle
Packit 4a16fb
 * \return ascii identifier of timer handle
Packit 4a16fb
 *
Packit 4a16fb
 * Returns the ASCII identifier of given timer handle. It's the same
Packit 4a16fb
 * identifier specified in snd_timer_open().
Packit 4a16fb
 */
Packit 4a16fb
const char *snd_timer_name(snd_timer_t *timer)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	return timer->name;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get type of timer handle
Packit 4a16fb
 * \param timer a timer handle
Packit 4a16fb
 * \return type of timer handle
Packit 4a16fb
 *
Packit 4a16fb
 * Returns the type #snd_timer_type_t of given timer handle.
Packit 4a16fb
 */
Packit 4a16fb
snd_timer_type_t snd_timer_type(snd_timer_t *timer)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	return timer->type;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief Add an async handler for a timer
Packit 4a16fb
 * \param handler Returned handler handle
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \param callback Callback function
Packit 4a16fb
 * \param private_data Callback private data
Packit 4a16fb
 * \return 0 otherwise a negative error code on failure
Packit 4a16fb
 *
Packit 4a16fb
 * The asynchronous callback is called when new timer event occurs.
Packit 4a16fb
 */
Packit 4a16fb
int snd_async_add_timer_handler(snd_async_handler_t **handler, snd_timer_t *timer,
Packit 4a16fb
				snd_async_callback_t callback, void *private_data)
Packit 4a16fb
{
Packit 4a16fb
	int err;
Packit 4a16fb
	int was_empty;
Packit 4a16fb
	snd_async_handler_t *h;
Packit 4a16fb
	err = snd_async_add_handler(&h, timer->poll_fd,
Packit 4a16fb
				    callback, private_data);
Packit 4a16fb
	if (err < 0)
Packit 4a16fb
		return err;
Packit 4a16fb
	h->type = SND_ASYNC_HANDLER_TIMER;
Packit 4a16fb
	h->u.timer = timer;
Packit 4a16fb
	was_empty = list_empty(&timer->async_handlers);
Packit 4a16fb
	list_add_tail(&h->hlist, &timer->async_handlers);
Packit 4a16fb
	if (was_empty) {
Packit 4a16fb
		err = snd_timer_async(timer, snd_async_handler_get_signo(h), getpid());
Packit 4a16fb
		if (err < 0) {
Packit 4a16fb
			snd_async_del_handler(h);
Packit 4a16fb
			return err;
Packit 4a16fb
		}
Packit 4a16fb
	}
Packit 4a16fb
	*handler = h;
Packit 4a16fb
	return 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief Return timer handle related to an async handler
Packit 4a16fb
 * \param handler Async handler handle
Packit 4a16fb
 * \return timer handle
Packit 4a16fb
 */
Packit 4a16fb
snd_timer_t *snd_async_handler_get_timer(snd_async_handler_t *handler)
Packit 4a16fb
{
Packit 4a16fb
	if (handler->type != SND_ASYNC_HANDLER_TIMER) {
Packit 4a16fb
		SNDMSG("invalid handler type %d", handler->type);
Packit 4a16fb
		return NULL;
Packit 4a16fb
	}
Packit 4a16fb
	return handler->u.timer;
Packit 4a16fb
}                                                            
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get count of poll descriptors for timer handle
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \return count of poll descriptors
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_poll_descriptors_count(snd_timer_t *timer)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	return 1;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get poll descriptors
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \param pfds array of poll descriptors
Packit 4a16fb
 * \param space space in the poll descriptor array
Packit 4a16fb
 * \return count of filled descriptors
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_poll_descriptors(snd_timer_t *timer, struct pollfd *pfds, unsigned int space)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	if (space >= 1) {
Packit 4a16fb
		pfds->fd = timer->poll_fd;
Packit 4a16fb
		switch (timer->mode & O_ACCMODE) {
Packit 4a16fb
		case O_WRONLY:
Packit 4a16fb
			pfds->events = POLLOUT|POLLERR|POLLNVAL;
Packit 4a16fb
			break;
Packit 4a16fb
		case O_RDONLY:
Packit 4a16fb
			pfds->events = POLLIN|POLLERR|POLLNVAL;
Packit 4a16fb
			break;
Packit 4a16fb
		case O_RDWR:
Packit 4a16fb
			pfds->events = POLLOUT|POLLIN|POLLERR|POLLNVAL;
Packit 4a16fb
			break;
Packit 4a16fb
		default:
Packit 4a16fb
			return -EIO;
Packit 4a16fb
		}
Packit 4a16fb
		return 1;
Packit 4a16fb
	}
Packit 4a16fb
	return 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get returned events from poll descriptors
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \param pfds array of poll descriptors
Packit 4a16fb
 * \param nfds count of poll descriptors
Packit 4a16fb
 * \param revents returned events
Packit 4a16fb
 * \return zero if success, otherwise a negative error code
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_poll_descriptors_revents(snd_timer_t *timer, struct pollfd *pfds, unsigned int nfds, unsigned short *revents)
Packit 4a16fb
{
Packit 4a16fb
        assert(timer && pfds && revents);
Packit 4a16fb
        if (nfds == 1) {
Packit 4a16fb
                *revents = pfds->revents;
Packit 4a16fb
                return 0;
Packit 4a16fb
        }
Packit 4a16fb
        return -EINVAL;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief set nonblock mode
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \param nonblock 0 = block, 1 = nonblock mode
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_nonblock(snd_timer_t *timer, int nonblock)
Packit 4a16fb
{
Packit 4a16fb
	int err;
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	if ((err = timer->ops->nonblock(timer, nonblock)) < 0)
Packit 4a16fb
		return err;
Packit 4a16fb
	if (nonblock)
Packit 4a16fb
		timer->mode |= SND_TIMER_OPEN_NONBLOCK;
Packit 4a16fb
	else
Packit 4a16fb
		timer->mode &= ~SND_TIMER_OPEN_NONBLOCK;
Packit 4a16fb
	return 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
#ifndef DOC_HIDDEN
Packit 4a16fb
/**
Packit 4a16fb
 * \brief set async mode
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \param sig Signal to raise: < 0 disable, 0 default (SIGIO)
Packit 4a16fb
 * \param pid Process ID to signal: 0 current
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 *
Packit 4a16fb
 * A signal is raised every period.
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_async(snd_timer_t *timer, int sig, pid_t pid)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
        if (sig == 0)
Packit 4a16fb
                sig = SIGIO;
Packit 4a16fb
	if (pid == 0)
Packit 4a16fb
		pid = getpid();
Packit 4a16fb
	return timer->ops->async(timer, sig, pid);
Packit 4a16fb
}
Packit 4a16fb
#endif
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get size of the snd_timer_info_t structure in bytes
Packit 4a16fb
 * \return size of the snd_timer_info_t structure in bytes
Packit 4a16fb
 */
Packit 4a16fb
size_t snd_timer_info_sizeof()
Packit 4a16fb
{
Packit 4a16fb
	return sizeof(snd_timer_info_t);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief allocate a new snd_timer_info_t structure
Packit 4a16fb
 * \param info returned pointer
Packit 4a16fb
 * \return 0 on success otherwise a negative error code if fails
Packit 4a16fb
 *
Packit 4a16fb
 * Allocates a new snd_timer_info_t structure using the standard
Packit 4a16fb
 * malloc C library function.
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_info_malloc(snd_timer_info_t **info)
Packit 4a16fb
{
Packit 4a16fb
	assert(info);
Packit 4a16fb
	*info = calloc(1, sizeof(snd_timer_info_t));
Packit 4a16fb
	if (!*info)
Packit 4a16fb
		return -ENOMEM;
Packit 4a16fb
	return 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief frees the snd_timer_info_t structure
Packit 4a16fb
 * \param info pointer to the snd_timer_info_t structure to free
Packit 4a16fb
 *
Packit 4a16fb
 * Frees the given snd_timer_info_t structure using the standard
Packit 4a16fb
 * free C library function.
Packit 4a16fb
 */
Packit 4a16fb
void snd_timer_info_free(snd_timer_info_t *info)
Packit 4a16fb
{
Packit 4a16fb
	assert(info);
Packit 4a16fb
	free(info);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief copy one snd_timer_info_t structure to another
Packit 4a16fb
 * \param dst destination snd_timer_info_t structure
Packit 4a16fb
 * \param src source snd_timer_info_t structure
Packit 4a16fb
 */
Packit 4a16fb
void snd_timer_info_copy(snd_timer_info_t *dst, const snd_timer_info_t *src)
Packit 4a16fb
{
Packit 4a16fb
	assert(dst && src);
Packit 4a16fb
	*dst = *src;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief determine, if timer is slave
Packit 4a16fb
 * \param info pointer to #snd_timer_info_t structure
Packit 4a16fb
 * \return nonzero if timer is slave
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_info_is_slave(snd_timer_info_t * info)
Packit 4a16fb
{
Packit 4a16fb
	assert(info);
Packit 4a16fb
	return info->flags & SNDRV_TIMER_FLG_SLAVE ? 1 : 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get timer card
Packit 4a16fb
 * \param info pointer to #snd_timer_info_t structure
Packit 4a16fb
 * \return timer card number
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_info_get_card(snd_timer_info_t * info)
Packit 4a16fb
{
Packit 4a16fb
	assert(info);
Packit 4a16fb
	return info->card;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get timer id
Packit 4a16fb
 * \param info pointer to #snd_timer_info_t structure
Packit 4a16fb
 * \return timer id
Packit 4a16fb
 */
Packit 4a16fb
const char *snd_timer_info_get_id(snd_timer_info_t * info)
Packit 4a16fb
{
Packit 4a16fb
	assert(info);
Packit 4a16fb
	return (const char *)info->id;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get timer name
Packit 4a16fb
 * \param info pointer to #snd_timer_info_t structure
Packit 4a16fb
 * \return timer name
Packit 4a16fb
 */
Packit 4a16fb
const char *snd_timer_info_get_name(snd_timer_info_t * info)
Packit 4a16fb
{
Packit 4a16fb
	assert(info);
Packit 4a16fb
	return (const char *)info->name;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get timer resolution in us
Packit 4a16fb
 * \param info pointer to #snd_timer_info_t structure
Packit 4a16fb
 * \return timer resolution
Packit 4a16fb
 */
Packit 4a16fb
long snd_timer_info_get_resolution(snd_timer_info_t * info)
Packit 4a16fb
{
Packit 4a16fb
	assert(info);
Packit 4a16fb
	return info->resolution;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get information about timer handle
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \param info pointer to a snd_timer_info_t structure to be filled
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_info(snd_timer_t *timer, snd_timer_info_t * info)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	assert(info);
Packit 4a16fb
	return timer->ops->info(timer, info);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get size of the snd_timer_params_t structure in bytes
Packit 4a16fb
 * \return size of the snd_timer_params_t structure in bytes
Packit 4a16fb
 */
Packit 4a16fb
size_t snd_timer_params_sizeof()
Packit 4a16fb
{
Packit 4a16fb
	return sizeof(snd_timer_params_t);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief allocate a new snd_timer_params_t structure
Packit 4a16fb
 * \param params returned pointer
Packit 4a16fb
 * \return 0 on success otherwise a negative error code if fails
Packit 4a16fb
 *
Packit 4a16fb
 * Allocates a new snd_timer_params_t structure using the standard
Packit 4a16fb
 * malloc C library function.
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_params_malloc(snd_timer_params_t **params)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	*params = calloc(1, sizeof(snd_timer_params_t));
Packit 4a16fb
	if (!*params)
Packit 4a16fb
		return -ENOMEM;
Packit 4a16fb
	return 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief frees the snd_timer_params_t structure
Packit 4a16fb
 * \param params pointer to the snd_timer_params_t structure to free
Packit 4a16fb
 *
Packit 4a16fb
 * Frees the given snd_timer_params_t structure using the standard
Packit 4a16fb
 * free C library function.
Packit 4a16fb
 */
Packit 4a16fb
void snd_timer_params_free(snd_timer_params_t *params)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	free(params);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief copy one snd_timer_params_t structure to another
Packit 4a16fb
 * \param dst destination snd_timer_params_t structure
Packit 4a16fb
 * \param src source snd_timer_params_t structure
Packit 4a16fb
 */
Packit 4a16fb
void snd_timer_params_copy(snd_timer_params_t *dst, const snd_timer_params_t *src)
Packit 4a16fb
{
Packit 4a16fb
	assert(dst && src);
Packit 4a16fb
	*dst = *src;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief set timer auto start
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \param auto_start The boolean value to set
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_params_set_auto_start(snd_timer_params_t * params, int auto_start)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	if (auto_start)
Packit 4a16fb
		params->flags |= SNDRV_TIMER_PSFLG_AUTO;
Packit 4a16fb
	else
Packit 4a16fb
		params->flags &= ~SNDRV_TIMER_PSFLG_AUTO;
Packit 4a16fb
	return 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief determine if timer has auto start flag
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \return nonzero if timer has auto start flag
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_params_get_auto_start(snd_timer_params_t * params)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	return params->flags & SNDRV_TIMER_PSFLG_AUTO ? 1 : 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief set timer exclusive use
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \param exclusive The boolean value to set
Packit 4a16fb
 */
Packit 4a16fb
#ifndef DOXYGEN
Packit 4a16fb
EXPORT_SYMBOL int INTERNAL(snd_timer_params_set_exclusive)(snd_timer_params_t * params, int exclusive)
Packit 4a16fb
#else
Packit 4a16fb
int snd_timer_params_set_exclusive(snd_timer_params_t * params, int exclusive)
Packit 4a16fb
#endif
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	if (exclusive)
Packit 4a16fb
		params->flags |= SNDRV_TIMER_PSFLG_EXCLUSIVE;
Packit 4a16fb
	else
Packit 4a16fb
		params->flags &= ~SNDRV_TIMER_PSFLG_EXCLUSIVE;
Packit 4a16fb
	return 0;
Packit 4a16fb
}
Packit 4a16fb
use_default_symbol_version(__snd_timer_params_set_exclusive, snd_timer_params_set_exclusive, ALSA_0.9.0);
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief determine if timer has exclusive flag
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \return nonzero if timer has exclusive flag
Packit 4a16fb
 */
Packit 4a16fb
#ifndef DOXYGEN
Packit 4a16fb
EXPORT_SYMBOL int INTERNAL(snd_timer_params_get_exclusive)(snd_timer_params_t * params)
Packit 4a16fb
#else
Packit 4a16fb
int snd_timer_params_get_exclusive(snd_timer_params_t * params)
Packit 4a16fb
#endif
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	return params->flags & SNDRV_TIMER_PSFLG_EXCLUSIVE ? 1 : 0;
Packit 4a16fb
}
Packit 4a16fb
use_default_symbol_version(__snd_timer_params_get_exclusive, snd_timer_params_get_exclusive, ALSA_0.9.0);
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief set timer early event
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \param early_event The boolean value to set
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_params_set_early_event(snd_timer_params_t * params, int early_event)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	if (early_event)
Packit 4a16fb
		params->flags |= SNDRV_TIMER_PSFLG_EARLY_EVENT;
Packit 4a16fb
	else
Packit 4a16fb
		params->flags &= ~SNDRV_TIMER_PSFLG_EARLY_EVENT;
Packit 4a16fb
	return 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief determine if timer has early event flag
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \return nonzero if timer has early event flag set
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_params_get_early_event(snd_timer_params_t * params)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	return params->flags & SNDRV_TIMER_PSFLG_EARLY_EVENT ? 1 : 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief set timer ticks
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \param ticks Ticks to set
Packit 4a16fb
 */
Packit 4a16fb
void snd_timer_params_set_ticks(snd_timer_params_t * params, long ticks)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	params->ticks = ticks;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get timer ticks
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \return timer ticks
Packit 4a16fb
 */
Packit 4a16fb
long snd_timer_params_get_ticks(snd_timer_params_t * params)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	return params->ticks;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief set timer queue size (32-1024)
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \param queue_size The queue size to set
Packit 4a16fb
 */
Packit 4a16fb
void snd_timer_params_set_queue_size(snd_timer_params_t * params, long queue_size)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	params->queue_size = queue_size;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get queue size
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \return queue size
Packit 4a16fb
 */
Packit 4a16fb
long snd_timer_params_get_queue_size(snd_timer_params_t * params)
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	return params->queue_size;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief set timer event filter
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \param filter The event filter bits to set
Packit 4a16fb
 */
Packit 4a16fb
#ifndef DOXYGEN
Packit 4a16fb
EXPORT_SYMBOL void INTERNAL(snd_timer_params_set_filter)(snd_timer_params_t * params, unsigned int filter)
Packit 4a16fb
#else
Packit 4a16fb
void snd_timer_params_set_filter(snd_timer_params_t * params, unsigned int filter)
Packit 4a16fb
#endif
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	params->filter = filter;
Packit 4a16fb
}
Packit 4a16fb
use_default_symbol_version(__snd_timer_params_set_filter, snd_timer_params_set_filter, ALSA_0.9.0);
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get timer event filter
Packit 4a16fb
 * \param params pointer to #snd_timer_params_t structure
Packit 4a16fb
 * \return timer event filter
Packit 4a16fb
 */
Packit 4a16fb
#ifndef DOXYGEN
Packit 4a16fb
EXPORT_SYMBOL unsigned int INTERNAL(snd_timer_params_get_filter)(snd_timer_params_t * params)
Packit 4a16fb
#else
Packit 4a16fb
unsigned int snd_timer_params_get_filter(snd_timer_params_t * params)
Packit 4a16fb
#endif
Packit 4a16fb
{
Packit 4a16fb
	assert(params);
Packit 4a16fb
	return params->filter;
Packit 4a16fb
}
Packit 4a16fb
use_default_symbol_version(__snd_timer_params_get_filter, snd_timer_params_get_filter, ALSA_0.9.0);
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief set parameters for timer handle
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \param params pointer to a #snd_timer_params_t structure
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_params(snd_timer_t *timer, snd_timer_params_t * params)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	assert(params);
Packit 4a16fb
	return timer->ops->params(timer, params);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get size of the snd_timer_status_t structure in bytes
Packit 4a16fb
 * \return size of the snd_timer_status_t structure in bytes
Packit 4a16fb
 */
Packit 4a16fb
size_t snd_timer_status_sizeof()
Packit 4a16fb
{
Packit 4a16fb
	return sizeof(snd_timer_status_t);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief allocate a new snd_timer_status_t structure
Packit 4a16fb
 * \param status returned pointer
Packit 4a16fb
 * \return 0 on success otherwise a negative error code if fails
Packit 4a16fb
 *
Packit 4a16fb
 * Allocates a new snd_timer_status_t structure using the standard
Packit 4a16fb
 * malloc C library function.
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_status_malloc(snd_timer_status_t **status)
Packit 4a16fb
{
Packit 4a16fb
	assert(status);
Packit 4a16fb
	*status = calloc(1, sizeof(snd_timer_status_t));
Packit 4a16fb
	if (!*status)
Packit 4a16fb
		return -ENOMEM;
Packit 4a16fb
	return 0;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief frees the snd_timer_status_t structure
Packit 4a16fb
 * \param status pointer to the snd_timer_status_t structure to free
Packit 4a16fb
 *
Packit 4a16fb
 * Frees the given snd_timer_status_t structure using the standard
Packit 4a16fb
 * free C library function.
Packit 4a16fb
 */
Packit 4a16fb
void snd_timer_status_free(snd_timer_status_t *status)
Packit 4a16fb
{
Packit 4a16fb
	assert(status);
Packit 4a16fb
	free(status);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief copy one snd_timer_status_t structure to another
Packit 4a16fb
 * \param dst destination snd_timer_status_t structure
Packit 4a16fb
 * \param src source snd_timer_status_t structure
Packit 4a16fb
 */
Packit 4a16fb
void snd_timer_status_copy(snd_timer_status_t *dst, const snd_timer_status_t *src)
Packit 4a16fb
{
Packit 4a16fb
	assert(dst && src);
Packit 4a16fb
	*dst = *src;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get timestamp
Packit 4a16fb
 * \param status pointer to #snd_timer_status_t structure
Packit 4a16fb
 * \return timestamp
Packit 4a16fb
 */
Packit 4a16fb
snd_htimestamp_t snd_timer_status_get_timestamp(snd_timer_status_t * status)
Packit 4a16fb
{
Packit 4a16fb
	assert(status);
Packit 4a16fb
	return status->tstamp;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get resolution in us
Packit 4a16fb
 * \param status pointer to #snd_timer_status_t structure
Packit 4a16fb
 * \return resolution
Packit 4a16fb
 */
Packit 4a16fb
long snd_timer_status_get_resolution(snd_timer_status_t * status)
Packit 4a16fb
{
Packit 4a16fb
	assert(status);
Packit 4a16fb
	return status->resolution;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get master tick lost count
Packit 4a16fb
 * \param status pointer to #snd_timer_status_t structure
Packit 4a16fb
 * \return master tick lost count
Packit 4a16fb
 */
Packit 4a16fb
long snd_timer_status_get_lost(snd_timer_status_t * status)
Packit 4a16fb
{
Packit 4a16fb
	assert(status);
Packit 4a16fb
	return status->lost;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get overrun count
Packit 4a16fb
 * \param status pointer to #snd_timer_status_t structure
Packit 4a16fb
 * \return overrun count
Packit 4a16fb
 */
Packit 4a16fb
long snd_timer_status_get_overrun(snd_timer_status_t * status)
Packit 4a16fb
{
Packit 4a16fb
	assert(status);
Packit 4a16fb
	return status->overrun;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get count of used queue elements
Packit 4a16fb
 * \param status pointer to #snd_timer_status_t structure
Packit 4a16fb
 * \return count of used queue elements
Packit 4a16fb
 */
Packit 4a16fb
long snd_timer_status_get_queue(snd_timer_status_t * status)
Packit 4a16fb
{
Packit 4a16fb
	assert(status);
Packit 4a16fb
	return status->queue;
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief get status from timer handle
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \param status pointer to a #snd_timer_status_t structure to be filled
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_status(snd_timer_t *timer, snd_timer_status_t * status)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	assert(status);
Packit 4a16fb
	return timer->ops->status(timer, status);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief start the timer
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_start(snd_timer_t *timer)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	return timer->ops->rt_start(timer);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief stop the timer
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_stop(snd_timer_t *timer)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	return timer->ops->rt_stop(timer);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief continue the timer
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \return 0 on success otherwise a negative error code
Packit 4a16fb
 */
Packit 4a16fb
int snd_timer_continue(snd_timer_t *timer)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	return timer->ops->rt_continue(timer);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief read bytes using timer handle
Packit 4a16fb
 * \param timer timer handle
Packit 4a16fb
 * \param buffer buffer to store the input bytes
Packit 4a16fb
 * \param size input buffer size in bytes
Packit 4a16fb
 */
Packit 4a16fb
ssize_t snd_timer_read(snd_timer_t *timer, void *buffer, size_t size)
Packit 4a16fb
{
Packit 4a16fb
	assert(timer);
Packit 4a16fb
	assert(((timer->mode & O_ACCMODE) == O_RDONLY) || ((timer->mode & O_ACCMODE) == O_RDWR));
Packit 4a16fb
	assert(buffer || size == 0);
Packit 4a16fb
	return (timer->ops->read)(timer, buffer, size);
Packit 4a16fb
}
Packit 4a16fb
Packit 4a16fb
/**
Packit 4a16fb
 * \brief (DEPRECATED) get maximum timer ticks
Packit 4a16fb
 * \param info pointer to #snd_timer_info_t structure
Packit 4a16fb
 * \return maximum timer ticks
Packit 4a16fb
 */
Packit 4a16fb
long snd_timer_info_get_ticks(snd_timer_info_t * info)
Packit 4a16fb
{
Packit 4a16fb
	assert(info);
Packit 4a16fb
	return 1;
Packit 4a16fb
}
Packit 4a16fb
#ifndef DOC_HIDDEN
Packit 4a16fb
link_warning(snd_timer_info_get_ticks, "Warning: snd_timer_info_get_ticks is deprecated");
Packit 4a16fb
#endif