QEMU forces my bluetooth headphones to low quality codec

Hi,
I have trouble with qemu and bluetooth headphones. I have a sony bluetooth headphone that used LDAC codec with pipewire. Works great but at the very moment I start my windows VM it switches to mSBC codecs and my host system (tumbleweed) is forced to low quality audio.
My understanding is that QEMU does not currently supports pipewire. However I also dont understand why this quality switch is forced and what process does it.
If I switch back after my VM started I have no sound output. I need to stop the VM then only I can switch back to LDAC. So it is obviously QEMU interfering with the codecs.

My VM has the following setup for audio:

   <sound model='ich9'>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
    </sound>
    <audio id='1' type='pulseaudio' serverName='/run/user/1000/pulse/native'/>

Supported codecs:

pactl list cards | grep -A20 "bluez_card"

        Name: bluez_card.CC_98_8B_22_1E_D3
        Driver: module-bluez5-device.c
        Owner Module: n/a
        Properties:
                api.bluez5.address = "CC:98:8B:22:1E:D3"
                api.bluez5.class = "0x240404"
                api.bluez5.connection = "connected"
                api.bluez5.device = ""
                api.bluez5.icon = "audio-headset"
                api.bluez5.path = "/org/bluez/hci0/dev_CC_98_8B_22_1E_D3"
                bluez5.profile = "off"
                device.alias = "WH-1000XM3"
                device.api = "bluez5"
                device.bus = "bluetooth"
                device.description = "WH-1000XM3"
                device.form_factor = "headset"
                device.icon_name = "audio-headset-bluetooth"
                device.name = "bluez_card.CC_98_8B_22_1E_D3"
                device.product.id = "0x0cd3"
                device.string = "CC:98:8B:22:1E:D3"
                device.vendor.id = "usb:054c"
                media.class = "Audio/Device"
                spa.object.id = "0"
                factory.id = "15"
                client.id = "41"
                object.id = "99"
                object.serial = "1220"
        Profiles:
                off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
                a2dp-sink-sbc: High Fidelity Playback (A2DP Sink, codec SBC) (sinks: 1, sources: 0, priority: 18, available: yes)
                a2dp-sink-sbc_xq: High Fidelity Playback (A2DP Sink, codec SBC-XQ) (sinks: 1, sources: 0, priority: 17, available: yes)
                a2dp-sink-aac: High Fidelity Playback (A2DP Sink, codec AAC) (sinks: 1, sources: 0, priority: 19, available: yes)
                a2dp-sink: High Fidelity Playback (A2DP Sink, codec LDAC) (sinks: 1, sources: 0, priority: 20, available: yes)
                headset-head-unit-cvsd: Headset Head Unit (HSP/HFP, codec CVSD) (sinks: 1, sources: 1, priority: 2, available: yes)
                headset-head-unit: Headset Head Unit (HSP/HFP, codec mSBC) (sinks: 1, sources: 1, priority: 3, available: yes)
        Active Profile: headset-head-unit
        Ports:
                headset-input: Handsfree (type: Headset, priority: 0, latency offset: 0 usec, available)

Any help appreciated

Some addition:
qemu grabs my headphone and forces it into HSP/HFP mode due to the microphone that exist on the device. I need qemu to not do it ever and only use the bluez device as an output, not an input

pactl list sources short

61      alsa_output.pci-0000_23_00.1.hdmi-stereo.monitor        PipeWire        s32le 2ch 48000Hz       SUSPENDED
64      alsa_output.usb-K66_K66_20190805V001-00.analog-stereo.monitor   PipeWire        s16le 2ch 48000Hz       SUSPENDED
65      alsa_input.usb-K66_K66_20190805V001-00.analog-stereo    PipeWire        s16le 2ch 48000Hz       SUSPENDED
1223    bluez_input.CC:98:8B:22:1E:D3   PipeWire        float32le 1ch 48000Hz   RUNNING
1355    bluez_output.CC_98_8B_22_1E_D3.1.monitor        PipeWire        s16le 1ch 16000Hz       RUNNING

One more addition: In KDE the default microphone for the VM is set to my physical microphone by default, not the headphones

Found solution, strangely this is not a bug but a feature. Who would have thought? :grimacing:

On the Red Hat virt docs it says:
In addition, a sound element with 'ich6' model set can have optional codec sub-elements to attach various audio codecs to the audio device. If not specified, a default codec will be attached to allow playback and recording.

So if any device is capable of playback and recording like a bluetooth headphone, both options will be invoked by the VM even if the system default is not setup like that.
Adding <codec type='output'/> in <sound> seems to be the solution.
https://libvirt.org/formatdomain.html#sound-devices