@@ -125,6 +125,18 @@ type PingStats struct {
125125 // LatestRtt is the latest rtt sent via socket ping.
126126 LatestRtt time.Duration `json:"latest_rtt" db:"latest_rtt"`
127127
128+ // AudioInputLatency is the latest client-side audio input device latency
129+ AudioInputLatency time.Duration `json:"audio_input_latency" db:"audio_input_latency"`
130+
131+ // AudioOutputLatency is the latest client-side audio output device latency
132+ AudioOutputLatency time.Duration `json:"audio_output_latency" db:"audio_output_latency"`
133+
134+ // ClientBufferLatency is the latest client-side receiver buffer latency
135+ ClientBufferLatency time.Duration `json:"client_buffer_latency" db:"client_buffer_latency"`
136+
137+ // ServerBufferLatency is the latest server-side receiver buffer latency
138+ ServerBufferLatency time.Duration `json:"server_buffer_latency" db:"server_buffer_latency"`
139+
128140 // timestamp when the device stats were last updated
129141 StatsUpdatedAt time.Time `json:"stats_updated_at" db:"stats_updated_at"`
130142
@@ -162,3 +174,37 @@ type DeviceHeartbeat struct {
162174 // Type of sound device ("snd_rpi_hifiberry_dacplusadcpro")
163175 Type string `json:"type" db:"type"`
164176}
177+
178+ // DeviceHeartbeatWithConfig is used to represent ping statistics with config for an audio device
179+ type DeviceHeartbeatWithConfig struct {
180+ PingStats
181+ DeviceConfig
182+ ALSAConfig
183+
184+ // unique identifier for an audio device
185+ ID string `json:"id" db:"id"`
186+
187+ // MAC address of the device
188+ MAC string `json:"mac" db:"mac"`
189+
190+ // User identifier of the device's owner
191+ OwnerID string `json:"ownerId" db:"owner_id"`
192+
193+ // audio server that the device is connected to (may be empty)
194+ ServerID string `json:"serverId" db:"server_id"`
195+
196+ // Current image version for the device
197+ Version string `json:"version" db:"version"`
198+
199+ // Descriptive name for the device
200+ Name string `json:"name" db:"name"`
201+
202+ // frames per period
203+ Period int `json:"period" db:"period"`
204+
205+ // size of jitter queue buffer
206+ QueueBuffer int `json:"queueBuffer" db:"queue_buffer"`
207+
208+ // strategy to use for the network jitter buffer
209+ BufferStrategy int `json:"bufferStrategy" db:"buffer_strategy"`
210+ }
0 commit comments