mrArkwright / cmidid-kerneldriver

GNU General Public License v3.0
7 stars 2 forks source link

Fail to build? #2

Open starfishmod opened 8 years ago

starfishmod commented 8 years ago

I followed the instruction to build the applemidi module and I got the following:

make -C /lib/modules/4.4.11+/build  M=/home/pi/cmidid-kerneldriver/applemidi modules
make[1]: Entering directory '/root/linux-233755da0e7903fccb41f0b8c14e1da5244b69ec'
  CC [M]  /home/pi/cmidid-kerneldriver/applemidi/applemidi.o
/home/pi/cmidid-kerneldriver/applemidi/applemidi.c: In function ‘_applemidi_send_command’:
/home/pi/cmidid-kerneldriver/applemidi/applemidi.c:113:9: error: ‘struct msghdr’ has no member named ‘msg_iov’
   udpmsg.msg_iov = &iov;
         ^
/home/pi/cmidid-kerneldriver/applemidi/applemidi.c:114:9: error: ‘struct msghdr’ has no member named ‘msg_iovlen’
   udpmsg.msg_iovlen = 1;
         ^
/home/pi/cmidid-kerneldriver/applemidi/applemidi.c:125:16: error: too many arguments to function ‘sock_sendmsg’
    sentbytes = sock_sendmsg(source, &udpmsg, len);
                ^
In file included from include/linux/skbuff.h:29:0,
                 from include/linux/ip.h:20,
                 from /home/pi/cmidid-kerneldriver/applemidi/applemidi.c:9:
include/linux/net.h:219:5: note: declared here
 int sock_sendmsg(struct socket *sock, struct msghdr *msg);
     ^
/home/pi/cmidid-kerneldriver/applemidi/applemidi.c: In function ‘_applemidi_connect’:
/home/pi/cmidid-kerneldriver/applemidi/applemidi.c:509:45: warning: assignment from incompatible pointer type
   driver->control_socket->sk->sk_data_ready = _socket_callback;
                                             ^
/home/pi/cmidid-kerneldriver/applemidi/applemidi.c:529:41: warning: assignment from incompatible pointer type
   driver->rtp_socket->sk->sk_data_ready = _socket_callback;
                                         ^
scripts/Makefile.build:258: recipe for target '/home/pi/cmidid-kerneldriver/applemidi/applemidi.o' failed
make[2]: *** [/home/pi/cmidid-kerneldriver/applemidi/applemidi.o] Error 1
Makefile:1384: recipe for target '_module_/home/pi/cmidid-kerneldriver/applemidi' failed
make[1]: *** [_module_/home/pi/cmidid-kerneldriver/applemidi] Error 2
make[1]: Leaving directory '/root/linux-233755da0e7903fccb41f0b8c14e1da5244b69ec'
Makefile:20: recipe for target 'all' failed
make: *** [all] Error 2

Sorry not sure what to do here?

Thanks

felix-engelmann commented 8 years ago

This error is due to the change of the kernel API in versions higher than 3.19. The corresponding commit https://github.com/torvalds/linux/commit/666547ff591cebdedc4679bf6b1b3f3383a8dea3 explains the intention. The commit to sysdig https://github.com/draios/sysdig/commit/5740604e7c8e3aebbde2096ba60e3c4d689a2f59 shows a possible way to fix this. Feel free to issue a Pull Request. If you are not confident with editing kernel code and have a cool project where you need this module, I'm happy to bring the code up to date.

starfishmod commented 8 years ago

I honestly wish I was skilled enough in C to do this and push it to you :)

I am working on a mapping midi module between devices and adding in visual programming (think scratch) and manipulation of midi messages on a PI using a touchscreen interface. I was hoping to be able to connect with RTPMidi apps as part of the available MIDI devices.

If you can update it I am more than happy to report back any/all feedback

Thanks Andrew

felix-engelmann commented 8 years ago

If I understand correctly, you want to have a userspace application to manipulate a midi stream and have an in and out stream via RTPMidi. This module is only in the kernel, because the university project mandated to write a kernel module. I highly suggest you to use the original library https://github.com/jpommerening/midikit in userspace. It is way easier to install, is better maintained and has more features (ipv6, journal, ...) than this port. Also it is generally a bad idea to put network services into the kernel, as it allows remote exploits directly to root.

Regarding processing power or delay on the Pi, I doubt that the userspace library is much worse. It was mostly a made-up selling argument to justify the porting excercise. If you really want to use this, be warned of Heisenbugs, kernel panics and a lot of fixing.

romakrau commented 4 years ago

Hi Felix, I am using the zynthian project and tried to build your applemidi kernel driver. Unfortunatly it doesnt works. Maybe could you be so kind and update the source for the latest kernel? Greeting Roman

felix-engelmann commented 4 years ago

Hi Roman, thank you for your interest in the project. As mentioned before, please do NOT use this project and instead opt for a user-space implementation. They are way better and there is no reason to use a kernel service. I suspect that from 3.9 to 5.3 there were a lot of changes in the kernel API and I currently don't have the capacity to maintain the project. From any perspective (except the educational purpose of the project) this is not meant to be used. Felix

romakrau commented 4 years ago

Hi Felix, thank you for answering my question. I think that you are right and it is not worth to update your source. The computer systems are runing and runing, and nobody can be up to date. I will try another way to connect to zynthan by rtpMIDI. Thanks Roman