Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use #9

Open
adphronesis opened this issue Nov 22, 2024 · 9 comments
Open

Unable to use #9

adphronesis opened this issue Nov 22, 2024 · 9 comments

Comments

@adphronesis
Copy link

adphronesis commented Nov 22, 2024

Hello, I'm having trouble using HIDI-linux-amd64 in Debian Stable.

Xbox controller connected, it is recognized correctly by Debian.

I get this output:

sudo /home/user/HIDI-linux-am64 -standalone

device 0: [Keyboard], "AT Translated Set 2 keyboard", 1 handlers (Bus: 0x0011, Vendor: 0x0001, Product: 0x0001, Version: 0xab83) (listening on this device)
Pat the keyboard that you want to keep as computer input device

patted keybaord: [Keyboard], "AT Translated Set 2 keyboard", 1 handlers (Bus: 0x0011, Vendor: 0x0001, Product: 0x0001, Version: 0xab83)
ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory

MidiInAlsa::initialize: error creating ALSA sequencer client object.

can't get midi in ports: can't open default MIDI in: l�=/t
ALSA lib seq_hw.c:466:(snd_seq_hw_open) open /dev/snd/seq failed: No such file or directory

MidiOutAlsa::initialize: error creating ALSA sequencer client object.

can't get midi out ports: can't open default MIDI out: <B=/t
There is no midi devices available, we're deeply sorry
Failed to get midi port: midi port ID 0 doesn't exist

Same thing without standalone or without sudo.

My output of devices:

sudo cat /proc/bus/input/devices

I: Bus=0011 Vendor=0001 Product=0001 Version=ab83
N: Name="AT Translated Set 2 keyboard"
P: Phys=isa0060/serio0/input0
S: Sysfs=/devices/platform/i8042/serio0/input/input0
U: Uniq=
H: Handlers=sysrq kbd leds event0 
B: PROP=0
B: EV=120013
B: KEY=402000000 3803078f800d001 feffffdfffefffff fffffffffffffffe
B: MSC=10
B: LED=7

I: Bus=0019 Vendor=0000 Product=0005 Version=0000
N: Name="Lid Switch"
P: Phys=PNP0C0D/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0D:00/input/input2
U: Uniq=
H: Handlers=event1 
B: PROP=0
B: EV=21
B: SW=1

I: Bus=0019 Vendor=0000 Product=0003 Version=0000
N: Name="Sleep Button"
P: Phys=PNP0C0E/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0C0E:00/input/input3
U: Uniq=
H: Handlers=kbd event2 
B: PROP=0
B: EV=3
B: KEY=4000 0 0

I: Bus=0019 Vendor=0000 Product=0001 Version=0000
N: Name="Power Button"
P: Phys=LNXPWRBN/button/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXPWRBN:00/input/input4
U: Uniq=
H: Handlers=kbd event3 
B: PROP=0
B: EV=3
B: KEY=8000 10000000000000 0

I: Bus=0003 Vendor=046d Product=c077 Version=0111
N: Name="Logitech USB Optical Mouse"
P: Phys=usb-0000:00:14.0-2/input0
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0/0003:046D:C077.0001/input/input6
U: Uniq=
H: Handlers=mouse0 event4 
B: PROP=0
B: EV=17
B: KEY=70000 0 0 0 0
B: REL=903
B: MSC=10

I: Bus=0019 Vendor=0000 Product=0006 Version=0000
N: Name="Video Bus"
P: Phys=LNXVIDEO/video/input0
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/LNXVIDEO:00/input/input7
U: Uniq=
H: Handlers=kbd event5 
B: PROP=0
B: EV=3
B: KEY=3e000b00000000 0 0 0

I: Bus=0010 Vendor=001f Product=0001 Version=0100
N: Name="PC Speaker"
P: Phys=isa0061/input0
S: Sysfs=/devices/platform/pcspkr/input/input8
U: Uniq=
H: Handlers=kbd event6 
B: PROP=0
B: EV=40001
B: SND=6

I: Bus=001d Vendor=06cb Product=0000 Version=0000
N: Name="Synaptics TM3075-002"
P: Phys=rmi4-00/input0
S: Sysfs=/devices/pci0000:00/0000:00:1f.3/i2c-0/0-002c/rmi4-00/input/input9
U: Uniq=
H: Handlers=mouse1 event7 
B: PROP=5
B: EV=b
B: KEY=e520 10000 0 0 0 0
B: ABS=6f3800001000003

