DEV: [PLUGIN] MPD_OLED for x86 based systems

i don’t see a hid-mpc2112.c in Volumio’s kernel tree (which is a 1:1 git clone form torvalds, with a few patches)
Unless it is located other than in …drivers/hid
@Wheaten where did you copy the sources from?

The file name is hid-cp2112.c

correct, sorry my bad…

copied files (from downloaded headers V5.10.139)
\linux-5.10.139\drivers\hid\hid-ids.h and
\linux-5.10.139\drivers\hid\hid-cp2112.c

removed folder from /var/lib/dkms.
ran the commands again, but still throwing the same errors.
I think I am done with it.

Make.zip (15.9 KB)

Ok, remind me to select this kernel config option as well.
Could send you a local volumio image (no myVolumio) with cp2112 enabled.
In case you want ch341 instead you need to wait until 6.1 has been tested.

Please do (x86), only for testing if it will work.
For the CH341 I can wait, as this can be done pretty easy. Not sure what I am missing, but it keeps nagging me.

I only do x86.
I’ll try this weekend, tomorrow is booked :wink:

1 Like

@Wheaten the new errors are very different to the old errors. You could check if the file “hid-mcp2112.c” has been reformatted by something (e.g.an editor), which has combined short lines and removed some leading #s in the process.

Guess something happened, as the file was 51kB instead of 50kB.

Steps taken:

  • Content dkms.conf (created with nano):
PACKAGE_NAME=my-hid-mcp2112
PACKAGE_VERSION=1.0.0.0
BUILT_MODULE_NAME[0]="my-hid-mcp2112"
DEST_MODULE_LOCATION[0]="/kernel/extra"
AUTOINSTALL=yes
  • Content of Makefile (created with nano):
EXTRA_CFLAGS+=-DLINUX_DRIVER -mhard-float

obj-m += my-hid-mcp2112.o
my-hid-mcp2112-objs:= hid-mcp2112.o

all:
	make -C /lib/modules/$(kernelver)/build M=$(PWD) modules
clean:
	make -C /lib/modules/$(kernelver)/build M=$(PWD) clean
  • Moved files (without opening) via Winscp to: /volumio/home
- Moved to correct location:
sudo cp /home/volumio/hid-cp2112.c /usr/src/my-hid-mcp2112-1.0.0.0/hid-cp2112.c
sudo cp /home/volumio/hid-ids.h /usr/src/my-hid-mcp2112-1.0.0.0/hid-ids.h
  • Removed previous build:
    sudo rm -rf /var/lib/dkms/my-hid-mcp2112

volumio@volumio-dev:/usr/src/my-hid-mcp2112-1.0.0.0$ sudo dkms add -m my-hid-mcp2112 -v 1.0.0.0

Creating symlink /var/lib/dkms/my-hid-mcp2112/1.0.0.0/source ->
                 /usr/src/my-hid-mcp2112-1.0.0.0

DKMS: add completed.

