BTW note that the default PA device (i.e. called "PulseAudio") is part of the list, and has empty string pulse_name. You should be able to get rid of the global variables like pulse_fmt (and pulse_def_period, pulse_min_period) and special checks for it since you're removing pulse_config anyway.
Also this means you're probing them twice.