Skip to content

Commit

Permalink
Deal with things that make xruns in jack
Browse files Browse the repository at this point in the history
  • Loading branch information
ovenwerks committed Jul 4, 2015
1 parent ff3a520 commit 2305567
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
7 changes: 7 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
midikb (0.1.3) UNRELEASED; urgency=medium

* Moved Jack initialize to after anything that might fail.
* Added jack close at end of main to catch device vanishing.

-- Len Ovens <len@music> Sat, 04 Jul 2015 07:20:32 -0700

midikb (0.1.2) Released; urgency=medium

* Merged README files to one midikb file
Expand Down
12 changes: 8 additions & 4 deletions midikb.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,6 @@ int main(int argc, char **argv) {
if ((ret = init_dev()) != OK)
return ret;

/* open as a jack client */
if ((ret = jackconnect()) != OK)
return ret;

/* Process the configuration file */
if ((ret = open_config()) != OK)
return ret;
Expand Down Expand Up @@ -353,6 +349,9 @@ int main(int argc, char **argv) {
set_led(1, 0);
set_led(2, 0);

/* open as a jack client */
if ((ret = jackconnect()) != OK)
return ret;

while (get_key(&key, &type) == OK) {
int tmp, exec_ok = 0, norel = 0;
Expand Down Expand Up @@ -535,6 +534,11 @@ int main(int argc, char **argv) {
}

}
/* jack client needs to quit properly as this is where we end
* up if the device gets unplugged or if blue tooth gets out
* of range.
*/
jackclose();

return OK;
}
Expand Down

0 comments on commit 2305567

Please sign in to comment.