Skip to contentSkip to conversation

Number of subdevices on midi.

DISCUSSION Peter Enderborg 4 participants 7 messages Apr 3, 2002 – Apr 9, 2002

lore
Share & tools
lore
#0 lore raw

I have tryed to get some answer from Jaroslav about subdevices on midi. Im trying to write
a driver for midisport 8x8/s and that have 9 midi ports. On my hack to figure out
the protocol I use virmidi to handle the interface to alsa. But virmidi only have four
subdevices per device. I need to see the driver for a midi interface that using all the
16 subdevices. Since I don't get answer from Jaroslav i guess he don't have the time
or my question is stupid. But can someone help me out? Where should I look?

#1 lore raw
Quoted 6 lines · you

subdevices per device. I need to see the driver for a midi interface that using all the
16 subdevices. Since I don't get answer from Jaroslav i guess he don't have the time
or my question is stupid. But can someone help me out? Where should I look?

I have done a little work on a driver I'm writing for a PCI-MIDI interface system I designed (card is built and seems to work, breakout box isn't built yet). I first used the MTP-AV driver as a model, but had quite a time figuring out how exactly it hooked up with the sequencer, and eventually decided to write a kernel sequencer client that talks to the card directly. Much easier, and I can add some interesting features using user packets, and also I think it will be faster. This does have the disadvantage of leaving rawmidi apps in the cold, though, so I'd be interested in whatever you come up with.

cheers -- Michael Ashton <[email protected]>

#2 lore raw
In reply to Peter Enderborg
Quoted 4 lines · Peter Enderborg

I have tryed to get some answer from Jaroslav about subdevices on midi. Im trying to write a driver for midisport 8x8/s and that have 9 midi ports. On my hack to figure out the protocol I use virmidi to handle the interface to alsa. But virmidi only have four subdevices per device. I

You can set up to eight virmidi devices (snd_midi_devs parameter controls this count). On rawmidi side, there is 16 rawmidi substreams (subdevices) per one virmidi device. These subdevices are used for event merging (write) and coping (read). On sequencer side, there is one client and one port connected to virmidi device.

Quoted 4 lines

need to see the driver for a midi interface that using all the 16 subdevices. Since I don't get answer from Jaroslav i guess he don't have the time or my question is stupid. But can someone help me out? Where should I look?

There are two ways:

1) we can add a new mode to virmidi code which suppress copying and merging and connects more sequencer ports per a sequencer client to rawmidi subdevices to handle such devices
2) without any change - simply use more than one virmidi card and connect your code to more clients:

	modprobe snd-virmidi snd_index=1,2 snd_enable=1,1 snd_midi_devs=8,8

	(use index values as you wish)

	In this case, you should have available this routing table:

	sequencer (client:port)		rawmidi (card:device:subdevice)
	72:0				1:0:any
	73:0				1:1:any
	....				....
	79:0				1:7:any
	80:0				2:0:any
	....				...
	87:0				2:7:any


						Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

#3 lore raw
Quoted 18 lines · Jaroslav Kysela
Quoted 4 lines · Peter Enderborg

I have tryed to get some answer from Jaroslav about subdevices on midi. Im trying to write a driver for midisport 8x8/s and that have 9 midi ports. On my hack to figure out the protocol I use virmidi to handle the interface to alsa. But virmidi only have four subdevices per device. I

You can set up to eight virmidi devices (snd_midi_devs parameter controls this count). On rawmidi side, there is 16 rawmidi substreams (subdevices) per one virmidi device. These subdevices are used for event merging (write) and coping (read). On sequencer side, there is one client and one port connected to virmidi device.

Quoted 4 lines

need to see the driver for a midi interface that using all the 16 subdevices. Since I don't get answer from Jaroslav i guess he don't have the time or my question is stupid. But can someone help me out? Where should I look?

Quoted 8 lines

There are two ways:

1) we can add a new mode to virmidi code which suppress copying and merging and connects more sequencer ports per a sequencer client to rawmidi subdevices to handle such devices
2) without any change - simply use more than one virmidi card and connect your code to more clients:

That is what I do now. But it is not pretty. My plan is to do a real driver not a virmidi user.

Quoted 5 lines

modprobe snd-virmidi snd_index=1,2 snd_enable=1,1 snd_midi_devs=8,8

(use index values as you wish)

Have you done that? This is what I get.

