[Cs-dev] MIDI device listing
Date | 2013-06-15 10:55 |
From | Andres Cabrera |
Subject | [Cs-dev] MIDI device listing |
Attachments | None None |
Hi, There's also something wrong with the jack module report, it seems that the module might not be setting the device callback, and the previous one is reporting the devices.It appears that MIDI device listing through the API is not working, I always get 0 devices. See attached code. I'm in the process of adding this to the test suite, but have been having trouble committing... Cheers, Andrés Module 1: pulse (audio): 0 devices Module 2: pa_bl (audio): 9 devices 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) 1: dac1 (sysdefault) 2: dac2 (front) 3: dac3 (surround40) 4: dac4 (surround51) 5: dac5 (surround71) 6: dac6 (pulse) 7: dac7 (dmix) 8: dac8 (default) Module 3: pa_cb (audio): 9 devices 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) 1: dac1 (sysdefault) 2: dac2 (front) 3: dac3 (surround40) 4: dac4 (surround51) 5: dac5 (surround71) 6: dac6 (pulse) 7: dac7 (dmix) 8: dac8 (default) Module 4: jack (audio): 9 devices 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) 1: dac1 (sysdefault) 2: dac2 (front) 3: dac3 (surround40) 4: dac4 (surround51) 5: dac5 (surround71) 6: dac6 (pulse) 7: dac7 (dmix) 8: dac8 (default) Module 5: pmidi (midi): 0 devices Module 6: alsa (audio): 1 devices 0: hw:0,0 (ALC269VC A) Module 7: alsaseq (midi): 0 devices Module 8: devfile (midi): 0 devices Module 1: pulse (audio): 1 devices 0: hw:0,0 (ALC269VC A) Module 2: pa_bl (audio): 4 devices 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) 1: dac1 (sysdefault) 2: dac2 (pulse) 3: dac3 (default) Module 3: pa_cb (audio): 4 devices 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) 1: dac1 (sysdefault) 2: dac2 (pulse) 3: dac3 (default) Module 4: jack (audio): 4 devices 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) 1: dac1 (sysdefault) 2: dac2 (pulse) 3: dac3 (default) Module 5: pmidi (midi): 0 devices Module 6: alsa (audio): 1 devices 0: hw:0,0 (ALC269VC A) Module 7: alsaseq (midi): 0 devices Module 8: devfile (midi): 0 devices #include "csound.h" #include <stdio.h> int main(int argc, char **argv) { CSOUND *csound; csoundInitialize(&argc, &argv, 0); csound = csoundCreate(NULL); char *name, *type; int n = 0; while(!csoundGetModule(csound, n++, &name, &type)) { if (strcmp(type, "midi") == 0) { csoundSetMIDIModule(csound,name); int i,ndevs = csoundMIDIDevList(csound,NULL,1); CS_MIDIDEVICE *devs = (CS_MIDIDEVICE *) malloc(ndevs*sizeof(CS_MIDIDEVICE)); csoundMIDIDevList(csound,devs,1); printf("Module %d: %s (%s): %i devices\n", n, name, type, ndevs); for(i=0; i < ndevs; i++) printf(" %d: %s (%s)\n", i, devs[i].device_id, devs[i].device_name); free(devs); } else if (strcmp(type, "audio") == 0) { csoundSetRTAudioModule(csound,name); int i,ndevs = csoundAudioDevList(csound,NULL,1); CS_AUDIODEVICE *devs = (CS_AUDIODEVICE *) malloc(ndevs*sizeof(CS_AUDIODEVICE)); csoundAudioDevList(csound,devs,1); printf("Module %d: %s (%s): %i devices\n", n, name, type, ndevs); for(i=0; i < ndevs; i++) printf(" %d: %s (%s)\n", i, devs[i].device_id, devs[i].device_name); free(devs); } } n = 0; while(!csoundGetModule(csound, n++, &name, &type)) { if (strcmp(type, "midi") == 0) { csoundSetMIDIModule(csound,name); int i,ndevs = csoundMIDIDevList(csound,NULL,1); CS_MIDIDEVICE *devs = (CS_MIDIDEVICE *) malloc(ndevs*sizeof(CS_MIDIDEVICE)); csoundMIDIDevList(csound,devs,0); printf("Module %d: %s (%s): %i devices\n", n, name, type, ndevs); for(i=0; i < ndevs; i++) printf(" %d: %s (%s)\n", i, devs[i].device_id, devs[i].device_name); free(devs); } else if (strcmp(type, "audio") == 0) { csoundSetRTAudioModule(csound,name); int i,ndevs = csoundAudioDevList(csound,NULL,0); CS_AUDIODEVICE *devs = (CS_AUDIODEVICE *) malloc(ndevs*sizeof(CS_AUDIODEVICE)); csoundAudioDevList(csound,devs,0); printf("Module %d: %s (%s): %i devices\n", n, name, type, ndevs); for(i=0; i < ndevs; i++) printf(" %d: %s (%s)\n", i, devs[i].device_id, devs[i].device_name); free(devs); } } csoundDestroy(csound); return 0; } |
Date | 2013-06-15 11:03 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] MIDI device listing |
Try setting the midi module before listing. It will not be set to the default on creation. On 15 Jun 2013, at 10:55, Andres Cabrera wrote: > Hi, > > It appears that MIDI device listing through the API is not working, I always get 0 devices. See attached code. > > There's also something wrong with the jack module report, it seems that the module might not be setting the device callback, and the previous one is reporting the devices. > > I'm in the process of adding this to the test suite, but have been having trouble committing... > > Cheers, > Andrés > > Module 1: pulse (audio): 0 devices > > Module 2: pa_bl (audio): 9 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (front) > > 3: dac3 (surround40) > > 4: dac4 (surround51) > > 5: dac5 (surround71) > > 6: dac6 (pulse) > > 7: dac7 (dmix) > > 8: dac8 (default) > > Module 3: pa_cb (audio): 9 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (front) > > 3: dac3 (surround40) > > 4: dac4 (surround51) > > 5: dac5 (surround71) > > 6: dac6 (pulse) > > 7: dac7 (dmix) > > 8: dac8 (default) > > Module 4: jack (audio): 9 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (front) > > 3: dac3 (surround40) > > 4: dac4 (surround51) > > 5: dac5 (surround71) > > 6: dac6 (pulse) > > 7: dac7 (dmix) > > 8: dac8 (default) > > Module 5: pmidi (midi): 0 devices > > Module 6: alsa (audio): 1 devices > > 0: hw:0,0 (ALC269VC A) > > Module 7: alsaseq (midi): 0 devices > > Module 8: devfile (midi): 0 devices > > > > Module 1: pulse (audio): 1 devices > > 0: hw:0,0 (ALC269VC A) > > Module 2: pa_bl (audio): 4 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (pulse) > > 3: dac3 (default) > > Module 3: pa_cb (audio): 4 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (pulse) > > 3: dac3 (default) > > Module 4: jack (audio): 4 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (pulse) > > 3: dac3 (default) > > Module 5: pmidi (midi): 0 devices > > Module 6: alsa (audio): 1 devices > > 0: hw:0,0 (ALC269VC A) > > Module 7: alsaseq (midi): 0 devices > > Module 8: devfile (midi): 0 devices > > > #include "csound.h" > #include |
Date | 2013-06-15 11:11 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] MIDI device listing |
This shows how it is supposed to work: int main(int argc, char **argv){ CSOUND *cs = csoundCreate(NULL); csoundSetOption(cs, "-odac"); csoundSetRTAudioModule(cs, "portaudio"); csoundSetMIDIModule(cs, "portmidi"); int i,n = csoundAudioDevList(cs,NULL,1); CS_AUDIODEVICE *devs = (CS_AUDIODEVICE *) malloc(n*sizeof(CS_AUDIODEVICE)); csoundAudioDevList(cs,devs,1); csoundMessage(cs, "--------\n Audio devs \n"); for(i=0; i < n; i++) csoundMessage(cs, " %d: %s (%s)\n", i, devs[i].device_id, devs[i].device_name); n = csoundMIDIDevList(cs,NULL,1); CS_MIDIDEVICE *mdevs = (CS_MIDIDEVICE *) malloc(n*sizeof(CS_MIDIDEVICE)); csoundMessage(cs, "--------\n MIDI devs \n"); csoundMIDIDevList(cs,mdevs,1); for(i=0; i < n; i++) csoundMessage(cs, " %d: %s (%s)\n", i, mdevs[i].device_id, mdevs[i].device_name); csoundReset(cs); csoundDestroy(cs); return 0; } On 15 Jun 2013, at 11:03, Victor Lazzarini wrote: > Try setting the midi module before listing. It will not be set to the default on creation. > > On 15 Jun 2013, at 10:55, Andres Cabrera wrote: > >> Hi, >> >> It appears that MIDI device listing through the API is not working, I always get 0 devices. See attached code. >> >> There's also something wrong with the jack module report, it seems that the module might not be setting the device callback, and the previous one is reporting the devices. >> >> I'm in the process of adding this to the test suite, but have been having trouble committing... >> >> Cheers, >> Andrés >> >> Module 1: pulse (audio): 0 devices >> >> Module 2: pa_bl (audio): 9 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (front) >> >> 3: dac3 (surround40) >> >> 4: dac4 (surround51) >> >> 5: dac5 (surround71) >> >> 6: dac6 (pulse) >> >> 7: dac7 (dmix) >> >> 8: dac8 (default) >> >> Module 3: pa_cb (audio): 9 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (front) >> >> 3: dac3 (surround40) >> >> 4: dac4 (surround51) >> >> 5: dac5 (surround71) >> >> 6: dac6 (pulse) >> >> 7: dac7 (dmix) >> >> 8: dac8 (default) >> >> Module 4: jack (audio): 9 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (front) >> >> 3: dac3 (surround40) >> >> 4: dac4 (surround51) >> >> 5: dac5 (surround71) >> >> 6: dac6 (pulse) >> >> 7: dac7 (dmix) >> >> 8: dac8 (default) >> >> Module 5: pmidi (midi): 0 devices >> >> Module 6: alsa (audio): 1 devices >> >> 0: hw:0,0 (ALC269VC A) >> >> Module 7: alsaseq (midi): 0 devices >> >> Module 8: devfile (midi): 0 devices >> >> >> >> Module 1: pulse (audio): 1 devices >> >> 0: hw:0,0 (ALC269VC A) >> >> Module 2: pa_bl (audio): 4 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (pulse) >> >> 3: dac3 (default) >> >> Module 3: pa_cb (audio): 4 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (pulse) >> >> 3: dac3 (default) >> >> Module 4: jack (audio): 4 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (pulse) >> >> 3: dac3 (default) >> >> Module 5: pmidi (midi): 0 devices >> >> Module 6: alsa (audio): 1 devices >> >> 0: hw:0,0 (ALC269VC A) >> >> Module 7: alsaseq (midi): 0 devices >> >> Module 8: devfile (midi): 0 devices >> >> >> #include "csound.h" >> #include |
Date | 2013-06-15 11:19 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] MIDI device listing |
Ah, I see: I think the alsa MIDI module listing is not implemented. Can you do it? I don't have the means to do it. Same for Jack, the callback is not being set, so the previous one is used. I am adding a dummy for the moment. Victor On 15 Jun 2013, at 10:55, Andres Cabrera wrote: > Hi, > > It appears that MIDI device listing through the API is not working, I always get 0 devices. See attached code. > > There's also something wrong with the jack module report, it seems that the module might not be setting the device callback, and the previous one is reporting the devices. > > I'm in the process of adding this to the test suite, but have been having trouble committing... > > Cheers, > Andrés > > Module 1: pulse (audio): 0 devices > > Module 2: pa_bl (audio): 9 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (front) > > 3: dac3 (surround40) > > 4: dac4 (surround51) > > 5: dac5 (surround71) > > 6: dac6 (pulse) > > 7: dac7 (dmix) > > 8: dac8 (default) > > Module 3: pa_cb (audio): 9 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (front) > > 3: dac3 (surround40) > > 4: dac4 (surround51) > > 5: dac5 (surround71) > > 6: dac6 (pulse) > > 7: dac7 (dmix) > > 8: dac8 (default) > > Module 4: jack (audio): 9 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (front) > > 3: dac3 (surround40) > > 4: dac4 (surround51) > > 5: dac5 (surround71) > > 6: dac6 (pulse) > > 7: dac7 (dmix) > > 8: dac8 (default) > > Module 5: pmidi (midi): 0 devices > > Module 6: alsa (audio): 1 devices > > 0: hw:0,0 (ALC269VC A) > > Module 7: alsaseq (midi): 0 devices > > Module 8: devfile (midi): 0 devices > > > > Module 1: pulse (audio): 1 devices > > 0: hw:0,0 (ALC269VC A) > > Module 2: pa_bl (audio): 4 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (pulse) > > 3: dac3 (default) > > Module 3: pa_cb (audio): 4 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (pulse) > > 3: dac3 (default) > > Module 4: jack (audio): 4 devices > > 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) > > 1: dac1 (sysdefault) > > 2: dac2 (pulse) > > 3: dac3 (default) > > Module 5: pmidi (midi): 0 devices > > Module 6: alsa (audio): 1 devices > > 0: hw:0,0 (ALC269VC A) > > Module 7: alsaseq (midi): 0 devices > > Module 8: devfile (midi): 0 devices > > > #include "csound.h" > #include |
Date | 2013-06-15 18:28 |
From | Victor Lazzarini |
Subject | [Cs-dev] jack dev listingRe: MIDI device listing |
I have added the callback for jack dev listing. On 15 Jun 2013, at 11:19, Victor Lazzarini wrote: > Ah, I see: I think the alsa MIDI module listing is not implemented. Can you do it? I don't have the means to do it. > > Same for Jack, the callback is not being set, so the previous one is used. I am adding a dummy for the moment. > > Victor > On 15 Jun 2013, at 10:55, Andres Cabrera wrote: > >> Hi, >> >> It appears that MIDI device listing through the API is not working, I always get 0 devices. See attached code. >> >> There's also something wrong with the jack module report, it seems that the module might not be setting the device callback, and the previous one is reporting the devices. >> >> I'm in the process of adding this to the test suite, but have been having trouble committing... >> >> Cheers, >> Andrés >> >> Module 1: pulse (audio): 0 devices >> >> Module 2: pa_bl (audio): 9 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (front) >> >> 3: dac3 (surround40) >> >> 4: dac4 (surround51) >> >> 5: dac5 (surround71) >> >> 6: dac6 (pulse) >> >> 7: dac7 (dmix) >> >> 8: dac8 (default) >> >> Module 3: pa_cb (audio): 9 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (front) >> >> 3: dac3 (surround40) >> >> 4: dac4 (surround51) >> >> 5: dac5 (surround71) >> >> 6: dac6 (pulse) >> >> 7: dac7 (dmix) >> >> 8: dac8 (default) >> >> Module 4: jack (audio): 9 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (front) >> >> 3: dac3 (surround40) >> >> 4: dac4 (surround51) >> >> 5: dac5 (surround71) >> >> 6: dac6 (pulse) >> >> 7: dac7 (dmix) >> >> 8: dac8 (default) >> >> Module 5: pmidi (midi): 0 devices >> >> Module 6: alsa (audio): 1 devices >> >> 0: hw:0,0 (ALC269VC A) >> >> Module 7: alsaseq (midi): 0 devices >> >> Module 8: devfile (midi): 0 devices >> >> >> >> Module 1: pulse (audio): 1 devices >> >> 0: hw:0,0 (ALC269VC A) >> >> Module 2: pa_bl (audio): 4 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (pulse) >> >> 3: dac3 (default) >> >> Module 3: pa_cb (audio): 4 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (pulse) >> >> 3: dac3 (default) >> >> Module 4: jack (audio): 4 devices >> >> 0: dac0 (HDA Intel PCH: ALC269VC Analog (hw:0,0)) >> >> 1: dac1 (sysdefault) >> >> 2: dac2 (pulse) >> >> 3: dac3 (default) >> >> Module 5: pmidi (midi): 0 devices >> >> Module 6: alsa (audio): 1 devices >> >> 0: hw:0,0 (ALC269VC A) >> >> Module 7: alsaseq (midi): 0 devices >> >> Module 8: devfile (midi): 0 devices >> >> >> #include "csound.h" >> #include |
Date | 2013-06-15 19:10 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] jack dev listingRe: MIDI device listing |
Attachments | None None |
Great! Thanks for the speedy resolution. Cheers, Andrés On Sun, Jun 16, 2013 at 3:28 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: I have added the callback for jack dev listing. |
Date | 2013-06-21 02:06 |
From | Andres Cabrera |
Subject | Re: [Cs-dev] MIDI device listing |
Attachments | None None |
Thanks, I think a dummy with a warning is better for now. I'm working on getting CsoundQt stable for Csound6, but I'll try have a look at alsa and jack later. There seems to be the same issue with pulse audio. Can you add the listing there?Cheers, Andrés On Sat, Jun 15, 2013 at 12:19 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote: Ah, I see: I think the alsa MIDI module listing is not implemented. Can you do it? I don't have the means to do it. |