We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4184 - [PATCH] jack audio driver fails in presence of midi ports
Summary: [PATCH] jack audio driver fails in presence of midi ports
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: audio (show other bugs)
Version: HG 2.0
Hardware: All All
: P2 major
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-01 11:06 UTC by Martin Širokov
Modified: 2018-06-02 02:44 UTC (History)
0 users

See Also:


Attachments
fix jack audio driver (4.45 KB, patch)
2018-06-01 11:06 UTC, Martin Širokov
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Širokov 2018-06-01 11:06:28 UTC
Created attachment 3254 [details]
fix jack audio driver

Launching an SDL application with SDL_AUDIODRIVER=jack, and then calling SDL_OpenAudioDevice() with whatever parameters fails with an error like this one:

SDL_OpenAudioDevice: Couldn't connect JACK ports: SDL:sdl_jack_output_0 => system:midi_playback_1

This happens because JACK_OpenDevice in src/audio/jack/SDL_jackaudio.c blindly tries to connect to all input ports without checking whether they are for audio or midi.

The fix is to check port types and ignore all non audio ports. Also I removed devports field from struct SDL_PrivateAudioData, because it's never really used and removing unused ports from it would be PITA.
Comment 1 Sam Lantinga 2018-06-02 02:44:18 UTC
Patch added, thanks!
https://hg.libsdl.org/SDL/rev/94f3f018d3eb