[root@pescadero pme]# /sbin/modprobe snd-virmidi snd_enable=1,1 snd_midi_devs=8,8
/lib/modules/2.4.16/misc/snd-virmidi.o: init_module: No such device
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters /lib/modules/2.4.16/misc/snd-virmidi.o: insmod /lib/modules/2.4.16/misc/snd-virmidi.o failed /lib/modules/2.4.16/misc/snd-virmidi.o: insmod snd-virmidi failed

[root@pescadero pme]# /sbin/modprobe snd-virmidi snd_enable=1,1 snd_midi_devs=8
/lib/modules/2.4.16/misc/snd-virmidi.o: init_module: No such device
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters /lib/modules/2.4.16/misc/snd-virmidi.o: insmod /lib/modules/2.4.16/misc/snd-virmidi.o failed /lib/modules/2.4.16/misc/snd-virmidi.o: insmod snd-virmidi failed

[root@pescadero pme]# /sbin/modprobe snd-virmidi snd_enable=1,1 snd_midi_devs=4,4
[root@pescadero pme]#

I also get the same with 5.

Quoted 20 lines

In this case, you should have available this routing table:

sequencer (client:port) rawmidi (card:device:subdevice)
72:0 1:0:any
73:0 1:1:any
.... ....
79:0 1:7:any
80:0 2:0:any
.... ...
87:0 2:7:any

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

Quoted 4 lines

_______________________________________________
Alsa-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

--
foo!

#4 lore raw
Quoted 41 lines · Peter Enderborg
Quoted 18 lines · Jaroslav Kysela
Quoted 4 lines · Peter Enderborg

I have tryed to get some answer from Jaroslav about subdevices on midi. Im trying to write a driver for midisport 8x8/s and that have 9 midi ports. On my hack to figure out the protocol I use virmidi to handle the interface to alsa. But virmidi only have four subdevices per device. I

You can set up to eight virmidi devices (snd_midi_devs parameter controls this count). On rawmidi side, there is 16 rawmidi substreams (subdevices) per one virmidi device. These subdevices are used for event merging (write) and coping (read). On sequencer side, there is one client and one port connected to virmidi device.

Quoted 4 lines

need to see the driver for a midi interface that using all the 16 subdevices. Since I don't get answer from Jaroslav i guess he don't have the time or my question is stupid. But can someone help me out? Where should I look?

Quoted 8 lines

There are two ways:

1) we can add a new mode to virmidi code which suppress copying and merging and connects more sequencer ports per a sequencer client to rawmidi subdevices to handle such devices
2) without any change - simply use more than one virmidi card and connect your code to more clients:

That is what I do now. But it is not pretty. My plan is to do a real driver not a virmidi user.

Quoted 5 lines

modprobe snd-virmidi snd_index=1,2 snd_enable=1,1 snd_midi_devs=8,8

(use index values as you wish)

Have you done that? This is what I get.

Quoted 8 lines

[root@pescadero pme]# /sbin/modprobe snd-virmidi snd_enable=1,1 snd_midi_devs=8,8
/lib/modules/2.4.16/misc/snd-virmidi.o: init_module: No such device
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters /lib/modules/2.4.16/misc/snd-virmidi.o: insmod /lib/modules/2.4.16/misc/snd-virmidi.o failed /lib/modules/2.4.16/misc/snd-virmidi.o: insmod snd-virmidi failed

Oops. I've fixed this problem in CVS. Change SNDRV_RAWMIDI_DEVICES in alsa-kernel/include/rawmidi.h to 8.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com

#5 lore raw

At Sun, 7 Apr 2002 22:22:42 +0200 (CEST),

Quoted 53 lines · Jaroslav
Quoted 41 lines · Peter Enderborg
Quoted 18 lines · Jaroslav Kysela
Quoted 4 lines · Peter Enderborg

I have tryed to get some answer from Jaroslav about subdevices on midi. Im trying to write a driver for midisport 8x8/s and that have 9 midi ports. On my hack to figure out the protocol I use virmidi to handle the interface to alsa. But virmidi only have four subdevices per device. I

You can set up to eight virmidi devices (snd_midi_devs parameter controls this count). On rawmidi side, there is 16 rawmidi substreams (subdevices) per one virmidi device. These subdevices are used for event merging (write) and coping (read). On sequencer side, there is one client and one port connected to virmidi device.

Quoted 4 lines

need to see the driver for a midi interface that using all the 16 subdevices. Since I don't get answer from Jaroslav i guess he don't have the time or my question is stupid. But can someone help me out? Where should I look?

Quoted 8 lines

There are two ways:

1) we can add a new mode to virmidi code which suppress copying and merging and connects more sequencer ports per a sequencer client to rawmidi subdevices to handle such devices
2) without any change - simply use more than one virmidi card and connect your code to more clients:

That is what I do now. But it is not pretty. My plan is to do a real driver not a virmidi user.

Quoted 5 lines

modprobe snd-virmidi snd_index=1,2 snd_enable=1,1 snd_midi_devs=8,8

(use index values as you wish)

Have you done that? This is what I get.

Quoted 8 lines

[root@pescadero pme]# /sbin/modprobe snd-virmidi snd_enable=1,1 snd_midi_devs=8,8
/lib/modules/2.4.16/misc/snd-virmidi.o: init_module: No such device
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters /lib/modules/2.4.16/misc/snd-virmidi.o: insmod /lib/modules/2.4.16/misc/snd-virmidi.o failed /lib/modules/2.4.16/misc/snd-virmidi.o: insmod snd-virmidi failed

Quoted 2 lines

Oops. I've fixed this problem in CVS. Change SNDRV_RAWMIDI_DEVICES in alsa-kernel/include/rawmidi.h to 8.

in alsa-kernel/include/minors.h,

#define SNDRV_MINOR_RAWMIDI 8 /* 8 - 11 */
#define SNDRV_MINOR_RAWMIDIS 4
#define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */

so we need to change this too..
it seems no problem to assign 8 rawmidi devices - 8 devices are free, although the comment says 8 - 11..

Takashi

#6 lore raw
Quoted 60 lines · Takashi Iwai

At Sun, 7 Apr 2002 22:22:42 +0200 (CEST),

Quoted 53 lines · Jaroslav
Quoted 41 lines · Peter Enderborg
Quoted 18 lines · Jaroslav Kysela
Quoted 4 lines · Peter Enderborg

I have tryed to get some answer from Jaroslav about subdevices on midi. Im trying to write a driver for midisport 8x8/s and that have 9 midi ports. On my hack to figure out the protocol I use virmidi to handle the interface to alsa. But virmidi only have four subdevices per device. I

You can set up to eight virmidi devices (snd_midi_devs parameter controls this count). On rawmidi side, there is 16 rawmidi substreams (subdevices) per one virmidi device. These subdevices are used for event merging (write) and coping (read). On sequencer side, there is one client and one port connected to virmidi device.

Quoted 4 lines

need to see the driver for a midi interface that using all the 16 subdevices. Since I don't get answer from Jaroslav i guess he don't have the time or my question is stupid. But can someone help me out? Where should I look?

Quoted 8 lines

There are two ways:

1) we can add a new mode to virmidi code which suppress copying and merging and connects more sequencer ports per a sequencer client to rawmidi subdevices to handle such devices
2) without any change - simply use more than one virmidi card and connect your code to more clients:

That is what I do now. But it is not pretty. My plan is to do a real driver not a virmidi user.

Quoted 5 lines

modprobe snd-virmidi snd_index=1,2 snd_enable=1,1 snd_midi_devs=8,8

(use index values as you wish)

Have you done that? This is what I get.

Quoted 8 lines

[root@pescadero pme]# /sbin/modprobe snd-virmidi snd_enable=1,1 snd_midi_devs=8,8
/lib/modules/2.4.16/misc/snd-virmidi.o: init_module: No such device
Hint: insmod errors can be caused by incorrect module parameters, including invalid IO or IRQ parameters /lib/modules/2.4.16/misc/snd-virmidi.o: insmod /lib/modules/2.4.16/misc/snd-virmidi.o failed /lib/modules/2.4.16/misc/snd-virmidi.o: insmod snd-virmidi failed

Quoted 2 lines

Oops. I've fixed this problem in CVS. Change SNDRV_RAWMIDI_DEVICES in alsa-kernel/include/rawmidi.h to 8.

in alsa-kernel/include/minors.h,

Quoted 7 lines

#define SNDRV_MINOR_RAWMIDI 8 /* 8 - 11 */
#define SNDRV_MINOR_RAWMIDIS 4
#define SNDRV_MINOR_PCM_PLAYBACK 16 /* 16 - 23 */

so we need to change this too..
it seems no problem to assign 8 rawmidi devices - 8 devices are free, although the comment says 8 - 11..

It's right, I don't remember, if these device are reserved, but we can allocate next major when this problem arises. Fixed and thanks.

Jaroslav

-----
Jaroslav Kysela <[email protected]>
Linux Kernel Sound Maintainer
ALSA Project http://www.alsa-project.org
SuSE Linux http://www.suse.com