I: Bus=0019 Vendor=17aa Product=5054 Version=4101
N: Name="ThinkPad Extra Buttons"
P: Phys=thinkpad_acpi/input0
S: Sysfs=/devices/platform/thinkpad_acpi/input/input10
U: Uniq=
H: Handlers=kbd event8 rfkill 
B: PROP=0
B: EV=33
B: KEY=400000000010040 0 18040000 0 50010000000000 0 1701b87102c04 c000280051395000 10e000000000000 0
B: MSC=10
B: SW=8

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel HDMI HDMI/DP,pcm=3"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:03.0/sound/card0/input12
U: Uniq=
H: Handlers=event9 
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel HDMI HDMI/DP,pcm=7"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:03.0/sound/card0/input13
U: Uniq=
H: Handlers=event10 
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel HDMI HDMI/DP,pcm=8"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:03.0/sound/card0/input14
U: Uniq=
H: Handlers=event11 
B: PROP=0
B: EV=21
B: SW=140

I: Bus=0001 Vendor=10ec Product=0292 Version=0001
N: Name="HDA Digital PCBeep"
P: Phys=card1/codec#0/beep0
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card1/input15
U: Uniq=
H: Handlers=kbd event12 
B: PROP=0
B: EV=40001
B: SND=6

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Mic"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card1/input16
U: Uniq=
H: Handlers=event13 
B: PROP=0
B: EV=21
B: SW=10

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Dock Mic"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card1/input17
U: Uniq=
H: Handlers=event14 
B: PROP=0
B: EV=21
B: SW=10

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Dock Headphone"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card1/input18
U: Uniq=
H: Handlers=event15 
B: PROP=0
B: EV=21
B: SW=4

I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="HDA Intel PCH Headphone"
P: Phys=ALSA
S: Sysfs=/devices/pci0000:00/0000:00:1b.0/sound/card1/input19
U: Uniq=
H: Handlers=event16 
B: PROP=0
B: EV=21
B: SW=4

I: Bus=0011 Vendor=0002 Product=000a Version=0000
N: Name="TPPS/2 IBM TrackPoint"
P: Phys=rmi4-00.fn03/serio0/input0
S: Sysfs=/devices/pci0000:00/0000:00:1f.3/i2c-0/0-002c/rmi4-00/rmi4-00.fn03/serio2/input/input11
U: Uniq=
H: Handlers=mouse2 event17 
B: PROP=21
B: EV=7
B: KEY=70000 0 0 0 0
B: REL=3

Thank you in advance for any help!

@gethiox
Copy link
Owner

gethiox commented Nov 22, 2024

I just installed Debian 12 on a VMWare and I cannot reproduce this issue, works just fine on my side, I can produce a sound with amsynth synthesizer.

your output suggest there is no available alsa midi ports.
What's your audio backend? JACK? Pipewire? Alsa?

Your Debian installation should have at least alsa installed by default I assume, if not, try to install these two packages:

libasound2
alsa-utils

However, pipewire is a modern standard audio backed and you probably are using that, try to install that package then:

pipewire-alsa

Otherwise I'm not sure what is wrong with your setup. This is all I got for now, let me think about it.

By the way, I don't see your xbox controller in attached /proc/bus/input/devices 🤔, there should be an entry like this one:

I: Bus=0003 Vendor=045e Product=02ea Version=0301
N: Name="Microsoft X-Box One S pad"
P: Phys=usb-0000:02:00.0-2.2/input0
S: Sysfs=/devices/pci0000:00/0000:00:11.0/0000:02:00.0/usb2/2-2/2-2.2/2-2.2:1.0/input/input9
U: Uniq=
H: Handlers=event7 js1 
B: PROP=0
B: EV=20000b
B: KEY=7cdb000000000000 0 0 0 0
B: ABS=3003f
B: FF=107030000 0

@adphronesis
Copy link
Author

I'm using pipewire. Sorry about missing controller, I took wrong output. Here is the controller:

I: Bus=0003 Vendor=045e Product=028e Version=0120
N: Name="Microsoft X-Box 360 pad"
P: Phys=usb-0000:00:14.0-5/input0
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5:1.0/input/input19
U: Uniq=
H: Handlers=event16 js0
B: PROP=0
B: EV=20000b
B: KEY=7cdb000000000000 0 0 0 0
B: ABS=3003f
B: FF=107030000 0

@adphronesis
Copy link
Author

Update, this works with my different newer ThinkPad, X390! Previous where this didn't work is ThinkPad X250. Weird, these have identical installs.

@adphronesis
Copy link
Author

So my use case would be to control MIDI in REAPER DAW, can you instruct how to make DAW see this as a MIDI device, or is that how this is supposed to work?

@gethiox
Copy link
Owner

gethiox commented Nov 23, 2024

I was able to make it work under ALSA audio system in Reaper.
open options > preferences, make sure under Audio > Device there is ALSA Audio system selected, then under Audio MIDI Inputs there should be virtual device listed - mark it as input, then under Audio MIDI Outputs mark that virtual device as Enable.
From now on you should see new midi device available in HIDI - run ./HIDI -listmididevices to check it, then use -mididevice <number> to connect to that midi device.

Can't really tell how to make it work under Pipewire. In theory, if I recall correctly, Pipewire should expose JACK backend for applications for "PRO Audio" usage. In that case I can only imagine that you should use JACK Audio system under Audio > Device configuration in Reaper, run HIDI with -virtual parameter (it will create separate, disconnected virtual ALSA MIDI device), and then somehow connect it to the Reaper (I only know JACK was able to map ALSA midi in/out into JACK's midi in/out equivalent). You could also try to connect to existing 0: Midi Through:Midi Through Port-0 14:0 (Input/Output) and maybe make it work that way somehow.

Unfortunately I can't guide you in the case of Pipewire, to be honest whole "standalone" mode in HIDI is a bit experimental and certainly not polished nor tested. It can work with the quirks but certainly it's not the best user experience.
I also tried standalone/virtual mode with Bitwig with no luck, no matter which Audio System backend I choose, there is no MIDI device of HIDI available in controller settings.

My own setup is dedicated raspberry pi + two, bridged midi USB devices (one for raspberry, one for my PC) - it's not pretty but it is the simplest and intended usage of HIDI, that way you will have no such issues as you have hardware MIDI device available in every DAW/application/Audio System Backend.

Maybe someday I will work on standalone mode improvements, but not anytime soon. Implementing a realtime MIDI sequencer (controlled by a RGB Keyboard) is much closer to happen for instance.

@gethiox
Copy link
Owner

gethiox commented Nov 23, 2024

And I'm still curious why HIDI doesn't work on your older hardware, as hardware should not matter, especially when there are identical system installations on both devices 🤔

At least it works on your newer machine, I'm glad to hear that.

@gethiox
Copy link
Owner

gethiox commented Nov 23, 2024

By the way, have you heard of DrivenByMoss? It supports gamepads since version 16, maybe it will be more suitable solution for you if your setup relies only on a gamepad.
However, HIDI should be taking advantage of additional computer keyboards connected to your system.

@adphronesis
Copy link
Author

Thank you for your help! I managed to get this work, so that REAPER really does get input from gamepad, but it seems very random as how it detects what it detects, but that may be a config thing. Am I supposed to keep terminal open all the time? Because it seems REAPER still detects midi from gamepad even if I terminate program? Also, how am I suppose to config this? Via "/home/user/hidi-config/hidi.toml"?

@gethiox
Copy link
Owner

gethiox commented Nov 24, 2024

Am I supposed to keep terminal open all the time?

yes, HIDI has to do its own thing

Because it seems REAPER still detects midi from gamepad even if I terminate program?

Does gamepad still works when you terminate program? because it should not.

Also, how am I suppose to config this? Via "/home/user/hidi-config/hidi.toml"?

hidi.toml contains the least important configuration options, from the HIDI side you can personalize its mapping if default doesn't suits your needs. everything is described in hidi-config/user/README.md

I can't assist you how to configure it from the Reaper side as I don't know this program, for example it should be possible to map certain MIDI events to play/stop the playhead in Reaper and configure other such actions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants