diff --git a/gtk2_ardour/luadialog.cc b/gtk2_ardour/luadialog.cc
index 8ceba1b833..1d6e7fbc2a 100644
--- a/gtk2_ardour/luadialog.cc
+++ b/gtk2_ardour/luadialog.cc
@@ -386,12 +386,19 @@ public:
 		: LuaDialogWidget (key, title)
 		, _rv (0)
 	{
+		std::map<std::string, std::string> labels_ordered_by_value;
 		for (luabridge::Iterator i (values); !i.isNil (); ++i) {
+			// i.key is the label of the radio button, i.value is the value.
+			// We sort by values to have a deterministic order of the radio buttons,
+			// which is still independent of the content of the button labels.
 			if (!i.key ().isString ())  { continue; }
-			std::string key = i.key ().cast<std::string> ();
-			Gtk::RadioButton* rb = Gtk::manage (new Gtk::RadioButton (_group, key));
+			std::string value_str = i.value ().cast<std::string> ();
+			labels_ordered_by_value.emplace (value_str, i.key ().cast<std::string> ());
+		}
+		for (auto const &i : labels_ordered_by_value) {
+			Gtk::RadioButton* rb = Gtk::manage (new Gtk::RadioButton (_group, i.second));
 			_hbox.pack_start (*rb);
-			luabridge::LuaRef* ref = new luabridge::LuaRef (i.value ());
+			luabridge::LuaRef* ref = new luabridge::LuaRef (values[i.second]);
 			_refs.push_back (ref);
 			if (!_rv) { _rv = ref; }
 			rb->signal_toggled ().connect (sigc::bind (
