* help needed on how to autoload snd-usb-midi @ 2002-10-15 14:40 karsten wiese 2002-10-15 15:24 ` Clemens Ladisch 2002-10-15 17:51 ` Takashi Iwai 0 siblings, 2 replies; 10+ messages in thread From: karsten wiese @ 2002-10-15 14:40 UTC (permalink / raw) To: Takashi Iwai, Clemens Ladisch; +Cc: Devel Alsa Hi, I am in the process of updating the tascam us-428 patch for alsa-current and need some hints: formerly the snd-usb-us428 issued "request_module( "snd-usb-midi");" to load that module. this doesn't work with alsa-current anymore as the snd-usb-audio initialisation, which is triggered, conflicts with the initialisation of snd-usb-us428. thus I deleted that "request_module( "snd-usb-midi");" from snd_usb_us428. I remember from some Mail on this list, that snd-usb-midi would be autoloaded if a users process accesses a mididevice, which has been created by "snd_seq_device_new( ...SNDRV_SEQ_DEV_ID_USBMIDI)". this does not happen here now. what do I miss? for the tests I use the bristolsynth with "./startBristol -alsa -audiodev hw:1 -mididev hw:1" having issued "modprobe snd-usb-midi" before, everythingg works as expected. otherwise "Could not open the MIDI interface. Error opening midi device hw:1, exiting midi thread" TIA, Karsten __________________________________________________________________ Gesendet von Yahoo! Mail - http://mail.yahoo.de Möchten Sie mit einem Gruß antworten? http://grusskarten.yahoo.de ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: help needed on how to autoload snd-usb-midi 2002-10-15 14:40 help needed on how to autoload snd-usb-midi karsten wiese @ 2002-10-15 15:24 ` Clemens Ladisch 2002-10-15 17:27 ` karsten wiese 2002-10-15 17:51 ` Takashi Iwai 1 sibling, 1 reply; 10+ messages in thread From: Clemens Ladisch @ 2002-10-15 15:24 UTC (permalink / raw) To: karsten wiese; +Cc: Takashi Iwai, Devel Alsa karsten wiese wrote: > I am in the process of updating the tascam us-428 > patch for alsa-current and need some hints: > formerly the snd-usb-us428 issued > "request_module( "snd-usb-midi");" > to load that module. this doesn't work with > alsa-current anymore as the snd-usb-audio > initialisation, which is triggered, conflicts with the > initialisation of snd-usb-us428. > thus I deleted that "request_module( "snd-usb-midi");" > from snd_usb_us428. snd-usb-midi isn't anymore an independent driver, it has been integrated into snd-usb-audio (as you've seen), although it's still a separate module. In theory, it may be possible to do the same stuff as snd_usb_create_midi_interface() to make it load correctly. IMHO the "best" solution would be to add a quirk to usbaudio.c, instead of writing an entirely separate driver with most of the code duplicated. I didn't look at your patch in full length, but it seems to me that the changes needed would be firmware loading (best done in a separate driver or a userspace program) and adding some information about supported audio formats/bitrates. (I'm sure I've missed something. :) > I remember from some Mail on this list, that > snd-usb-midi would be autoloaded if a users process > accesses a mididevice, which has been created by > "snd_seq_device_new( ...SNDRV_SEQ_DEV_ID_USBMIDI)". > this does not happen here now. Autoloading happens if there is an alias for snd-card-x (x derived from the client number) in modules.conf, and if the card driver calls snd_seq_device_new() for the sequencer driver. (BTW: there was a bug with autoloading sequencer drivers which has been fixed yesterday) HTH Clemens ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: help needed on how to autoload snd-usb-midi 2002-10-15 15:24 ` Clemens Ladisch @ 2002-10-15 17:27 ` karsten wiese 2002-10-16 7:34 ` Clemens Ladisch 0 siblings, 1 reply; 10+ messages in thread From: karsten wiese @ 2002-10-15 17:27 UTC (permalink / raw) To: Clemens Ladisch; +Cc: Takashi Iwai, Devel Alsa Clemens Ladisch schrieb: > karsten wiese wrote: > > I am in the process of updating the tascam us-428 > > patch for alsa-current and need some hints: > > formerly the snd-usb-us428 issued > > "request_module( "snd-usb-midi");" > > to load that module. this doesn't work with > > alsa-current anymore as the snd-usb-audio > > initialisation, which is triggered, conflicts with > the > > initialisation of snd-usb-us428. > > thus I deleted that "request_module( > "snd-usb-midi");" > > from snd_usb_us428. > > snd-usb-midi isn't anymore an independent driver, it > has been integrated > into snd-usb-audio (as you've seen), although it's > still a separate > module. In theory, it may be possible to do the same > stuff as > snd_usb_create_midi_interface() to make it load > correctly. here is the routine that is used in snd-usb-us428: static int snd_us428_create_usbmidi( snd_card_t* card ) { #if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) static snd_usb_audio_quirk_t quirk = { .vendor_name = "TASCAM", .product_name = "US-428", .ifnum = 0, .type = QUIRK_MIDI_FIXED_ENDPOINT, .data = & (const snd_usb_midi_endpoint_info_t) { .epnum = 6, .out_cables = 3, .in_cables = 3 } }; snd_seq_device_t *seq_device; snd_usb_midi_t *umidi; int err; err = snd_seq_device_new( card, us428( card)->chip.next_seq_device, SNDRV_SEQ_DEV_ID_USBMIDI, sizeof(snd_usb_midi_t), &seq_device); if (err < 0) return err; us428( card)->chip.next_seq_device++; strcpy(seq_device->name, card->shortname); umidi = (snd_usb_midi_t *)SNDRV_SEQ_DEVICE_ARGPTR(seq_device); umidi->chip = &us428( card)->chip; umidi->ifnum = 0; umidi->quirk = &quirk; umidi->seq_client = -1; #endif return 0; } its a copy-change of usb-audio. something wrong here ? cannot be completely wrong: if snd-usb-midi is loaded manually, everything works ok. > > IMHO the "best" solution would be to add a quirk to > usbaudio.c, instead of > writing an entirely separate driver with most of the > code duplicated. I > didn't look at your patch in full length, but it > seems to me that the > changes needed would be firmware loading (best done > in a separate driver > or a userspace program) and adding some information > about supported audio > formats/bitrates. (I'm sure I've missed something. > :) the us-428 audio is very nonstandard: it is necessary to know how many frames are just recorded to be able to playback without unwanted crackles. I found no other way to determine the exact samplerate. furthermore there are the hardware knobs, sliders and lights, the digital in switch.... > > > I remember from some Mail on this list, that > > snd-usb-midi would be autoloaded if a users > process > > accesses a mididevice, which has been created by > > "snd_seq_device_new( > ...SNDRV_SEQ_DEV_ID_USBMIDI)". > > this does not happen here now. > > Autoloading happens if there is an alias for > snd-card-x (x derived from > the client number) in modules.conf, and if the card > driver calls > snd_seq_device_new() for the sequencer driver. (BTW: > there was a bug with > autoloading sequencer drivers which has been fixed > yesterday) mmh, i just checked again my tree: it is current. I put a line "alias snd-card-1 snd-usb-midi" (the us-428 is my second card) into modules.conf. is it this what you suggest? unfortunately the autoload still does not happen. Trying to start the Synth with: "./startBristol -alsa -audiodev hw:1 -mididev hw:1" snd-usb-midi is still not loaded and the error message is: "ALSA lib rawmidi_hw.c:227:(snd_rawmidi_hw_open) open /dev/snd/midiC1D0 failed: No such file or directory" Could somebody please explain, how a specific midi module gets loaded on a user processes access of an alsa (raw)midi device ? Karsten __________________________________________________________________ Gesendet von Yahoo! Mail - http://mail.yahoo.de Möchten Sie mit einem Gruß antworten? http://grusskarten.yahoo.de ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: help needed on how to autoload snd-usb-midi 2002-10-15 17:27 ` karsten wiese @ 2002-10-16 7:34 ` Clemens Ladisch 2002-10-16 7:57 ` Jaroslav Kysela 0 siblings, 1 reply; 10+ messages in thread From: Clemens Ladisch @ 2002-10-16 7:34 UTC (permalink / raw) To: karsten wiese; +Cc: Takashi Iwai, alsa-devel karsten wiese wrote: > here is the routine that is used in snd-usb-us428: > ... > its a copy-change of usb-audio. something wrong here ? No, it's fine. The problem is elsewhere. > > IMHO the "best" solution would be to add a quirk to > > usbaudio.c, (...) (I'm sure I've missed something. > > :) > the us-428 audio is very nonstandard: > it is necessary to know how many frames are just > recorded to be able to playback without unwanted > crackles. I.e. an asynchronous endpoint without frequency feedback? :-( There isn't a second endpoint in the playback interface? > furthermore there are the hardware knobs, sliders and lights, > the digital in switch.... ... and I guess those aren't in any way compatible with USB audio mixer controls. > > Autoloading happens if there is an alias for > > snd-card-x (x derived from > > the client number) in modules.conf, ... > > I put a line > "alias snd-card-1 snd-usb-midi" > (the us-428 is my second card) > into modules.conf. is it this what you suggest? No, the alias should be for the card driver: alias snd-card-1 snd-usb-us428 > unfortunately the autoload still does not happen. Autoloading works for sequencer ports and for "real" rawmidi devices, but not for rawmidi devices emulated on top of a sequencer port. Takashi, would it be possible/desirable to change snd_rawmidi_hw_open() to load sequencer drivers if the card driver is loaded but the rawmidi device doesn't exist? Something like: if ((fd = open(filename, fmode)) < 0) { - snd_card_load(card); + card_loaded = snd_card_load(card) == 0; // 0 or 1? - if ((fd = open(filename, fmode)) < 0) { + fd = open(filename, fmode); + if (card_loaded && fd < 0) { + load_seq_dev(...); // hw_open, get_client_info ? + fd = open(filename, fmode); + } + if (fd < 0) { snd_ctl_close(ctl); SYSERR("open %s failed", filename); return -errno; } } Regards Clemens ------------------------------------------------------- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: help needed on how to autoload snd-usb-midi 2002-10-16 7:34 ` Clemens Ladisch @ 2002-10-16 7:57 ` Jaroslav Kysela 2002-10-16 11:19 ` Clemens Ladisch 0 siblings, 1 reply; 10+ messages in thread From: Jaroslav Kysela @ 2002-10-16 7:57 UTC (permalink / raw) To: Clemens Ladisch; +Cc: karsten wiese, Takashi Iwai, alsa-devel On Wed, 16 Oct 2002, Clemens Ladisch wrote: > karsten wiese wrote: > > here is the routine that is used in snd-usb-us428: > > ... > > its a copy-change of usb-audio. something wrong here ? > > No, it's fine. The problem is elsewhere. > > > > IMHO the "best" solution would be to add a quirk to > > > usbaudio.c, (...) (I'm sure I've missed something. > > > :) > > the us-428 audio is very nonstandard: > > it is necessary to know how many frames are just > > recorded to be able to playback without unwanted > > crackles. > > I.e. an asynchronous endpoint without frequency feedback? :-( > There isn't a second endpoint in the playback interface? > > > furthermore there are the hardware knobs, sliders and lights, > > the digital in switch.... > > ... and I guess those aren't in any way compatible with USB audio mixer > controls. > > > > Autoloading happens if there is an alias for > > > snd-card-x (x derived from > > > the client number) in modules.conf, ... > > > > I put a line > > "alias snd-card-1 snd-usb-midi" > > (the us-428 is my second card) > > into modules.conf. is it this what you suggest? > > No, the alias should be for the card driver: > alias snd-card-1 snd-usb-us428 > > > unfortunately the autoload still does not happen. > > Autoloading works for sequencer ports and for "real" rawmidi devices, > but not for rawmidi devices emulated on top of a sequencer port. > > Takashi, would it be possible/desirable to change snd_rawmidi_hw_open() > to load sequencer drivers if the card driver is loaded but the rawmidi > device doesn't exist? > Something like: > > if ((fd = open(filename, fmode)) < 0) { > - snd_card_load(card); > + card_loaded = snd_card_load(card) == 0; // 0 or 1? > - if ((fd = open(filename, fmode)) < 0) { > + fd = open(filename, fmode); > + if (card_loaded && fd < 0) { > + load_seq_dev(...); // hw_open, get_client_info ? > + fd = open(filename, fmode); > + } > + if (fd < 0) { > snd_ctl_close(ctl); > SYSERR("open %s failed", filename); > return -errno; > } > } It looks ugly. Wouldn't be better to create a direct rawmidi USB driver? Could you remind me reason, why you parse sequencer events? There's something special for USB? Jaroslav ----- Jaroslav Kysela <perex@suse.cz> Linux Kernel Sound Maintainer ALSA Project http://www.alsa-project.org SuSE Linux http://www.suse.com ------------------------------------------------------- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: help needed on how to autoload snd-usb-midi 2002-10-16 7:57 ` Jaroslav Kysela @ 2002-10-16 11:19 ` Clemens Ladisch 2002-10-16 17:49 ` Peter L Jones 0 siblings, 1 reply; 10+ messages in thread From: Clemens Ladisch @ 2002-10-16 11:19 UTC (permalink / raw) To: Jaroslav Kysela; +Cc: Takashi Iwai, alsa-devel Jaroslav Kysela wrote: > On Wed, 16 Oct 2002, Clemens Ladisch wrote: > > Takashi, would it be possible/desirable to change snd_rawmidi_hw_open() > > to load sequencer drivers if the card driver is loaded but the rawmidi > > device doesn't exist? > > Something like: > > (...) > > It looks ugly. Yes. > Wouldn't be better to create a direct rawmidi USB driver? > Could you remind me reason, why you parse sequencer events? There's > something special for USB? USB MIDI is not the same as rawmidi as each MIDI command must be sent as a 32-bit packet, so the driver must parse the stream somehow. (There is a USB MIDI code to send a raw MIDI byte, but there are devices not supporting this. (The USB MIDI specification and said device are, of course, from the same company.)) Well, the real reason why I wrote a sequencer driver was that I wanted to decide between a rawmidi and a sequencer driver, but there wasn't any sequencer driver supporting input, so I had to write one to find out about it. ;-) It turns out there isn't any real advantage over a rawmidi driver, so I think I'll change the driver to use rawmidi in the next few days. Regards Clemens ------------------------------------------------------- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: help needed on how to autoload snd-usb-midi 2002-10-16 11:19 ` Clemens Ladisch @ 2002-10-16 17:49 ` Peter L Jones 2002-10-16 21:53 ` us428 patch 0.0.4 karsten wiese 2002-10-17 8:01 ` help needed on how to autoload snd-usb-midi Clemens Ladisch 0 siblings, 2 replies; 10+ messages in thread From: Peter L Jones @ 2002-10-16 17:49 UTC (permalink / raw) To: Clemens Ladisch; +Cc: alsa-devel On Wednesday 16 Oct 2002 12:19, Clemens Ladisch wrote: [snip] > > Well, the real reason why I wrote a sequencer driver was that I wanted to > decide between a rawmidi and a sequencer driver, but there wasn't any > sequencer driver supporting input, so I had to write one to find out about > it. ;-) That's a _good_ reason in my book... ;-) > > It turns out there isn't any real advantage over a rawmidi driver, so I > think I'll change the driver to use rawmidi in the next few days. Will this affect the code used when I'm playing (with) my USB MIDI keyboard? (i.e. do I need to test it? ;-) ) > > > Regards > Clemens > > > > ------------------------------------------------------- > This sf.net email is sponsored by: viaVerio will pay you up to > $1,000 for every account that you consolidate with us. > http://ad.doubleclick.net/clk;4749864;7604308;v? > http://www.viaverio.com/consolidator/osdn.cfm > _______________________________________________ Oh dear, we're selling stuff for sf.net :-)) -- Peter ------------------------------------------------------- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ^ permalink raw reply [flat|nested] 10+ messages in thread
* us428 patch 0.0.4 2002-10-16 17:49 ` Peter L Jones @ 2002-10-16 21:53 ` karsten wiese 2002-10-17 8:01 ` help needed on how to autoload snd-usb-midi Clemens Ladisch 1 sibling, 0 replies; 10+ messages in thread From: karsten wiese @ 2002-10-16 21:53 UTC (permalink / raw) To: alsa-devel [-- Attachment #1: Type: text/plain, Size: 1330 bytes --] hi, this is the logentry: >>> compiles again with alsa-current. USB_ISO_ASAP not used anymore (most of the time), instead urb->start_frame is calculated here now, some calls inside usb-driver don't need to happen anymore. To get the best out of this: Disable APM-support in the kernel as APM-BIOS calls (once each second) hard disable interrupt for many precious milliseconds. This helped me much on my slowish PII 400 & PIII 500. ACPI yet untested but might cause the same bad behaviour. Use a kernel with lowlatency and preemptiv patches applied. To autoload snd-usb-midi append a line post-install snd-usb-us428 modprobe snd-usb-midi to /etc/modules.conf. known problems: (1) interrupts > 1000 every 1 s. (2)sliders, knobs, lights not yet handled except MASTER Volume slider. (3)"pcm -c 2" doesn't work. "pcm -c 2 -m direct_interleaved" does. (4)KDE3.03: "Enable full duplex operation" deadlocks. <<< tascams (still unauthorized) firmware is not included but can be optained off http://hal9000.drehmoment.org/tascam/ thanks for your support ! aaand does anybody have some clue(s) about the known problem (3)? best regards, karsten __________________________________________________________________ Gesendet von Yahoo! Mail - http://mail.yahoo.de Möchten Sie mit einem Gruß antworten? http://grusskarten.yahoo.de [-- Attachment #2: us428_0.0.4_alsa0.9_gpl.tar.bz2 --] [-- Type: application/octet-stream, Size: 18377 bytes --] ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: help needed on how to autoload snd-usb-midi 2002-10-16 17:49 ` Peter L Jones 2002-10-16 21:53 ` us428 patch 0.0.4 karsten wiese @ 2002-10-17 8:01 ` Clemens Ladisch 1 sibling, 0 replies; 10+ messages in thread From: Clemens Ladisch @ 2002-10-17 8:01 UTC (permalink / raw) To: Peter L Jones; +Cc: alsa-devel Peter L Jones wrote: > On Wednesday 16 Oct 2002 12:19, Clemens Ladisch wrote: > > It turns out there isn't any real advantage over a rawmidi driver, so I > > think I'll change the driver to use rawmidi in the next few days. > > Will this affect the code used when I'm playing (with) my USB MIDI keyboard? > (i.e. do I need to test it? ;-) ) In theory, no. (In theory, there is no difference between theory and practice. :-) Regards Clemens ------------------------------------------------------- This sf.net email is sponsored by: viaVerio will pay you up to $1,000 for every account that you consolidate with us. http://ad.doubleclick.net/clk;4749864;7604308;v? http://www.viaverio.com/consolidator/osdn.cfm ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: help needed on how to autoload snd-usb-midi 2002-10-15 14:40 help needed on how to autoload snd-usb-midi karsten wiese 2002-10-15 15:24 ` Clemens Ladisch @ 2002-10-15 17:51 ` Takashi Iwai 1 sibling, 0 replies; 10+ messages in thread From: Takashi Iwai @ 2002-10-15 17:51 UTC (permalink / raw) To: karsten wiese; +Cc: Clemens Ladisch, Devel Alsa At Tue, 15 Oct 2002 16:40:56 +0200 (CEST), karsten wiese wrote: > > Hi, > > I am in the process of updating the tascam us-428 > patch for alsa-current and need some hints: > formerly the snd-usb-us428 issued > "request_module( "snd-usb-midi");" > to load that module. this doesn't work with > alsa-current anymore as the snd-usb-audio > initialisation, which is triggered, conflicts with the > initialisation of snd-usb-us428. > thus I deleted that "request_module( "snd-usb-midi");" > from snd_usb_us428. > I remember from some Mail on this list, that > snd-usb-midi would be autoloaded if a users process > accesses a mididevice, which has been created by > "snd_seq_device_new( ...SNDRV_SEQ_DEV_ID_USBMIDI)". > this does not happen here now. > what do I miss? > for the tests I use the bristolsynth with > "./startBristol -alsa -audiodev hw:1 -mididev hw:1" > having issued "modprobe snd-usb-midi" before, > everythingg works as expected. otherwise > "Could not open the MIDI interface. > Error opening midi device hw:1, exiting midi thread" does support bristrol ALSA sequencer? if it accesses only the midi device, then snd-usb-midi module won't be loaded automatically, because the midi device itself is not the sequencer stuff. the auto-load mechanism works only when the sequencer stuff is requested. i think that an easy way is to force to load snd-usb-midi after snd-usb-audio, such as above command in /etc/modules.conf. Takashi ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2002-10-17 8:01 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2002-10-15 14:40 help needed on how to autoload snd-usb-midi karsten wiese 2002-10-15 15:24 ` Clemens Ladisch 2002-10-15 17:27 ` karsten wiese 2002-10-16 7:34 ` Clemens Ladisch 2002-10-16 7:57 ` Jaroslav Kysela 2002-10-16 11:19 ` Clemens Ladisch 2002-10-16 17:49 ` Peter L Jones 2002-10-16 21:53 ` us428 patch 0.0.4 karsten wiese 2002-10-17 8:01 ` help needed on how to autoload snd-usb-midi Clemens Ladisch 2002-10-15 17:51 ` Takashi Iwai
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.