diff --git a/repos/os/src/server/record_play_mixer/README b/repos/os/src/server/record_play_mixer/README index 183b2f2178..9d10d0006e 100644 --- a/repos/os/src/server/record_play_mixer/README +++ b/repos/os/src/server/record_play_mixer/README @@ -70,6 +70,28 @@ period of 80 ms could be configured to a jitter of 10 ms. In the presence of multiple jitter attributes (e.g, one present in the node and one present in a node, the highest value takes effect. +State report +~~~~~~~~~~~~ + +The mixer generates a state-report that contains all active Play and +Record sessions. This information can be used to augment the configuration +by specifying the complete label in each '' and '' (for +Record session) node. + +The following snippet shows an examplary state-report: + +! +! +! +! +! +! +! +! + +The state-report additionally also reflects the current version of the +configuration if the '' node contains a 'version' attribute. + Example ~~~~~~~ diff --git a/repos/os/src/server/record_play_mixer/main.cc b/repos/os/src/server/record_play_mixer/main.cc index b1015a89cd..15fb4cb73a 100644 --- a/repos/os/src/server/record_play_mixer/main.cc +++ b/repos/os/src/server/record_play_mixer/main.cc @@ -91,6 +91,11 @@ struct Mixer::Main : Record_session::Operations, Play_session::Operations }); } + void update_record_sessions_state() override + { + _update_state_report(); + } + /** * Play_session::Operations */ @@ -103,6 +108,11 @@ struct Mixer::Main : Record_session::Operations, Play_session::Operations audio_signal.bind_inputs(_audio_signals, _play_sessions); }); } + void update_play_sessions_state() override + { + _update_state_report(); + } + /** * Play_session::Operations */ @@ -116,7 +126,14 @@ struct Mixer::Main : Record_session::Operations, Play_session::Operations { if (_clock_from_config.constructed()) xml.attribute("clock_value", _clock_from_config->us()); - (void)xml; + _play_sessions.for_each([&] (Play_session const &play_session) { + xml.node("play", [&] { + xml.attribute("label", play_session.label()); }); + }); + _record_sessions.for_each([&] (Record_session const &record_session) { + xml.node("record", [&] { + xml.attribute("label", record_session.label()); }); + }); } void _update_state_report() diff --git a/repos/os/src/server/record_play_mixer/play_session.h b/repos/os/src/server/record_play_mixer/play_session.h index d2d78604da..3ec5c2e5ee 100644 --- a/repos/os/src/server/record_play_mixer/play_session.h +++ b/repos/os/src/server/record_play_mixer/play_session.h @@ -35,6 +35,7 @@ class Mixer::Play_session : public Session_object, struct Operations : virtual Clock_operations { + virtual void update_play_sessions_state() = 0; virtual void bind_play_sessions_to_audio_signals() = 0; virtual void wakeup_record_clients() = 0; }; @@ -238,6 +239,7 @@ class Mixer::Play_session : public Session_object, _operations(operations) { _operations.bind_play_sessions_to_audio_signals(); + _operations.update_play_sessions_state(); } void global_jitter_us(unsigned us) { _expected_jitter_us = us; }; @@ -462,6 +464,7 @@ class Mixer::Play_root : public Root_component { Genode::destroy(md_alloc(), session); _operations.bind_play_sessions_to_audio_signals(); + _operations.update_play_sessions_state(); } public: diff --git a/repos/os/src/server/record_play_mixer/record_session.h b/repos/os/src/server/record_play_mixer/record_session.h index facb9d53fb..5b9550e549 100644 --- a/repos/os/src/server/record_play_mixer/record_session.h +++ b/repos/os/src/server/record_play_mixer/record_session.h @@ -38,6 +38,7 @@ class Mixer::Record_session : public Session_object void _destroy_session(Record_session *session) override { Genode::destroy(md_alloc(), session); + _operations.update_record_sessions_state(); } public: