1835274 Members
2755 Online
110078 Solutions
New Discussion

Re: mknod question ...

 
K.C. Chan
Trusted Contributor

mknod question ...

using this: " mknod -m 666 /dev/dsp4 c 14 67", question is the minor number any random number. How would you know which minor no to assigned to a device? Is there a command to query the minor number of a device? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
6 REPLIES 6
Stuart Browne
Honored Contributor

Re: mknod question ...

The minor number to a given device is very particular.

It says which device of a given type to access.

Different major's treat minor's differently however.

By the looks of it, you're trying to create an audio device, of which are in the 14 major. The minor's however are all over the place. Where'd you get the '67' from? Or was it just a guess?

The first one is 19, the 2nd one would be 25 (one more than the 'midi' devices).

How many sound cards do you have?
One long-haired git at your service...
Stuart Browne
Honored Contributor

Re: mknod question ...

err typo. 'dsp2' would be 35, 16 more than the previous dsp device.
One long-haired git at your service...
Alexander Chuzhoy
Honored Contributor

Re: mknod question ...

First -under /dev directory you have a nice utility called MAKEDEV (capital letters),
so executing
/dev/MAKEDEV devicename will create that device without specifying it's minor/major numbers.


Second-you have this file:
/usr/share/doc/MAKEDEV-'version'/devices.txt

You have minor/major numbers examples in it.
K.C. Chan
Trusted Contributor

Re: mknod question ...

I have 10 sound cards. Any idea on the minor no?
Reputation of a thousand years can be determined by the conduct of an hour
K.C. Chan
Trusted Contributor

Re: mknod question ...

I am working on alsa-1.x driver. loading 10 of these on a server. I am only able to get 8 of this going; I need to get the next two to work.
However, I get this when listing device, major no. changes from 116 to 117 on the 8th and 9 device:

crw-rw-rw- 1 root root 116, 0 Jun 30 09:38 /dev/aloadC0
crw-rw-rw- 1 root root 116, 32 Jun 30 09:38 /dev/aloadC1
crw-rw-rw- 1 root root 116, 64 Jun 30 09:38 /dev/aloadC2
crw-rw-rw- 1 root root 116, 96 Jun 30 09:38 /dev/aloadC3
crw-rw-rw- 1 root root 116, 128 Jun 30 09:38 /dev/aloadC4
crw-rw-rw- 1 root root 116, 160 Jun 30 09:38 /dev/aloadC5
crw-rw-rw- 1 root root 116, 192 Jun 30 09:38 /dev/aloadC6
crw-rw-rw- 1 root root 116, 224 Jun 30 09:38 /dev/aloadC7
crw-rw-rw- 1 root root 117, 0 Jun 30 09:38 /dev/aloadC8
crw-rw-rw- 1 root root 117, 32 Jun 30 09:38 /dev/aloadC9
crw-rw-rw- 1 root root 116, 1 Jun 30 09:38 /dev/aloadSEQ

It looks like it is an increment of 32, will it work if I make it an increment of 16. Who decides it's an increment of 32? Thanks.
Reputation of a thousand years can be determined by the conduct of an hour
Stuart Browne
Honored Contributor

Re: mknod question ...

alsa decides on the increment.

I'm thinking this is a question for the alsa mailing lists.

I'm afraid I've got no experience with that many sound devices in the one machine, and very limited with the alsa drivers in general.
One long-haired git at your service...