As C Stuart Hardwick said, if it is just oxygen, then algae will do, 18 litres for BIOS-1 for one person. The next step up from that would be to grow food and you don’t need a full ecosystem like Biosphere II - you just need 30 square meters of growing area per person and they will not only grow most of their own food but provide all the oxygen they need too.
This shows the chlorella cultivar used in the originally rather secretive Russian BIOS-1 experiment in 1965. Image from this paper. I can't find much by way of details of its construction so far and how it worked. But the principle was simple - supply lots of light to Chlorella algae and it photosynthesizes, absorbs carbon dioxide and produces oxygen. In modern designs, they do this by piping light into the container using light tubes, which gives you a compact design.
In the first experiment it was in a separate room, tended from outside, and supplied all the oxygen for a single volunteer. In BIOS-2 they put the cultivar inside the habitat, recycled other wastes as well, and produced some crops. In BIOS-3 they made the habitat larger, with a crew of 3, and changed to growing crops as their sole source of oxygen.
But if you grow all your own food - well it’s interesting you automatically get enough oxygen to breathe :). And Biosphere II is inefficient in the use of space - you wouldn’t grow trees if your priority is to get enough oxygen for the astronauts. You’d use the most rapidly growing trees you can find, or, why not use rapidly growing food crops instead? You can manage with much less vegetation, just 30 square meters per person, to grow nearly all their own food as well as supply all the oxygen they need, using fast growing crops such as beet, radishes, dwarf wheat (which reaches maturity in a month) etc..
The thing is, plants take in carbon dioxide to grow and produce oxygen. When we eat them or burn them, the carbon reacts with the oxygen to turn it back to carbon dioxide.
If there is nothing else in the system, just plants grown for food, and humans eating them, then if you grow enough food to eat, then the plants that made that food produce more than enough oxygen, You then get crop wastes, but you can just burn those (or compost them) and the equations will still work out.
You might wonder - what about the carbon in feces? Well, feces are actually nearly all water. There’s a small amount of carbon there but nearly all the carbon we eat is turned into carbon dioxide as we eat the food. And if you dry and then incinerate the feces, you return those to carbon dioxide too, completing the cycle.
If the astronauts import food then they won’t get enough oxygen, and in that case you need to supplement it, so you could use the algae in that case.
Biosphere II is an inefficient way to grow food, so though we might well get habitats like that eventually, earlier ones are likely to be more pragmatic.
"Wheat plants of various ages showing the "conveyor" approach that was used in the Bios experiments, Young wheat plants are in the foreground, with more mature plants toward the back." Photo from here
BIOS-3 produced nearly all the food for the crew from 30 square meters (so 6 meters by 5 meters) per person, a conveyor belt system, growing fast cropping plants such as dwarf wheat, radish, beet, etc. that produce their crop within 30 days.
You could grow trees in a larger habitat. Or you can grow them using carbon dioxide supplied from elsewhere. They take away from the total food production by converting CO2 into wood that could otherwise be converted into food. They might be useful in large habitats, e.g. lunar caves, or in the Venus upper atmosphere especially, with lots of carbon dioxide available from the atmosphere - the trees could convert that into building materials for new habitats. Or grown as part of an attempt at duplicating a more extensive ecosystem with other creatures in it, or for decorative reasons, or for fruit and nuts. If they are composted or burnt then they are carbon neutral. If used for wood etc then they would be net producers of oxygen. See my answer to Do trees consume oxygen?
For more on all this including the interesting result that many plants can actually withstand a 14 day night of complete darkness on the Moon and still crop see my