`

volumio@volumio-dev:/usr/src/my-hid-mcp2112-1.0.0.0$ sudo dkms install -m my-hid                                                                          -mcp2112 -v 1.0.0.0

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.10.139-volumio -C /lib/modules/5.10.139-volumio/build M                                                                          =/var/lib/dkms/my-hid-mcp2112/1.0.0.0/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.10.139-volumio (x86_64)
Consult /var/lib/dkms/my-hid-mcp2112/1.0.0.0/build/make.log for more information                                                                          .
volumio@volumio-dev:/usr/src/my-hid-mcp2112-1.0.0.0$
  • Make.log, only one error left:
DKMS make.log for my-hid-mcp2112-1.0.0.0 for kernel 5.10.139-volumio (x86_64)
Fri Dec 16 10:38:14 CET 2022
make: Entering directory '/usr/src/linux-headers-5.10.139-volumio'
make[1]: *** No rule to make target '/var/lib/dkms/my-hid-mcp2112/1.0.0.0/build/hid-mcp2112.o', needed by '/var/lib/dkms/my-hid-mcp2112/1.0.0.0/build/my-hid-mcp2112.o'.  Stop.
make: *** [Makefile:1832: /var/lib/dkms/my-hid-mcp2112/1.0.0.0/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.10.139-volumi

You could check if you are really removing the old build, as you are running

sudo rm -rf /var/lib/dkms/my-hid-mcp2112

Which might only delete a symlink to the build directory.

Try deleting the files produced during the build in the directory /usr/src/my-hid-mcp2112-1.0.0.0 (it should only contain the four original files)

volumio@volumio-dev:/usr/src$ ls
i2c-ch341-usb-1.0.0  linux-headers-4.19.0-21-amd64  linux-headers-4.19.0-21-common  linux-headers-5.10.139-volumio  linux-kbuild-4.19

volumio@volumio-dev:/var/lib/dkms$ ls
dkms_dbversion  i2c-ch341-usb

sudo cp -r /home/volumio/my-hid-mcp2112-1.0.0.0 /usr/src/my-hid-mcp2112-1.0.0.0
volumio@volumio-dev:/var/lib/dkms$ sudo dkms add -m my-hid-mcp2112 -v 1.0.0.0

Creating symlink /var/lib/dkms/my-hid-mcp2112/1.0.0.0/source ->
                 /usr/src/my-hid-mcp2112-1.0.0.0

DKMS: add completed.
volumio@volumio-dev:/var/lib/dkms$ sudo dkms install -m my-hid-mcp2112 -v 1.0.0.0

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.10.139-volumio -C /lib/modules/5.10.139-volumio/build M=/var/lib/dkms/my-hid-mcp2112/1.0.0.0/build...(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.10.139-volumio (x86_64)
Consult /var/lib/dkms/my-hid-mcp2112/1.0.0.0/build/make.log for more information.
volumio@volumio-dev:/var/lib/dkms$

make.log:

DKMS make.log for my-hid-mcp2112-1.0.0.0 for kernel 5.10.139-volumio (x86_64)
Fri Dec 16 10:55:17 CET 2022
make: Entering directory '/usr/src/linux-headers-5.10.139-volumio'
make[1]: *** No rule to make target '/var/lib/dkms/my-hid-mcp2112/1.0.0.0/build/hid-mcp2112.o', needed by '/var/lib/dkms/my-hid-mcp2112/1.0.0.0/build/my-hid-mcp2112.o'.  Stop.
make: *** [Makefile:1832: /var/lib/dkms/my-hid-mcp2112/1.0.0.0/build] Error 2
make: Leaving directory '/usr/src/linux-headers-5.10.139-volumio'

Did you check that /usr/src/my-hid-mcp2112-1.0.0.0 contained exactly four files before running the build command?

Yes I did.

volumio@volumio-dev:/var/lib/dkms$ ls /home/volumio/my-hid-mcp2112-1.0.0.0
Makefile  dkms.conf  hid-cp2112.c  hid-ids.h

You are listing the files in a directory under your home directory. The directory to check is

ls /usr/src/my-hid-mcp2112-1.0.0.0

yes as this is the directory that I move to /usr/src/ per run (after deleting everything)

volumio@volumio-dev:/usr/src/my-hid-mcp2112-1.0.0.0$ ls /usr/src/my-hid-mcp2112-1.0.0.0
Makefile  dkms.conf  hid-cp2112.c  hid-ids.h

Ok. I notice that your source file is now named hid-cp2112.c, when it was previously named hid-mcp2112.c, and this explains the error.

darn, You requested to rename the file, So i did.
So this morning when restarting, took a fresh copy, I didn’t rename it. :roll_eyes:
Thanks for your patience with me on this.

volumio@volumio-dev:/usr/src/my-hid-mcp2112-1.0.0.0$ sudo dkms install -m my-hid-mcp2112 -v 1.0.0.0
[sudo] password for volumio:

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
make -j4 KERNELRELEASE=5.10.139-volumio -C /lib/modules/5.10.139-volumio/build M=/var/lib/dkms/my-hid-mcp2112/1.0.0.0/build...
cleaning build area...

DKMS: build completed.

my-hid-mcp2112.ko:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/5.10.139-volumio/updates/dkms/

depmod...

DKMS: install completed.

And working, However not usable for displaying CAVA as the framerate is way to low.

Great! Good result!

Glad you managed to solve the issue @Wheaten Shame it’s so slow :disappointed_relieved:

Yeah but to slow for CAVA. Max -f 15 and it seems like the bars are glued to the screen :slight_smile: