pmaillot / X32-Behringer

This GIT repo (C language) holds applications and utilities for the Behringer X32 and M32 mixing consoles. Additional details, documentation, implementation examples and apps can be found in my website:
https://sites.google.com/site/patrickmaillot/x32
234 stars 41 forks source link

Changes to XAIR_Command.c so it can compile in TERMUX on Android #9

Closed Rippert closed 6 years ago

Rippert commented 6 years ago

Patrick, I know I should learn how to make a proper pull request, but I found an issue compiling XAIR_Command.c in a TERMUX session on Android. It does compile, but has a bug where the input buffer constantly overflows with "Line too long..." errors.

It turns out that the gcc version in TERMUX is very stingy and only gives an unsigned char when a variable is declared as char. this made _inputch see the -1 value in the non-blocking stdin read come out as a +1, so the buffer filled with fake values.

I tried changing _inputch to a signed char, but those only go to +127, not +255, so that didn't work with your command switch input section.

I ended up making _inputch an int, and using it in the stdin reading section. I also made a new variable, _inputch1 as a char, which I replaced in the command switch section.

Now everything compiles and runs great, on an Android tablet no less. This should all also work on OS X or LINUX, but I'm not sure about Windows, and I don't have a Windows machine. So I'm not sure that this is a good change overall, but if it works in Windows, then you might consider it.

-Ted

pmaillot commented 6 years ago

Ted,

Thanks. I made changes in both XAir_Command and X32_Command to reflect your notes. I tested with X32_Command under Windows. Let me know if you find issues with XAir_Command in other architectures. I'll compile under MacOS sometimes today.

-Patrick

pmaillot commented 6 years ago

Changes made for 2 weeks. no negative feedback. closing the issue

Rippert commented 6 years ago

Patrick, sorry for the delay, the Cold and Flu fairies have been visiting.

You need to make one more change to your code in both XAir_Command.c and X32_Command.c (I tried it with your X32 emulator).

The issue is with line 502 in XAir_Command.c: if (input_ch != NO_CHAR)

line 502 in XAir_Command.c and line 382 in X32_Command.c

So you need to change all instances of input_ch to input_intch from line 468 and above (keyboard input loop) in XAir_Command.c (line 348 and above in X32_command.c).

If you don't mind, I will fork your repository and start working on modifications and bug fixes (if any) on my own, and just try to make pull requests when they seem appropriate. I'm a noob with git, but I'll try to not be too annoying.

pmaillot commented 6 years ago

Hello Ted,

No problem; I made changes and hope this time they are OK. Funny thing is I didn’t see erroros on my side ‘cause the gcc compiler on PC and Mac are just happy with mismatch between char, unsigned char and int.

By all means do not hesitate to fork, modify and propose ideas/changes that will help functionality or bring better support 😊.

I’ll be glad to pull in changes.

-Patrick-Gilles Maillot

From: Rippert [mailto:notifications@github.com] Sent: Friday, January 12, 2018 11:06 PM To: pmaillot/X32-Behringer X32-Behringer@noreply.github.com Cc: Patrick-Gilles Maillot patrick.maillot@gmail.com; State change state_change@noreply.github.com Subject: Re: [pmaillot/X32-Behringer] Changes to XAIR_Command.c so it can compile in TERMUX on Android (#9)

Patrick, sorry for the delay, the Cold and Flu fairies have been visiting.

You need to make one more change to your code in both XAir_Command.c and X32_Command.c (I tried it with your X32 emulator).

The issue is with line 502 in XAir_Command.c: if (input_ch != NO_CHAR)

line 502 in XAir_Command.c and line 382 in X32_Command.c

So you need to change all instances of input_ch to input_intch from line 468 and above (keyboard input loop) in XAir_Command.c (line 348 and above in X32_command.c).

If you don't mind, I will fork your repository and start working on modifications and bug fixes (if any) on my own, and just try to make pull requests when they seem appropriate. I'm a noob with git, but I'll try to not be too annoying.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/pmaillot/X32-Behringer/issues/9#issuecomment-357367474 , or mute the thread https://github.com/notifications/unsubscribe-auth/APOZ_lbxCn3F3onVhiDb4H0bijtyLOr3ks5tJ9czgaJpZM4RVOB4 . https://github.com/notifications/beacon/APOZ_uGJ4pvE6fy0A1c0JJyKp0mBlhBKks5tJ9czgaJpZM4RVOB4.gif

pmaillot commented 6 years ago

Ted,

I had to undo the changes I brought this morning as they ‘killed’ the immediate mode input under Windows.

I suggest you do fork the code and find the right compiler mode or way to get the program(s) to work in your android environment. We can add #ifdefs 😊

-Patrick-Gilles Maillot

From: Patrick-Gilles Maillot [mailto:patrick.maillot@gmail.com] Sent: Saturday, January 13, 2018 10:13 AM To: 'pmaillot/X32-Behringer' reply@reply.github.com; 'pmaillot/X32-Behringer' X32-Behringer@noreply.github.com Cc: 'State change' state_change@noreply.github.com Subject: RE: [pmaillot/X32-Behringer] Changes to XAIR_Command.c so it can compile in TERMUX on Android (#9)

Hello Ted,

No problem; I made changes and hope this time they are OK. Funny thing is I didn’t see erroros on my side ‘cause the gcc compiler on PC and Mac are just happy with mismatch between char, unsigned char and int.

By all means do not hesitate to fork, modify and propose ideas/changes that will help functionality or bring better support 😊.

I’ll be glad to pull in changes.

-Patrick-Gilles Maillot

From: Rippert [mailto:notifications@github.com] Sent: Friday, January 12, 2018 11:06 PM To: pmaillot/X32-Behringer <X32-Behringer@noreply.github.com mailto:X32-Behringer@noreply.github.com > Cc: Patrick-Gilles Maillot <patrick.maillot@gmail.com mailto:patrick.maillot@gmail.com >; State change <state_change@noreply.github.com mailto:state_change@noreply.github.com > Subject: Re: [pmaillot/X32-Behringer] Changes to XAIR_Command.c so it can compile in TERMUX on Android (#9)

Patrick, sorry for the delay, the Cold and Flu fairies have been visiting.

You need to make one more change to your code in both XAir_Command.c and X32_Command.c (I tried it with your X32 emulator).

The issue is with line 502 in XAir_Command.c: if (input_ch != NO_CHAR)

line 502 in XAir_Command.c and line 382 in X32_Command.c

So you need to change all instances of input_ch to input_intch from line 468 and above (keyboard input loop) in XAir_Command.c (line 348 and above in X32_command.c).

If you don't mind, I will fork your repository and start working on modifications and bug fixes (if any) on my own, and just try to make pull requests when they seem appropriate. I'm a noob with git, but I'll try to not be too annoying.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/pmaillot/X32-Behringer/issues/9#issuecomment-357367474 , or mute the thread https://github.com/notifications/unsubscribe-auth/APOZ_lbxCn3F3onVhiDb4H0bijtyLOr3ks5tJ9czgaJpZM4RVOB4 . https://github.com/notifications/beacon/APOZ_uGJ4pvE6fy0A1c0JJyKp0mBlhBKks5tJ9czgaJpZM4RVOB4.gif

pmaillot commented 6 years ago

OK, I think I fixed it… v 1.37 (XAir) and 1.35 (X32) are on line .

-Patrick-Gilles Maillot

From: Patrick-Gilles Maillot [mailto:patrick.maillot@gmail.com] Sent: Saturday, January 13, 2018 1:39 PM To: 'pmaillot/X32-Behringer' reply@reply.github.com; 'pmaillot/X32-Behringer' X32-Behringer@noreply.github.com Cc: 'State change' state_change@noreply.github.com Subject: RE: [pmaillot/X32-Behringer] Changes to XAIR_Command.c so it can compile in TERMUX on Android (#9)

Ted,

I had to undo the changes I brought this morning as they ‘killed’ the immediate mode input under Windows.

I suggest you do fork the code and find the right compiler mode or way to get the program(s) to work in your android environment. We can add #ifdefs 😊

-Patrick-Gilles Maillot

From: Patrick-Gilles Maillot [mailto:patrick.maillot@gmail.com] Sent: Saturday, January 13, 2018 10:13 AM To: 'pmaillot/X32-Behringer' reply@reply.github.com; 'pmaillot/X32-Behringer' <X32-Behringer@noreply.github.com mailto:X32-Behringer@noreply.github.com > Cc: 'State change' <state_change@noreply.github.com mailto:state_change@noreply.github.com > Subject: RE: [pmaillot/X32-Behringer] Changes to XAIR_Command.c so it can compile in TERMUX on Android (#9)

Hello Ted,

No problem; I made changes and hope this time they are OK. Funny thing is I didn’t see erroros on my side ‘cause the gcc compiler on PC and Mac are just happy with mismatch between char, unsigned char and int.

By all means do not hesitate to fork, modify and propose ideas/changes that will help functionality or bring better support 😊.

I’ll be glad to pull in changes.

-Patrick-Gilles Maillot

From: Rippert [mailto:notifications@github.com] Sent: Friday, January 12, 2018 11:06 PM To: pmaillot/X32-Behringer <X32-Behringer@noreply.github.com mailto:X32-Behringer@noreply.github.com > Cc: Patrick-Gilles Maillot <patrick.maillot@gmail.com mailto:patrick.maillot@gmail.com >; State change <state_change@noreply.github.com mailto:state_change@noreply.github.com > Subject: Re: [pmaillot/X32-Behringer] Changes to XAIR_Command.c so it can compile in TERMUX on Android (#9)

Patrick, sorry for the delay, the Cold and Flu fairies have been visiting.

You need to make one more change to your code in both XAir_Command.c and X32_Command.c (I tried it with your X32 emulator).

The issue is with line 502 in XAir_Command.c: if (input_ch != NO_CHAR)

line 502 in XAir_Command.c and line 382 in X32_Command.c

So you need to change all instances of input_ch to input_intch from line 468 and above (keyboard input loop) in XAir_Command.c (line 348 and above in X32_command.c).

If you don't mind, I will fork your repository and start working on modifications and bug fixes (if any) on my own, and just try to make pull requests when they seem appropriate. I'm a noob with git, but I'll try to not be too annoying.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/pmaillot/X32-Behringer/issues/9#issuecomment-357367474 , or mute the thread https://github.com/notifications/unsubscribe-auth/APOZ_lbxCn3F3onVhiDb4H0bijtyLOr3ks5tJ9czgaJpZM4RVOB4 . https://github.com/notifications/beacon/APOZ_uGJ4pvE6fy0A1c0JJyKp0mBlhBKks5tJ9czgaJpZM4RVOB4.gif

Rippert commented 6 years ago

Your latest code is working in both my Android Environment and in OS X. Thanks.