midi: no devices in wine

Questions about Wine on Linux
Locked
kellennnnss12
Newbie
Newbie
Posts: 4
Joined: Thu Feb 23, 2023 10:59 pm

midi: no devices in wine

Post by kellennnnss12 »

I referred to https://wiki.winehq.org/MIDI:

[*] fluidsynth -l -s -i -aalsa -o audio.alsa.device=default /tmp/TimGM6mb.sf2 works
[*] fluidsynth -l -s -i -apulseaudio /tmp/TimGM6mb.sf2 works
[*] aconnect -o works

Code: Select all

client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
client 128: 'FLUID Synth (43317)' [type=user,pid=43317]
    0 'Synth input port (43317:0)'
[*] aplaymidi -p128:0 CANYON.MID works

[*] But when I open winecfg, the Audio tab is not different. There are 2 speakers, Monitor of Built-in Analog Audio and PulseAudio. :(
jkfloris
Level 12
Level 12
Posts: 3201
Joined: Thu Aug 14, 2014 10:10 am

Re: midi: no devices in wine

Post by jkfloris »

If I understand the Wiki correctly, you need to use the Alsa driver with Wine to show the MIDI devices in winecfg.
You can switch to the Alsa driver with:

Code: Select all

winetricks sound=alsa
To use PulseAudio/ Pipewire again, use:

Code: Select all

winetricks sound=pulse
Although the devices are not visible in winecfg, several MIDI programs work with Wine (with the Pulseaudio driver) when I start Fluidsynth with:

Code: Select all

fluidsynth -l -s -i -a pulseaudio -m alsa_seq -g 1 -o midi.autoconnect=1 /usr/share/sounds/sf2/TimGM6mb.sf2
A new MIDI device is also visible when a program uses MIDI:

Code: Select all

$ aplaymidi -l
 Port    Client name                      Port name
 14:0    Midi Through                     Midi Through Port-0
128:0    FLUID Synth (16648)              Synth input port (16648:0)
129:0    WINE midi driver                 WINE ALSA Input

$ aconnect -l
client 0: 'System' [type=kernel]
    0 'Timer           '
	Connecting To: 144:0, 146:0
    1 'Announce        '
	Connecting To: 144:0, 146:0, 128:0
client 14: 'Midi Through' [type=kernel]
    0 'Midi Through Port-0'
	Connecting To: 128:0, 129:0
	Connected From: 129:1
client 128: 'FLUID Synth (16648)' [type=user,pid=16648]
    0 'Synth input port (16648:0)'
	Connected From: 0:1, 14:0, 129:1
client 129: 'WINE midi driver' [type=user,pid=16839]
    0 'WINE ALSA Input '
	Connected From: 14:0
    1 'WINE ALSA Output #5'
	Connecting To: 14:0, 128:0
client 144: 'PipeWire-System' [type=user,pid=2748]
    0 'input           '
	Connected From: 0:1, 0:0
client 145: 'PipeWire-RT-Event' [type=user,pid=2748]
    0 'input           '
client 146: 'PipeWire-System' [type=user,pid=8643]
    0 'input           '
	Connected From: 0:1, 0:0
client 147: 'PipeWire-RT-Event' [type=user,pid=8643]
    0 'input           '
Locked