alsa.h
1 /*
2  * Player - One Hell of a Robot Server
3  * Copyright (C) 2003
4  * Brian Gerkey
5  *
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  *
21  */
22 
23 #include <alsa/asoundlib.h>
24 
25 #include "audio_sample.h"
26 
28 // Describes a prestored sample for playing with PLAYER_AUDIO_CMD_SAMPLE_PLAY
29 typedef struct StoredSample
30 {
31  AudioSample *sample;
32  int index; // Index of sample
33  struct StoredSample *next; // Next sample in the linked list
34 } StoredSample;
35 
37 // An item on the queue of waves to play
38 typedef struct QueueItem
39 {
40  AudioSample *sample; // Audio sample at this position in the queue
41  bool temp; // If true, the AudioSample will be deleted after playback completes
42  struct QueueItem *next; // Next item in the queue
43 } QueueItem;
44 
46 // Capabilities of a mixer element
47 typedef uint32_t ElemCap;
48 const ElemCap ELEMCAP_CAN_PLAYBACK = 0x0001;
49 const ElemCap ELEMCAP_CAN_CAPTURE = 0x0002;
50 const ElemCap ELEMCAP_COMMON = 0x0004; // Has a single volume control for both playback and record
51 const ElemCap ELEMCAP_PLAYBACK_VOL = 0x0008;
52 const ElemCap ELEMCAP_CAPTURE_VOL = 0x0010;
53 const ElemCap ELEMCAP_COMMON_VOL = 0x0020;
54 const ElemCap ELEMCAP_PLAYBACK_SWITCH = 0x0040;
55 const ElemCap ELEMCAP_CAPTURE_SWITCH = 0x0080;
56 const ElemCap ELEMCAP_COMMON_SWITCH = 0x0100;
57 // const ElemCap ELEMCAP_PB_JOINED_SWITCH = 0x0200;
58 // const ElemCap ELEMCAP_CAP_JOINED_SWITCH = 0x0400;
59 
60 // Describes an ALSA mixer element
61 typedef struct MixerElement
62 {
63  snd_mixer_elem_t *elem; // ALSA Mixer element structure
64  long minPlayVol, curPlayVol, maxPlayVol; // min, current and max volume levels for playback
65  long minCapVol, curCapVol, maxCapVol; // min, current and max volume levels for capture
66  long minComVol, curComVol, maxComVol; // min, current and max volume levels for common
67  int playSwitch, capSwitch, comSwitch; // Current switch status
68  char *name; // Name of the element
69  ElemCap caps; // Capabilities
70 } MixerElement;
71 
73 // State of the playback system
74 typedef uint8_t PBState;
75 const PBState PB_STATE_STOPPED = 0; // Not playing anything
76 const PBState PB_STATE_PLAYING = 1; // Playing
77 const PBState PB_STATE_DRAIN = 2; // Draining current wave
78 const PBState PB_STATE_RECORDING = 3; // Recording
79 
81 // The class for the driver
82 class Alsa : public ThreadedDriver
83 {
84  public:
85  Alsa (ConfigFile* cf, int section);
86  ~Alsa (void);
87 
88  virtual int ProcessMessage (QueuePointer &resp_queue, player_msghdr *hdr, void *data);
89 
90  private:
91  // Driver options
92  bool useQueue; // If should use a queue for playback or just stop currently playing
93  uint8_t debugLevel; // Debug info level
94  char **mixerFilters; // Null-terminated array of strings to filter mixer elements by
95  bool mixerFilterExact; // If mixer filters need to match element names exactly
96  char *pbDevice; // Name of the playback device
97  char *mixerDevice; // Name of the mixer device
98  char *recDevice; // Name of the record device
99  uint32_t cfgPBPeriodTime; // Length of a playback period in milliseconds
100  uint32_t cfgPBBufferTime; // Length of the playback buffer in milliseconds
101  uint32_t silenceTime; // Length of silence to put between samples in the queue
102  uint32_t cfgRecBufferTime; // Length of the record buffer in milliseconds
103  uint32_t cfgRecStoreTime; // Length of time to store recorded data before sending to clients
104  uint32_t cfgRecPeriodTime; // Length of a record period in milliseconds
105  uint8_t recNumChannels; // Number of channels for recording
106  uint32_t recSampleRate; // Sample rate for recording
107  uint8_t recBits; // Sample bits per frame for recording
108 
109  // ALSA variables
110  // Playback
111  snd_pcm_t *pbHandle; // Handle to the PCM device for playback
112  int numPBFDs; // Number of playback file descriptors
113  struct pollfd *pbFDs; // Playback file descriptors for polling
114  uint32_t actPBBufferTime; // Length of the playback buffer in microseconds (actual value)
115  uint32_t actPBPeriodTime; // Length of a playback period in microseconds (actual value)
116  snd_pcm_uframes_t pbPeriodSize; // Size of a playback period (used for filling the buffer)
117  uint8_t *periodBuffer; // A buffer used to copy data from samples to the playback buffer
118  // Record
119  snd_pcm_t *recHandle; // Handle to the PCM device for recording
120  int numRecFDs; // Number of record file descriptors
121  struct pollfd *recFDs; // Record file descriptors for polling
122  uint32_t actRecBufferTime; // Length of the record buffer in microseconds (actual value)
123  uint32_t actRecPeriodTime; // Length of a record period in microseconds (actual value)
124  snd_pcm_uframes_t recPeriodSize; // Size of a record period (used for filling the buffer)
125  // Mixer
126  snd_mixer_t *mixerHandle; // Mixer for controlling volume levels
127  MixerElement *mixerElements; // Elements of the mixer
128  uint32_t numElements; // Number of elements
129 
130  // Other driver data
131  int nextSampleIdx; // Next free index to store a sample at
132  StoredSample *samplesHead, *samplesTail; // Stored samples
133  QueueItem *queueHead, *queueTail; // Queue of audio data waiting to play
134  PBState playState; // Playback state
135  PBState recState; // Record state
136  uint32_t recDataLength; // Length of recorded data buffer (in bytes)
137  uint32_t recDataOffset; // Current end of recorded data in recData
138  uint8_t *recData; // Somewhere to store recorded data before it goes to the client
139  int recDest; // Destination of recorded data: -ve for to clients via data packets,
140  // >=0 for to stored sample at that index
141 
142  // Internal functions
143  virtual void Main (void);
144  virtual int MainSetup (void);
145  virtual void MainQuit (void);
146  void SendStateMessage (void);
147 
148  // Stored sample functions
149  bool AddStoredSample (StoredSample *newSample);
150  bool AddStoredSample (player_audio_wav_t *waveData);
151  bool AddStoredSample (const char *filePath);
152  StoredSample* GetSampleAtIndex (int index);
153 
154  // Queue functions
155  void ClearQueue (void);
156  bool AddToQueue (QueueItem *newItem);
157  bool AddToQueue (player_audio_wav_t *waveData);
158  bool AddToQueue (AudioSample *sample);
159  bool AddSilence (uint32_t time, AudioSample *format);
160  void AdvanceQueue (void);
161 
162  // Playback functions
163 // bool SetGeneralParams (void);
164 // bool SetWaveHWParams (AudioSample *sample);
165  bool SetupPlayBack (void);
166  bool SetPBParams (AudioSample *sample);
167  void PlaybackCallback (int numFrames);
168 
169  // Record functions
170  bool SetupRecord (void);
171  bool SetRecParams (void);
172  bool SetupRecordBuffer (uint32_t length);
173  void RecordCallback (int numFrames);
174  void HandleRecordedData (void);
175  void PublishRecordedData (void);
176 
177  // Playback/record control functions
178  void StartPlayback (void);
179  void StopPlayback (void);
180  void StartRecording (void);
181  void StopRecording (void);
182 
183  // Mixer functions
184  bool SetupMixer (void);
185  bool EnumMixerElements (void);
186  bool EnumElementCaps (MixerElement *element);
187  MixerElement* SplitElements (MixerElement *elements, uint32_t &count);
188  MixerElement* FilterElements (MixerElement *elements, uint32_t &count);
189  void CleanUpMixerElements (MixerElement *elements, uint32_t count);
190  void MixerDetailsToPlayer (player_audio_mixer_channel_list_detail_t *dest);
191  void MixerLevelsToPlayer (player_audio_mixer_channel_list_t *dest);
192  void SetElementLevel (uint32_t index, float level);
193  void SetElementSwitch (uint32_t index, player_bool_t active);
194  void PublishMixerData (void);
195  float LevelToPlayer (long min, long max, long level);
196  long LevelFromPlayer (long min, long max, float level);
197  void PrintMixerElements (MixerElement *elements, uint32_t count);
198 
199  // Command and request handling
200  int HandleWavePlayCmd (player_audio_wav_t *waveData);
201  int HandleSamplePlayCmd (player_audio_sample_item_t *data);
202  int HandleRecordCmd (player_bool_t *data);
203  int HandleMixerChannelCmd (player_audio_mixer_channel_list_t *data);
204  int HandleSampleLoadReq (player_audio_sample_t *data, QueuePointer &resp_queue);
205  int HandleSampleRetrieveReq (player_audio_sample_t *data, QueuePointer &resp_queue);
206  int HandleSampleRecordReq (player_audio_sample_rec_req_t *data, QueuePointer &resp_queue);
207  int HandleMixerChannelListReq (player_audio_mixer_channel_list_detail_t *data, QueuePointer &resp_queue);
208  int HandleMixerChannelLevelReq (player_audio_mixer_channel_list_t *data, QueuePointer &resp_queue);
209 };
T min(T a, T b)
Return the minimum of a, b.
Definition: utility.h:113
#define PLAYER_WARN1(msg, a)
Error message macros.
Definition: error.h:90
player_audio_wav_t sample
the audio sample data
Definition: player_interfaces.h:1592
int32_t index
index to store it at or retrieve from (-1 for next available where valid)
Definition: player_interfaces.h:1594
char * guid
The Globally Unique IDentifier (GUID) of the tag.
Definition: player_interfaces.h:4318
uint32_t blobs_count
The number of blobs.
Definition: player_interfaces.h:1103
player_rfid_tag_t * tags
The list of RFID tags.
Definition: player_interfaces.h:4329
int32_t default_input
default input channel (-1 for none)
Definition: player_interfaces.h:1578
Data: detected blobs (PLAYER_BLOBFINDER_DATA_BLOBS)
Definition: player_interfaces.h:1096
uint8_t caps
Channel type (input, output or special)
Definition: player_interfaces.h:1559
uint32_t channels_count
number of channels in list
Definition: player_interfaces.h:1533
uint32_t color
A descriptive color for the blob (useful for gui's).
Definition: player_interfaces.h:1074
double proll
roll [rad]
Definition: player.h:237
#define PLAYER_MSG1(level, msg, a)
Error message macros.
Definition: error.h:106
virtual void Publish(player_devaddr_t addr, QueuePointer &queue, uint8_t type, uint8_t subtype, void *src=NULL, size_t deprecated=0, double *timestamp=NULL, bool copy=true)
Publish a message via one of this driver's interfaces.
float accel_z
The node's acceleration on Z-axis from an acceleration sensor.
Definition: player_interfaces.h:4392
Definition: alsa.h:82
static bool MatchMessage(player_msghdr_t *hdr, int type, int subtype, player_devaddr_t addr)
Helper for message processing.
Definition: message.h:159
#define PLAYER_MAX_PAYLOAD_SIZE
Maximum payload in a message.
Definition: player.h:70
float temperature
The node's templerature measurement from a temperature sensor.
Definition: player_interfaces.h:4400
uint32_t poses_count
The number of valid poses.
Definition: player_interfaces.h:788
uint32_t right
Bounding box for the blob [pixels].
Definition: player_interfaces.h:1084
double ReadFloat(int section, const char *name, double value)
Read a floating point (double) value.
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: alsa.cc:2156
#define PLAYER_AUDIO_STATE_PLAYING
Data subtype: wav_rec_data, recorded data block.
Definition: player_interfaces.h:1421
Player audio sample selection.
Definition: player_interfaces.h:1602
Data: ranges (PLAYER_SONAR_DATA_RANGES)
Definition: player_interfaces.h:771
Data AND Request/reply: geometry.
Definition: player_interfaces.h:785
Player audio sample record request.
Definition: player_interfaces.h:1613
#define PLAYER_AUDIO_24BIT
24 bit
Definition: player_interfaces.h:1434
int32_t index
index of the sample
Definition: player_interfaces.h:1605
uint32_t height
The image dimensions.
Definition: player_interfaces.h:1101
double ReadTupleLength(int section, const char *name, int index, double value)
Read a length from a tuple (includes units conversion)
uint32_t left
Bounding box for the blob [pixels].
Definition: player_interfaces.h:1082
Generic message header.
Definition: player.h:161
virtual int MainSetup(void)
Sets up the resources needed by the driver thread.
Definition: driver.h:658
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: driver.h:664
Data: state (PLAYER_POSITION3D_DATA_STATE)
Definition: player_interfaces.h:2476
uint32_t name_count
name length
Definition: player_interfaces.h:1555
player_pose3d_t pos
(x, y, z, roll, pitch, yaw) position [m, m, m, rad, rad, rad]
Definition: player_interfaces.h:2479
player_audio_mixer_channel_detail_t * details
the tones
Definition: player_interfaces.h:1574
float * voltages
the samples [V]
Definition: player_interfaces.h:2058
#define PLAYER_AUDIO_FREQ_48k
Data subtype: wav_rec_data, recorded data block.
Definition: player_interfaces.h:1444
uint32_t bottom
Bounding box for the blob [pixels].
Definition: player_interfaces.h:1088
Encapsulates a device (i.e., a driver bound to an interface)
Definition: device.h:74
const char * ReadString(int section, const char *name, const char *value)
Read a string value.
#define PLAYER_POSITION3D_DATA_STATE
Data subtype: state.
Definition: player_interfaces.h:2432
#define PLAYER_BLOBFINDER_DATA_BLOBS
Structure describing a single blob.
Definition: player_interfaces.h:1055
Player mixer channels.
Definition: player_interfaces.h:1530
double pyaw
yaw [rad]
Definition: player.h:241
uint8_t subtype
Message subtype; interface specific.
Definition: player.h:168
virtual void Main(void)=0
Main method for driver thread.
#define PLAYER_AUDIO_STATE_STOPPED
Driver states.
Definition: player_interfaces.h:1420
#define PLAYER_AUDIO_FREQ_22k
Data subtype: wav_rec_data, recorded data block.
Definition: player_interfaces.h:1443
const char * ReadTupleString(int section, const char *name, int index, const char *value)
Read a string from a tuple field.
char * name
Descriptive channel name.
Definition: player_interfaces.h:1557
const char * ReadFilename(int section, const char *name, const char *value)
Read a filename.
int ReadInt(int section, const char *name, int value)
Read an integer value.
int32_t default_output
default output channel (-1 for none)
Definition: player_interfaces.h:1576
uint32_t y
The blob centroid [pixels].
Definition: player_interfaces.h:1080
void ProcessMessages(void)
Process pending messages.
#define PLAYER_MSGTYPE_DATA
A data message.
Definition: player.h:95
QueuePointer InQueue
Queue for all incoming messages for this driver.
Definition: driver.h:285
#define PLAYER_ERROR2(msg, a, b)
Error message macros.
Definition: error.h:83
float range
Range to the blob center [meters].
Definition: player_interfaces.h:1090
float battery
The node's remaining battery voltage.
Definition: player_interfaces.h:4402
player_wsn_node_data_t data_packet
The WSN node's data packet.
Definition: player_interfaces.h:4417
#define PLAYER_MSGTYPE_RESP_ACK
A positive response message.
Definition: player.h:112
#define PLAYER_AUDIO_REQ_MIXER_CHANNEL_LEVEL
Request subtype: mixer_channel_level_req, request the channel levels.
Definition: player_interfaces.h:1414
#define PLAYER_AUDIO_CMD_WAV_STREAM_REC
Command subtype: wav_stream_rec_cmd, start/stop recording, data will be returned as data blocks.
Definition: player_interfaces.h:1369
#define PLAYER_WARN2(msg, a, b)
Error message macros.
Definition: error.h:91
Definition: audio_sample.h:32
Definition: alsa.h:29
#define PLAYER_RFID_DATA_TAGS
Data subtype.
Definition: player_interfaces.h:4293
uint32_t id
Blob id.
Definition: player_interfaces.h:1071
Player mixer channels.
Definition: player_interfaces.h:1569
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
#define PLAYER_AUDIO_DATA_WAV_REC
Data subtype: wav_rec_data, recorded data block.
Definition: player_interfaces.h:1344
bool ReadBool(int section, const char *name, bool value)
Read a boolean value (one of: yes, no, true, false, 1, 0)
float magn_x
The node's magnetic measurement on X-axis from a magnetometer.
Definition: player_interfaces.h:4394
#define PLAYER_AUDIO_16BIT
16 bit
Definition: player_interfaces.h:1432
double ppitch
pitch [rad]
Definition: player.h:239
#define PLAYER_AUDIO_FORMAT_RAW
Data subtype: wav_rec_data, recorded data block.
Definition: player_interfaces.h:1450
#define PLAYER_AUDIO_FREQ_11k
Data subtype: wav_rec_data, recorded data block.
Definition: player_interfaces.h:1442
virtual int ProcessMessage(QueuePointer &resp_queue, player_msghdr *hdr, void *data)
Message handler.
Definition: alsa.cc:2575
#define PLAYER_MSGTYPE_REQ
A request message.
Definition: player.h:106
uint32_t ReadTupleColor(int section, const char *name, int index, uint32_t value)
Read a color (includes text to RGB conversion)
#define PLAYER_SONAR_REQ_POWER
Request/reply subtype: power.
Definition: player_interfaces.h:758
float light
The node's light measurement from a light sensor.
Definition: player_interfaces.h:4384
#define PLAYER_MSGTYPE_RESP_NACK
A negative response message.
Definition: player.h:125
uint32_t index
channel index
Definition: player_interfaces.h:1520
#define PLAYER_SONAR_DATA_RANGES
Data subtype: ranges.
Definition: player_interfaces.h:761
struct player_audio_wav player_audio_wav_t
Data: Raw audio data.
double ReadTupleAngle(int section, const char *name, int index, double value)
Read an angle form a tuple (includes units conversion)
#define PLAYER_AUDIO_MIXER_CHANNEL_TYPE_INPUT
Input audio channel.
Definition: player_interfaces.h:1541
#define PLAYER_AUDIO_8BIT
8 bit
Definition: player_interfaces.h:1430
float * ranges
The range readings [m].
Definition: player_interfaces.h:776
float mic
The node's accoustic measurement from a microphone.
Definition: player_interfaces.h:4386
int ReadDeviceAddr(player_devaddr_t *addr, int section, const char *name, int code, int index, const char *key)
Read a device id.
float accel_x
The node's acceleration on X-axis from an acceleration sensor.
Definition: player_interfaces.h:4388
uint32_t top
Bounding box for the blob [pixels].
Definition: player_interfaces.h:1086
#define PLAYER_AUDIO_FREQ_44k
Data subtype: wav_rec_data, recorded data block.
Definition: player_interfaces.h:1441
int GetTupleCount(int section, const char *name)
Get the number of values in a tuple.
Definition: alsa.h:38
#define PLAYER_SONAR_REQ_GET_GEOM
Request/reply subtype: get geometry.
Definition: player_interfaces.h:755
uint32_t voltages_count
number of valid samples
Definition: player_interfaces.h:2056
Class for loading configuration file information.
Definition: configfile.h:196
Data: state (PLAYER_AIO_DATA_STATE)
Definition: player_interfaces.h:2053
int ReadTupleInt(int section, const char *name, int index, int value)
Read an integer from a tuple field.
#define PLAYER_AUDIO_REQ_SAMPLE_LOAD
Request subtype: sample_load_req, store a sample.
Definition: player_interfaces.h:1394
#define PLAYER_CAPABILITIES_REQ
Capability request message type.
Definition: player.h:397
A device address.
Definition: player.h:145
An autopointer for the message queue.
Definition: message.h:73
uint8_t state
state
Definition: player.h:336
uint32_t state
The state of the driver: will be a bitmask of PLAYER_AUDIO_STATE_* values.
Definition: player_interfaces.h:1631
#define PLAYER_AUDIO_REQ_MIXER_CHANNEL_LIST
Request subtype: mixer_channel_list_req, request the list of channels.
Definition: player_interfaces.h:1409
uint32_t tags_count
The number of RFID tags found.
Definition: player_interfaces.h:4327
float magn_z
The node's magnetic measurement on Z-axis from a magnetometer.
Definition: player_interfaces.h:4398
A boolean variable, 0 for false anything else for true.
Definition: player.h:333
#define PLAYER_WSN_DATA_STATE
Data subtypes
Definition: player_interfaces.h:4364
#define PLAYER_AUDIO_CMD_SAMPLE_PLAY
Command subtype: sample_play_cmd, play a pre stored audio sample.
Definition: player_interfaces.h:1374
#define PLAYER_ERROR1(msg, a)
Error message macros.
Definition: error.h:82
bool Empty()
Check whether a queue is empty.
Definition: message.h:345
uint32_t node_id
The ID of the WSN node.
Definition: player_interfaces.h:4413
A pose in space.
Definition: player.h:228
uint32_t width
The image dimensions.
Definition: player_interfaces.h:1099
uint32_t type
Tag type.
Definition: player_interfaces.h:4314
player_audio_mixer_channel_t * channels
the channels
Definition: player_interfaces.h:1535
#define PLAYER_ERROR(msg)
Error message macros.
Definition: error.h:81
Player audio driver state.
Definition: player_interfaces.h:1628
player_devaddr_t device_addr
Default device address (single-interface drivers)
Definition: driver.h:269
Base class for drivers which oeprate with a thread.
Definition: driver.h:552
uint32_t ranges_count
The number of valid range readings.
Definition: player_interfaces.h:774
virtual void Main(void)
Main method for driver thread.
Definition: alsa.cc:2257
#define PLAYER_AUDIO_REQ_SAMPLE_REC
Request subtype: sample_rec_req, record a new sample.
Definition: player_interfaces.h:1404
player_blobfinder_blob_t * blobs
The list of blobs.
Definition: player_interfaces.h:1105
player_pose3d_t * poses
Pose of each sonar, in robot cs.
Definition: player_interfaces.h:790
Data (PLAYER_WSN_DATA_STATE)
Definition: player_interfaces.h:4408
#define PLAYER_AIO_DATA_STATE
Data: state (PLAYER_AIO_DATA_STATE)
Definition: player_interfaces.h:2046
int32_t index
Index to store at (-1 for next available).
Definition: player_interfaces.h:1617
#define PLAYER_AUDIO_STEREO
Stereo.
Definition: player_interfaces.h:1438
virtual void MainQuit(void)
Cleanup method for driver thread (called when main exits)
Definition: alsa.cc:2197
float magn_y
The node's magnetic measurement on Y-axis from a magnetometer.
Definition: player_interfaces.h:4396
#define PLAYER_AUDIO_CMD_MIXER_CHANNEL
Command subtype: mixer_channel_cmd, audio channel levels.
Definition: player_interfaces.h:1384
#define PLAYER_WARN(msg)
Warning message macros.
Definition: error.h:89
Definition: alsa.h:61
float amplitude
level (normalised 0 to 1)
Definition: player_interfaces.h:1516
Structure describing a single RFID tag.
Definition: player_interfaces.h:4311
#define PLAYER_MSGTYPE_CMD
A command message.
Definition: player.h:99
#define PLAYER_AUDIO_DATA_STATE
Data subtype: state_data, driver state data (eg playing, stopped, ...)
Definition: player_interfaces.h:1359
Base class for all drivers.
Definition: driver.h:108
Structure describing a single blob.
Definition: player_interfaces.h:1068
player_bool_t active
active (set to false to mute channel)
Definition: player_interfaces.h:1518
#define PLAYER_AUDIO_MIXER_CHANNEL_TYPE_OUTPUT
Output audio channel.
Definition: player_interfaces.h:1543
#define PLAYER_MSG0(level, msg)
General messages.
Definition: error.h:105
#define PLAYER_AUDIO_STATE_RECORDING
Data subtype: wav_rec_data, recorded data block.
Definition: player_interfaces.h:1422
float accel_y
The node's acceleration on Y-axis from an acceleration sensor.
Definition: player_interfaces.h:4390
#define PLAYER_AUDIO_REQ_SAMPLE_RETRIEVE
Request subtype: sample_retrieve_req, retrieve a stored sample.
Definition: player_interfaces.h:1399
uint32_t x
The blob centroid [pixels].
Definition: player_interfaces.h:1078
#define PLAYER_AUDIO_DATA_MIXER_CHANNEL
Data subtype: mixer_channel_data, audio channel levels.
Definition: player_interfaces.h:1354
uint32_t guid_count
GUID count.
Definition: player_interfaces.h:4316
Data.
Definition: player_interfaces.h:4324
uint32_t length
Length of sample to record in ms.
Definition: player_interfaces.h:1619
Player audio sample.
Definition: player_interfaces.h:1589
#define PLAYER_AUDIO_CMD_WAV_PLAY
Command subtype: wav_play_cmd, play a raw data block, in structure player_audio_wav_t.
Definition: player_interfaces.h:1364
#define PLAYER_MSGQUEUE_DEFAULT_MAXLEN
Default maximum length for a message queue.
Definition: player.h:76
T max(T a, T b)
Return the maximum of a, b.
Definition: utility.h:126
Data: Raw audio data.
Definition: player_interfaces.h:1463
uint32_t details_count
number of tones in list
Definition: player_interfaces.h:1572