How to update/make changes to the kernel

So, I want to make some changes to the kernel - specifically the sound/ arm/bcm2835-pcm.c file.
I made made the changes using sudo nano. Then followed the instructions here: …

pi@volumio:~/downloads/kernel$ git clone --depth=1 pi@volumio:~/downloads/kernel$ sudo apt-get install libncurses5-dev pi@volumio:~/downloads/kernel$ cd linux pi@volumio:~/downloads/kernel/linux$ KERNEL=kernel7 pi@volumio:sudo apt-get install gcc pi@volumio:~/downloads/kernel/linux$ make bcm2709_defconfig pi@volumio:~/downloads/kernel/linux$ make -j4 zImage modules dtbs pi@volumio:~/downloads/kernel/linux$ sudo make modules_install pi@volumio:~/downloads/kernel/linux$ sudo cp arch/arm/boot/dts/*.dtb /boot/ pi@volumio:~/downloads/kernel/linux$ sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/ pi@volumio:~/downloads/kernel/linux$ sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/ pi@volumio:~/downloads/kernel/linux$ sudo scripts/mkknlimg arch/arm/boot/zImage /boot/$KERNEL.img

I restarted but the pi wouldn’t boot.
Have I done something wrong or do these instructions not apply to volumio? How can I make the necessary edits to the kernel? I just want to change the max channels for the hdmi output to 8 instead of 2.


thought I might bump this up to see if anyone has suggestions.
I cross-posted to the rpi forums, but I thought maybe volumio has a custom kernel that would prevent me from using the standard instructions?


Any suggestions out there on customizing kernel modules for Volumio? I know there are a bunch of kernel customizations in Volumio, so I don’t want to throw those away. Can I follow these guidelines to edit the single kernel file that I want to edit?

Hi James

The answer is that you can customise it. But it is not easy and requires that you understand how to compile kernels. Just pushing buttons may not be enough, the more so because the link you refer to also was written based on a certain combination of kernel and linux versions. If that link is a few years old, for certain things have moved on. Or to put it slightly differently, would you undertake to make a custom kernel for Windows or iOS?

That said, it is possible to upgrade components, such as MPD, yourself. Ask yourself also what the purpose is. Volumio is a music player and as such does not need the latest drivers / kernel to function well. As long as the audio components are up to date (MPD mostly), you should be fine. Also, with the new Volumio 2.0, I think your wishes for a newer kernel will be heard.

One other thing to consider is your strategy. You could upgrade components within Volumio, but it will require the installation of extra components which make Volumio “heavier” if you do not uninstall them at the end. You can also use another Linux distribution to build your new MPD and then move the MPD over to Volumio. Never done that last thing myself. But this is all pretty advanced stuff.



1 Like

Arie is right, there is more to it than just copying a few lines from a forum post.
It already starts with the line “KERNEL=kernel7”. This is not a fixed parameter line, it needs to fit the rest of the kernel modules and configuration files.
You also need to realize, that some pi images have a double set of kernel and modules, I mean the ones that support both older and newer PI models, don’t get them mixed up.
Obviously you have not done this before, I suggest you do some good reading on kernel compiling first or get help from the ones that posted the information.

Thanks for the feedback. I have actually compiled a kernel myself, for Raspian, but that’s the latest version. And I had to compile the entire kernel, which seems like overkill for editing 2 lines of code in one particular .c file. (also it takes for-ever to compile and if I just pull the kernel files from git, they’ll be 4.1.18.something AND they’ll blow away any kernel updates that were made to Volume to make it better for audio in the first place)

What I want is to just be able to use my updated snd-bcm2835.ko module that I made on Raspbian. Is there a way to do that? It was built on 4.1.18, so I’m guessing not, eh?

I would help you with that, but currently only have an old PI B next to a load of Odroids (my focus).
There should be a PI 3 coming next week, but that may not help much…