macOS support?
Info3SR opened this issue · 16 comments
Hi,
I've tried setting this up on macOS and eventually figured out macOS doesn't use glibc.
I read all your notes and saw it hadn't been tested on macOS.
I don't have the programming skills to get this to work on macOS.
And have no idea how much effort is needed to make that happen.
I was wondering if you had any plans to make a macOS compatible version?
Thanks.
I suppose you ran make
and got an error. Could you post what you tried exactly and the error there? The solution might be surprisingly trivial.
The main problem with Macs is that I don't and will never have one. But I'll think of a workaround anyway. Thank you for reporting this.
Thanks for the response Ors1mer
I ran the make debpkg command in terminal and got the following output.
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
ld: warning: option -s is obsolete and being ignored
ld: warning: dylib (/usr/local/lib/libusb-1.0.dylib) was built for newer macOS version (13.0) than being linked (11.1)
Undefined symbols for architecture x86_64:
"_libintl_bindtextdomain", referenced from:
_main in main-363849.o
"_libintl_setlocale", referenced from:
_main in main-363849.o
"_libintl_textdomain", referenced from:
_main in main-363849.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [quadcastrgb] Error 1
The linker complains about the libintl library, which isn't currently used in the program. So I just commented it out.
Could you now download the issue branch and run make
again?
You should note that if it works, this is a temporary solution because I may add gettext
again in the future, even though it's unlikely.
Hi Ors1mer,
Thanks for the update.
- I've downloaded the issue branch file QuadcastRGB-6-macos-support.zip
- Placed them in the QuadcastRGB directory
- run the command --> make debpkg
The output error messages are below…
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
modules/devio.c:90:27: warning: passing arguments to 'dev_search' without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
micro_dev = dev_search(devs, dev_count);
^
modules/devio.c:52:23: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static libusb_device *dev_search();
^
void
modules/devio.c:122:23: warning: a function declaration without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
static libusb_device *dev_search(libusb_device **devs, ssize_t cnt)
^
3 warnings generated.
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
ld: warning: option -s is obsolete and being ignored
make: dpkg: No such file or directory
make: *** [debpkg] Error 1
Thanks for the quick answer.
As far as I can see, clang
managed to compile and ld
linked everything, even though with some spooky warnings (I fixed them in the latest commit already). Don't you see the quadcastrgb
file in the directory now?
You can run the program by executing ./quadcastrgb <parameters>
(it'll probably require root privileges to access the mic). Move quadcastrgb
to any directory from $PATH
to run it as a regular program in the terminal.
Could you also explain why you're running make debpkg
? This target creates the deb package for Debian-based Linux distros, thus the error (Mac OS doesn't have dpkg
). The package manager typically used in Mac OS is homebrew
, but I didn't make the appropriate package anyway.
Why did I use make debpkg?
Well I'm not a skilled programmer. So my approach was to go down the list of available install methods and see which one would take me the furthest. I tried to work through error messages and fix issue.
I couldn't get the rpmpkg to work.
I kept getting the following error:
make: rpmdev-setuptree: No such file or directory
make: *** [rpmpkg] Error 1
And the one I had the most success with was debpkg. I scanned some sites and found something that suggested installing macports to install dpkg. That gave me the ability to run dpkg.
I'm happy to try another installer if you want me to.
=============
I've downloaded the latest update to the branch.
I ran the command --> make debpkg
And got the following message…
make debpkg
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
ld: warning: option -s is obsolete and being ignored
make: dpkg: No such file or directory
make: *** [debpkg] Error 1
===========
the quadcastrgb executable file appeared.
I check the privileges for the file
-rwxr-xr-x 1 me2 staff 51840 8 Jun 18:27 quadcastrgb
I added the directory to the $PATH variable and ran the command
I tried quadcastrgb using solid & blink & cycle
The quadcastrgb command produced no error messages.
There was no change to the active microphone colour scheme.
I tried quadcastrgb -h and got the usage message listing the available parameters.
I checked and the system lists the two quadcast hyper X microphone identifiers under usb as 0951:171f and 0951:171d
Any suggestions of what I should try next?
Installation
The simplest installation method is to compile the program and move the binary into an appropriate directory from PATH
. You don't need any packages to use the program, but I've made several so others could have the program in a package.
It might be possible to use deb packages on Mac OS, but I cannot help you with that; this is a completely different topic.
To install the program, you can run this (you'll need root privileges):
make clean install BINDIR_INS="/usr/bin/" MANDIR_INS="/usr/share/man/man1"
Change the BINDIR_INS
and MANDIR_INS
variables if you want to, but BINDIR_INS should be in PATH
and MANDIR_INS should be in manpath
(run manpath
to get the list). If you don't want to have the manual, just write MANDIR_INS="."
to store it in the QuadcastRGB directory that you'll end up deleting anyway.
Running quadcastrgb
Thank you for listing the mic ID. It is supported and this isn't the problem here.
I suppose you ran something like quadcastrgb blink
and got no result. What does echo $?
say just after running the previous command? Have you run the command as root? Does pstree | grep quadcastrgb
give any output after launching the program?
I ran the command ->
make clean install BINDIR_INS="/usr/bin/" MANDIR_INS="/usr/share/man/man1"
And received the following output:
modules/rgbmodes.c:268:9: warning: variable 'colpair' set but not used [-Wunused-but-set-variable]
int colpair = 0;
^
1 warning generated.
ld: warning: option -s is obsolete and being ignored
cp: /usr/bin/quadcastrgb: Operation not permitted
make: *** [install] Error 1
Next I ran command -> quadcastrgb blink
The microphone blinked and got the following output in the terminal…
Packets to be sent: 90
Packet 1:
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
Packet 2:
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
81 C4 E6 B7 81 89 CA E8
…after the 90th packet was set I got the following message…
Entering display mode...
Header display:
04 F2 00 00 00 00 00 00 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Data:
81 C5 6C 12 81 09 7E E0 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Header display:
04 F2 00 00 00 00 00 00 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Data:
81 C5 6C 12 81 09 7E E0 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
…and it keeps going
The Header display & Data kept displaying in the terminal window until I used control C to stop the program.
In testing the 'blink' parameter microphone continued to blink until I stopped the program. It then reverted back to original settings prior to running quadcastrgb
### Thanks for the help as quadcastrgb you've got it working on macos!!!
I wasn't able to get the manual installed. I added man1 to the manpath but that didn't result in the manual file being copied. Tried the make clean using sudo didn't install the manual either. I'll spend some time later figuring that out with a bit of searching.
I read the manual and saw quadcastrgb will communicate with the microphone continuously.
Is there a way I can suppress / reduce the constant output to the terminal window?
Sitting here thinking if I set a solid colour for a zoom call that lasts 1 hour.
Or does this not really matter?
Again thanks for the help.
Glad it works now!
Is there a way I can suppress / reduce the constant output to the terminal window?
Sure! You weren't supposed to see this output. For some mysterious reason, the program compiled in debug mode and you got this mess.
Run this to clean all object and executable files:
make clean
After running this, make sure there are no executables like dev
or quadcastrgb
and no .o
files in the QuadcastRGB/
and QuadcastRGB/modules/
directories. Otherwise, delete them.
Now just recompile it:
make install BINDIR_INS="/usr/bin" MANDIR_INS="."
Now run quadcastrgb
from any directory. You shouldn't see any output. To stop the program, run killall quadcastrgb
.
I went for a fresh install. Deleted all existing files. Download fresh macos branch zip.
ran make clean
then make install
The debug mode output stopped but the 'blink' parameter didn't work.
Also when I look at the process quadcastrgb isn't running.
I noticed a difference in the error messages during the "make install"
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
clang: warning: argument unused during compilation: '-s' [-Wunused-command-line-argument]
ld: warning: option -s is obsolete and being ignored
cp: /usr/bin/quadcastrgb: Operation not permitted
make: *** [install] Error 1
versus "make clean install"
modules/rgbmodes.c:268:9: warning: variable 'colpair' set but not used [-Wunused-but-set-variable]
int colpair = 0;
^
1 warning generated.
ld: warning: option -s is obsolete and being ignored
cp: /usr/bin/quadcastrgb: Operation not permitted
make: *** [install] Error 1
The resulting quadcastrgb from make clean install controls the microphone but operates in debug mode.
Operation not permitted
Try to run the same commands with superuser privileges.
TLDR: Did that with same results & error messages as before.
PS I appreciate you continuing to take the time to help me work my way through this.
My login account is an admin account.
My thought was the 'operation not permitted' was due to macOS SIP or System Integrity Program. So I disabled that and tried again.
I've ended up with the same error messages and results as before.
- The combined command of
make clean install
creates an executable that controls the microphone but runs in debug mode. - The separate commands
make clean
&make install
creates an executable that doesn't do anything.
I created what is called a root account.
(The types of accounts in macos are explained here).
I logged in as root and tried the same sequence it produced the same results.
I also tried executing the commands using sudo
. Same results.
I'll dig deeper this week to figure out why I can't get the 'cp: /usr/bin/quadcastrgb' command to work.
What I don't understand is why the separate vs joined up commands produce different error messages.
If I had some clues about that difference I might be able to trace what's going on.
Ok I've figured a few things out.
Why does make clean install
put me into DEBUG mode?
Answer is found in the Makefile.
The variable MAKECMDGOALS
will have a value of clean install
.
This then is checked with the ifeq
statements starting on line 45.
Since clean install
doesn't match anything it ends up in the else
condition on line 53 & 54.
Hence the debug mode and the difference in compiler warning messages.
What happens with make clean
then make install
?
I've traced this issue by adding various put
statements into files.
An executable unix file called quadcastrgb
is create.
It runs without error message but appears to do nothing.
I then ran with the parameter -v
and got the idea to use the puts.
I traced the program as it makes its way through the main.c
file.
It gets to line 73 (main.c) send_packets(handle, data_arr, data_packet_cnt, verbose);
Then it goes to the devio.c
file.
In the send_packets
function the code gets to line 153 (devio.c).
There the test is '#ifndef DEBUG'. Since this was compiled with 'make install' the 'DEBUG' isn't defined.
The code now calls daemonise(verbose);
.
On line 165 (devio.c) the code is #ifndef DEBUG
so the daemonize
function is used.
Tracing the daemonize
function I found that the code continues to close(1);
statement on line 183 (devio.c).
At this point the code stops and the process (PID) labeled quadcastrgb disappears from the list of processes.
That is why the executable appears to not work.
So I COMMENTED OUT close(1);
on line 183 (devio.c).
Here's what happened…
The code continues through the rest of the daemonize
function.
It returns back to the calling routine send_packets
line 155 in(devio.c).
It then goings into the while(nonstop)
loop line 161 in (devio.c).
On line 162 (devio.c) the display_data_arr
function is called.
Now the code is on line 191 (devio.c).
I then figured out the code if(sent != PACKET_SIZE)
on line 203 of (devio.c)
is true so nonstop = 0; break;
line 204 (devio.c).
Then the remaining code in the main.c file does the clean up to free up memory
.
I then inverted a few of the #ifdef DEBUG
command line 227 (devio.c) to #ifndef DEBUG
This way I could see what was being sent
Since the logical test if(sent != PACKET_SIZE)
on line 229 (devio.c) is true.
The output of fprintf(stderr, HEADER_ERR_MSG, libusb_strerror(sent));
line 230 of (devio.c)
This data below is output...
Header display:
04 F2 00 00 00 00 00 00 01 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Again the program exits by (main.c) freeing up memory
That's as far as I've got. Not sure what to do now.
Compiling in DEBUG
mode gives me the ability to control the microphone.
I decided to check the sent
value.
In file devio.c
in the function display_data_arr
Line 202 sent = send_display_command(header_packet, handle);
Then again
Line 207 sent = libusb_control_transfer(handle, BMREQUEST_TYPE_OUT,...
When quadcastrgb
is compiled with CFLAGS_DEV
in the Makefile
....
The sent
value is 64. This is equal to the PACKET_SIZE
of 64.
When quadcastrgb
is compiled with CFLAGS_INV
in the Makefile
.....
The sent
value is -4
.
This has me wondering if something is happening between the different compiler setting that causes the device not to be found.
As near as I can tell the big difference is the daemonize
function. The DEBUG
version doesn't call on it.
I went looking for the libusb_control_transfer
.
I found the manaual and read up on the error messages.
After reading I think the -4 means the device is missing.
Thanks
Sorry, it took so long for the answer. I'll look into the daemonize
function later to check what may cause the error on macOS.
For now, you can suppress the output of the program by launching it like this (I assume you compiled it in debug mode and have the root privileges):
quadcastrgb solid &> /dev/null &
Thus, it won't give you any output to stdout
. The only problem with this is the program will stop if you close the terminal. The daemonize
function exists to solve this problem.
I have added the MacOS section in README. It explains how to "install" (actually, just launch) the program and switch it to the daemon mode.