Emery Hemingway
5e8bc9ef51
Define a unified packet-buffer format for both Audio_out and Audio_in sessions. This allows an Audio_out and an Audio_in client to exchange packets with a common buffer and lexicon. The sessions have also been stripped down to a minimum. The 'progress' and 'data_avail' signal handlers have been replaced with a single 'progress' signal sent by Audio_in and received by Audio_in. The Audio_in session has a reset signal delivered to the client to indicate that the progress signal handler has been replaced (dubious). These changes reflect a different relationship between the two sessions. Drivers that play audio are now Audio_in clients and drive the rate that packets can be consumed by sending progress signals. Ref #2858
37 lines
728 B
C++
37 lines
728 B
C++
/*
|
|
* \brief Common format parameters for Audio_* sessions
|
|
* \author Emery Hemingway
|
|
* \date 2019-06-19
|
|
*/
|
|
|
|
/*
|
|
* Copyright (C) 2019 Genode Labs GmbH
|
|
*
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
*/
|
|
|
|
#ifndef _INCLUDE__AUDIO__PARAMETERS_H_
|
|
#define _INCLUDE__AUDIO__PARAMETERS_H_
|
|
|
|
#include <base/stdint.h>
|
|
|
|
#define GENODE_AUDIO_SAMPLE_RATE 48000
|
|
|
|
#ifdef __cplusplus
|
|
|
|
namespace Audio {
|
|
|
|
enum {
|
|
QUEUE_SIZE = 431,
|
|
SAMPLE_RATE = GENODE_AUDIO_SAMPLE_RATE,
|
|
SAMPLE_SIZE = sizeof(float),
|
|
};
|
|
|
|
static constexpr Genode::size_t PERIOD = 800; /* samples per period (60 Hz) */
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif // _INCLUDE__AUDIO__PARAMETERS_H_
|