Free ALSA seq resources in midi_device_remove()
cover Free ALSA seq resources in midi_device_remove()
I am having problem connecting via Bluetooth LE MID to my VOX Adio Air GT guitar amplifier. I was not able to debug the connection problem yet, but there was a bigger problem on hand: due to constant connecting/disconnecting ALSA seq resources were leaking until bluetoothd hung and ALSA backend crashed.
I have described a bit more in the github issue: https://github.com/bluez/bluez/issues/225
I was able to fix the leak with the following patch. I am not sure if that is the right way to do this, though. As the relation between midi_disconnect() and midi_device_remove() functions is not clear to me, I have just copied some of the cleanup code from one to the other.
Jacek Konieczny (1):
Free ALSA seq resources in midi_device_remove()
profiles/midi/midi.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
Signature · 1 line
2.25.1
PATCH 1/1 Free ALSA seq resources in midi_device_remove()
Sometimes, on connection error, this gets called and frees the device when midi_disconnect() was not called which would leave ALSA sequencer objects leaking.
--- profiles/midi/midi.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
profiles/midi/midi.c +10 -0
@@ -255,6 +255,16 @@ static void midi_device_remove(struct btd_service *service)return ; } +if (midi->seq_handle) { +midi_read_free (&midi->midi_in); +midi_write_free (&midi->midi_out); +io_destroy (midi->io); +snd_seq_delete_simple_port (midi->seq_handle, midi->seq_port_id); + midi->seq_port_id =0 ; +snd_seq_close (midi->seq_handle); + midi->seq_handle =NULL ; + } +btd_device_unref (midi->dev);g_free (midi); }
Signature · 1 line
2.25.1
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=573565
---Test result---
Test Summary:
CheckPatch PASS 1.43 seconds GitLint PASS 0.89 seconds Prep - Setup ELL PASS 46.37 seconds Build - Prep PASS 0.50 seconds Build - Configure PASS 8.57 seconds Build - Make PASS 202.34 seconds Make Check PASS 9.49 seconds Make Distcheck PASS 242.98 seconds Build w/ext ELL - Configure PASS 8.72 seconds Build w/ext ELL - Make PASS 191.05 seconds
---
Regards,
Linux Bluetooth
Hi Jacek,
Quoted 25 lines · On Mon, Nov 1, 2021 at 7:36 AM <[email protected]> wrote:
This is automated email and please do not reply to this email!
Dear submitter,
Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=573565---Test result---
Test Summary:
CheckPatch PASS 1.43 seconds GitLint PASS 0.89 seconds Prep - Setup ELL PASS 46.37 seconds Build - Prep PASS 0.50 seconds Build - Configure PASS 8.57 seconds Build - Make PASS 202.34 seconds Make Check PASS 9.49 seconds Make Distcheck PASS 242.98 seconds Build w/ext ELL - Configure PASS 8.72 seconds Build w/ext ELL - Make PASS 191.05 seconds
Quoted 3 lines
---
Regards,
Linux Bluetooth
Applied, thanks.
Signature · 1 line
Luiz Augusto von Dentz