First cook the lentils. Rinse them then put them in a pot of cols water. Add the ginger and garlic, then bring to the boil. Cook for about 25-30 minutes until the lentils are tender but not mushy. Drain and set them aside to cool. Remove the ginger and garlic pieces. Alternatively, drain a tin of lentils.
Cut the mushroom into bite-size chunks, if they seem big. Thinly slice the onion and garlic.
Heat some oil in a frying pan, then sauté the onion and garlic, over low heat, for about 5 minutes, until tender.
Add the mushrooms and chilli flakes (if used), then sweat them for 10 minutes under a lid - they should release some liquid.
Add the vinegar, mirin, soy and stir for another minute, then add the lentils.
Warm through the lentils bu stirring, then season to taste. Turn off the heat.
Stir in the miso and the chopped herbs.
Serve warm.