geoffreybennett / scarlett-gen2

Linux kernel source tree with additional Focusrite Scarlett and Clarett support ("Scarlett2 USB Protocol Mixer Driver")
185 stars 6 forks source link

Clarification to installation instructions and requirement of scarlett.conf #12

Closed adphronesis closed 2 months ago

adphronesis commented 2 months ago

Hi, when building kernel modules for Scarlett 4i4 3rd Gen referring to README.md, instructions are:

KSRCDIR=/lib/modules/$(uname -r)/build
make -j4 -C $KSRCDIR M=$(pwd) clean
make -j4 -C $KSRCDIR M=$(pwd)
sudo make -j4 -C $KSRCDIR M=$(pwd) INSTALL_MOD_DIR=updates/snd-usb-audio modules_install
sudo depmod

But this hangs to infinity and has to be terminated with "exit". Should it be without the backticks and start with "sudo bash"?

Either way seems to work, except the latter not requiring manual terminating. Just want to be sure I'm doing this right.

And is the "scarlett.conf" containing "options snd_usb_audio vid=0x1235 pid=0x8212 device_setup=1" in /etc/modprobe.d supposed to be still required, because I still have to put this there, without it this does not work.

geoffreybennett commented 2 months ago

Hi @adphronesis,

The backticks are Markdown markup so the commands to run stand out

like this

when viewed with something that renders Markdown. As you can see, there are no backticks in your message after you posted it.

You should not start with sudo bash. That will build as root which isn't recommended and will leave root-owned files in that directory which will likely cause problems later if you try to build as non-root, so I suggest you delete the snd-usb-audio-kmod-* directory and start again.

Something is definitely not working though. If you need to use device_setup=1 then you are definitely not using the new module.

What distro are you using, what does dmesg and lsmod say, and have you rebooted after running depmod?

Regards, Geoffrey.

adphronesis commented 2 months ago

Hi and thank you for very fast response! This was completely my fault, I didn't know about that backtick marking meaning and I suspected my misunderstanding because there are sudo commands. So this is the case: Debian 12 Stable, kernel 6.1.0-20-amd64. I restored system to time before any of this. I installed "linux-headers-6.1.0-20-amd64". Then moved to extracted "snd-usb-audio-kmod-6.1-v1.0"- folder, and ran:

bash KSRCDIR=/lib/modules/$(uname -r)/build make -j4 -C $KSRCDIR M=$(pwd) clean make -j4 -C $KSRCDIR M=$(pwd) sudo make -j4 -C $KSRCDIR M=$(pwd) INSTALL_MOD_DIR=updates/snd-usb-audio modules_install sudo depmod

And I got understandable and I believe correct results. But I still had to terminate that last depmod-command manually with "exit".

"sudo dmesg | grep -A 5 -B 5 -i focusrite" gives me:

[ 9.191996] IPv6: ADDRCONF(NETDEV_CHANGE): wlx14ebb6843d63: link becomes ready [ 44.552775] usb 1-2: new high-speed USB device number 5 using xhci_hcd [ 44.703447] usb 1-2: New USB device found, idVendor=1235, idProduct=8212, bcdDevice= 6.45 [ 44.703465] usb 1-2: New USB device strings: Mfr=1, Product=3, SerialNumber=2 [ 44.703473] usb 1-2: Product: Scarlett 4i4 USB [ 44.703478] usb 1-2: Manufacturer: Focusrite [ 44.703483] usb 1-2: SerialNumber: D8BZRJJ0811551 [ 44.784784] snd_usbmidi_lib: loading out-of-tree module taints kernel. [ 44.784785] snd_usbmidi_lib: loading out-of-tree module taints kernel. [ 44.784785] snd_usbmidi_lib: loading out-of-tree module taints kernel. [ 44.784811] snd_usbmidi_lib: module verification failed: signature and/or required key missing - tainting kernel [ 46.392157] usb 1-2: Focusrite Scarlett Gen 3 Mixer Driver 6.1-v1.0 enabled (pid=0x8212); report any issues to https://github.com/geoffreybennett/scarlett-gen2/issues [ 46.422461] usb 1-2: Firmware version 1605 [ 46.436267] usbcore: registered new interface driver snd-usb-audio

And everything seems to work as expected, if these messages seem correct to you. Audio works from Scarlett and REAPER recognizes it correctly. Of course next I'm installing your alsa-scarlett-gui, but I believe it works well.

Now this is interesting, not that it really matters: how was I able to make 0.40 alsa-scarlett-gui to work earlier when I ran those commands incorrectly with backticks and exiting terminal manually?

adphronesis commented 2 months ago

And is the first "bash" command really necessary? Is it needed to invoke another bash-session, if I'm already in bash-terminal?

bash KSRCDIR=/lib/modules/$(uname -r)/build make -j4 -C $KSRCDIR M=$(pwd) clean make -j4 -C $KSRCDIR M=$(pwd) sudo make -j4 -C $KSRCDIR M=$(pwd) INSTALL_MOD_DIR=updates/snd-usb-audio modules_install sudo depmod

adphronesis commented 2 months ago

Thank you, this issue can be closed, because it was no issue at all, just my inexperience with simple syntax. So everything works as expected, referring your README.md and if terminal is already in bash, executing:

KSRCDIR=/lib/modules/$(uname -r)/build make -j4 -C $KSRCDIR M=$(pwd) clean make -j4 -C $KSRCDIR M=$(pwd) sudo make -j4 -C $KSRCDIR M=$(pwd) INSTALL_MOD_DIR=updates/snd-usb-audio modules_install sudo depmod

Rebooting, then installing alsa-scarlett-gui_0.4.0 everything works like a charm.

And once again thank you for making it possible to use our Focusrite equipment fully in Linux, especially us who stick with older software. And also your fast support. Much appreciated, donation deserved.

geoffreybennett commented 2 months ago

Oops! I wrote a second reply yesterday and missed sending it. For reference:

You are correct, you don't need to run bash. The ```bash line in Markdown means "this is a code block, please turn on bash-mode syntax highlighting". You can read more about it here: GitHub Syntax Highlighting.

Focusrite Scarlett Gen 3 Mixer Driver 6.1-v1.0 enabled is the sign that you've got the new driver installed.

alsa-scarlett-gui was working anyway for you because you've got a 3rd Gen model which has been supported since kernel 5.14. The newer driver is better though; earlier versions did not support firmware update and the level meters were completely broken.

Thank you for letting me know all is working, and thank you for your support!

geoffreybennett commented 2 months ago

FYI I released a newer version of the driver this evening and I added a comment to the README.md to the reader to skip the ``` lines. Thanks for your report, and hopefully my instructions are clearer now :).

adphronesis commented 2 months ago

Thank you, I can confirm this new version also works well. I had a chance to test this with new kernel version (6.1.0-21-amd64), everything works as expected. Instructions are great, but I would suggest to clarify instructions still so that "if not running a BASH terminal, start with command bash". Great job, much appreciated!

geoffreybennett commented 2 months ago

Thanks for the confirmation. There's no need to specifically use bash, so I think the instructions are fine as-is. Any POSIX-compliant shell will support the variable assignment, variable substitution, and command-substitution features as used in the instructions, and if someone is using a shell that doesn't support these features, they're likely knowledgeable enough to know how to adapt.

adphronesis commented 2 months ago

OK, if that's the case, then I agree. And thanks for education on this matter!