aboutsummaryrefslogtreecommitdiffstats
path: root/sound/synth
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-03-23 19:35:50 -0400
committerTakashi Iwai <tiwai@suse.de>2009-03-23 19:35:50 -0400
commite0d2054fd3cf167395390dc1758644486c782707 (patch)
tree108fd3138f0246f5fa17454680d6d04a670ed6d8 /sound/synth
parentd807500a2472445d05ce641bf09438e3d72eeb4f (diff)
parentc468ac29e63b9927275a94379d00b367f0f97c43 (diff)
Merge branch 'topic/misc' into for-linus
Diffstat (limited to 'sound/synth')
-rw-r--r--sound/synth/emux/emux_oss.c2
-rw-r--r--sound/synth/emux/emux_seq.c16
-rw-r--r--sound/synth/emux/emux_synth.c6
-rw-r--r--sound/synth/emux/soundfont.c28
4 files changed, 30 insertions, 22 deletions
diff --git a/sound/synth/emux/emux_oss.c b/sound/synth/emux/emux_oss.c
index 5c47b6c09264..87e42206c4ef 100644
--- a/sound/synth/emux/emux_oss.c
+++ b/sound/synth/emux/emux_oss.c
@@ -132,7 +132,7 @@ snd_emux_open_seq_oss(struct snd_seq_oss_arg *arg, void *closure)
132 p = snd_emux_create_port(emu, tmpname, 32, 132 p = snd_emux_create_port(emu, tmpname, 32,
133 1, &callback); 133 1, &callback);
134 if (p == NULL) { 134 if (p == NULL) {
135 snd_printk("can't create port\n"); 135 snd_printk(KERN_ERR "can't create port\n");
136 snd_emux_dec_count(emu); 136 snd_emux_dec_count(emu);
137 mutex_unlock(&emu->register_mutex); 137 mutex_unlock(&emu->register_mutex);
138 return -ENOMEM; 138 return -ENOMEM;
diff --git a/sound/synth/emux/emux_seq.c b/sound/synth/emux/emux_seq.c
index 335aa2ce2574..ca5f7effb4df 100644
--- a/sound/synth/emux/emux_seq.c
+++ b/sound/synth/emux/emux_seq.c
@@ -74,15 +74,15 @@ snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index)
74 emu->client = snd_seq_create_kernel_client(card, index, 74 emu->client = snd_seq_create_kernel_client(card, index,
75 "%s WaveTable", emu->name); 75 "%s WaveTable", emu->name);
76 if (emu->client < 0) { 76 if (emu->client < 0) {
77 snd_printk("can't create client\n"); 77 snd_printk(KERN_ERR "can't create client\n");
78 return -ENODEV; 78 return -ENODEV;
79 } 79 }
80 80
81 if (emu->num_ports < 0) { 81 if (emu->num_ports < 0) {
82 snd_printk("seqports must be greater than zero\n"); 82 snd_printk(KERN_WARNING "seqports must be greater than zero\n");
83 emu->num_ports = 1; 83 emu->num_ports = 1;
84 } else if (emu->num_ports >= SNDRV_EMUX_MAX_PORTS) { 84 } else if (emu->num_ports >= SNDRV_EMUX_MAX_PORTS) {
85 snd_printk("too many ports." 85 snd_printk(KERN_WARNING "too many ports."
86 "limited max. ports %d\n", SNDRV_EMUX_MAX_PORTS); 86 "limited max. ports %d\n", SNDRV_EMUX_MAX_PORTS);
87 emu->num_ports = SNDRV_EMUX_MAX_PORTS; 87 emu->num_ports = SNDRV_EMUX_MAX_PORTS;
88 } 88 }
@@ -100,7 +100,7 @@ snd_emux_init_seq(struct snd_emux *emu, struct snd_card *card, int index)
100 p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS, 100 p = snd_emux_create_port(emu, tmpname, MIDI_CHANNELS,
101 0, &pinfo); 101 0, &pinfo);
102 if (p == NULL) { 102 if (p == NULL) {
103 snd_printk("can't create port\n"); 103 snd_printk(KERN_ERR "can't create port\n");
104 return -ENOMEM; 104 return -ENOMEM;
105 } 105 }
106 106
@@ -147,12 +147,12 @@ snd_emux_create_port(struct snd_emux *emu, char *name,
147 147
148 /* Allocate structures for this channel */ 148 /* Allocate structures for this channel */
149 if ((p = kzalloc(sizeof(*p), GFP_KERNEL)) == NULL) { 149 if ((p = kzalloc(sizeof(*p), GFP_KERNEL)) == NULL) {
150 snd_printk("no memory\n"); 150 snd_printk(KERN_ERR "no memory\n");
151 return NULL; 151 return NULL;
152 } 152 }
153 p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL); 153 p->chset.channels = kcalloc(max_channels, sizeof(struct snd_midi_channel), GFP_KERNEL);
154 if (p->chset.channels == NULL) { 154 if (p->chset.channels == NULL) {
155 snd_printk("no memory\n"); 155 snd_printk(KERN_ERR "no memory\n");
156 kfree(p); 156 kfree(p);
157 return NULL; 157 return NULL;
158 } 158 }
@@ -376,12 +376,12 @@ int snd_emux_init_virmidi(struct snd_emux *emu, struct snd_card *card)
376 goto __error; 376 goto __error;
377 } 377 }
378 emu->vmidi[i] = rmidi; 378 emu->vmidi[i] = rmidi;
379 //snd_printk("virmidi %d ok\n", i); 379 /* snd_printk(KERN_DEBUG "virmidi %d ok\n", i); */
380 } 380 }
381 return 0; 381 return 0;
382 382
383__error: 383__error:
384 //snd_printk("error init..\n"); 384 /* snd_printk(KERN_DEBUG "error init..\n"); */
385 snd_emux_delete_virmidi(emu); 385 snd_emux_delete_virmidi(emu);
386 return -ENOMEM; 386 return -ENOMEM;
387} 387}
diff --git a/sound/synth/emux/emux_synth.c b/sound/synth/emux/emux_synth.c
index 2cc6f6f79065..3e921b386fd5 100644
--- a/sound/synth/emux/emux_synth.c
+++ b/sound/synth/emux/emux_synth.c
@@ -956,7 +956,8 @@ void snd_emux_lock_voice(struct snd_emux *emu, int voice)
956 if (emu->voices[voice].state == SNDRV_EMUX_ST_OFF) 956 if (emu->voices[voice].state == SNDRV_EMUX_ST_OFF)
957 emu->voices[voice].state = SNDRV_EMUX_ST_LOCKED; 957 emu->voices[voice].state = SNDRV_EMUX_ST_LOCKED;
958 else 958 else
959 snd_printk("invalid voice for lock %d (state = %x)\n", 959 snd_printk(KERN_WARNING
960 "invalid voice for lock %d (state = %x)\n",
960 voice, emu->voices[voice].state); 961 voice, emu->voices[voice].state);
961 spin_unlock_irqrestore(&emu->voice_lock, flags); 962 spin_unlock_irqrestore(&emu->voice_lock, flags);
962} 963}
@@ -973,7 +974,8 @@ void snd_emux_unlock_voice(struct snd_emux *emu, int voice)
973 if (emu->voices[voice].state == SNDRV_EMUX_ST_LOCKED) 974 if (emu->voices[voice].state == SNDRV_EMUX_ST_LOCKED)
974 emu->voices[voice].state = SNDRV_EMUX_ST_OFF; 975 emu->voices[voice].state = SNDRV_EMUX_ST_OFF;
975 else 976 else
976 snd_printk("invalid voice for unlock %d (state = %x)\n", 977 snd_printk(KERN_WARNING
978 "invalid voice for unlock %d (state = %x)\n",
977 voice, emu->voices[voice].state); 979 voice, emu->voices[voice].state);
978 spin_unlock_irqrestore(&emu->voice_lock, flags); 980 spin_unlock_irqrestore(&emu->voice_lock, flags);
979} 981}
diff --git a/sound/synth/emux/soundfont.c b/sound/synth/emux/soundfont.c
index 36d53bd317ed..63c8f45c0c22 100644
--- a/sound/synth/emux/soundfont.c
+++ b/sound/synth/emux/soundfont.c
@@ -133,7 +133,7 @@ snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
133 int rc; 133 int rc;
134 134
135 if (count < (long)sizeof(patch)) { 135 if (count < (long)sizeof(patch)) {
136 snd_printk("patch record too small %ld\n", count); 136 snd_printk(KERN_ERR "patch record too small %ld\n", count);
137 return -EINVAL; 137 return -EINVAL;
138 } 138 }
139 if (copy_from_user(&patch, data, sizeof(patch))) 139 if (copy_from_user(&patch, data, sizeof(patch)))
@@ -143,15 +143,16 @@ snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
143 data += sizeof(patch); 143 data += sizeof(patch);
144 144
145 if (patch.key != SNDRV_OSS_SOUNDFONT_PATCH) { 145 if (patch.key != SNDRV_OSS_SOUNDFONT_PATCH) {
146 snd_printk("'The wrong kind of patch' %x\n", patch.key); 146 snd_printk(KERN_ERR "The wrong kind of patch %x\n", patch.key);
147 return -EINVAL; 147 return -EINVAL;
148 } 148 }
149 if (count < patch.len) { 149 if (count < patch.len) {
150 snd_printk("Patch too short %ld, need %d\n", count, patch.len); 150 snd_printk(KERN_ERR "Patch too short %ld, need %d\n",
151 count, patch.len);
151 return -EINVAL; 152 return -EINVAL;
152 } 153 }
153 if (patch.len < 0) { 154 if (patch.len < 0) {
154 snd_printk("poor length %d\n", patch.len); 155 snd_printk(KERN_ERR "poor length %d\n", patch.len);
155 return -EINVAL; 156 return -EINVAL;
156 } 157 }
157 158
@@ -195,7 +196,8 @@ snd_soundfont_load(struct snd_sf_list *sflist, const void __user *data,
195 case SNDRV_SFNT_REMOVE_INFO: 196 case SNDRV_SFNT_REMOVE_INFO:
196 /* patch must be opened */ 197 /* patch must be opened */
197 if (!sflist->currsf) { 198 if (!sflist->currsf) {
198 snd_printk("soundfont: remove_info: patch not opened\n"); 199 snd_printk(KERN_ERR "soundfont: remove_info: "
200 "patch not opened\n");
199 rc = -EINVAL; 201 rc = -EINVAL;
200 } else { 202 } else {
201 int bank, instr; 203 int bank, instr;
@@ -531,7 +533,7 @@ load_info(struct snd_sf_list *sflist, const void __user *data, long count)
531 return -EINVAL; 533 return -EINVAL;
532 534
533 if (count < (long)sizeof(hdr)) { 535 if (count < (long)sizeof(hdr)) {
534 printk("Soundfont error: invalid patch zone length\n"); 536 printk(KERN_ERR "Soundfont error: invalid patch zone length\n");
535 return -EINVAL; 537 return -EINVAL;
536 } 538 }
537 if (copy_from_user((char*)&hdr, data, sizeof(hdr))) 539 if (copy_from_user((char*)&hdr, data, sizeof(hdr)))
@@ -541,12 +543,14 @@ load_info(struct snd_sf_list *sflist, const void __user *data, long count)
541 count -= sizeof(hdr); 543 count -= sizeof(hdr);
542 544
543 if (hdr.nvoices <= 0 || hdr.nvoices >= 100) { 545 if (hdr.nvoices <= 0 || hdr.nvoices >= 100) {
544 printk("Soundfont error: Illegal voice number %d\n", hdr.nvoices); 546 printk(KERN_ERR "Soundfont error: Illegal voice number %d\n",
547 hdr.nvoices);
545 return -EINVAL; 548 return -EINVAL;
546 } 549 }
547 550
548 if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) { 551 if (count < (long)sizeof(struct soundfont_voice_info) * hdr.nvoices) {
549 printk("Soundfont Error: patch length(%ld) is smaller than nvoices(%d)\n", 552 printk(KERN_ERR "Soundfont Error: "
553 "patch length(%ld) is smaller than nvoices(%d)\n",
550 count, hdr.nvoices); 554 count, hdr.nvoices);
551 return -EINVAL; 555 return -EINVAL;
552 } 556 }
@@ -952,7 +956,7 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
952 int rc; 956 int rc;
953 957
954 if (count < (long)sizeof(patch)) { 958 if (count < (long)sizeof(patch)) {
955 snd_printk("patch record too small %ld\n", count); 959 snd_printk(KERN_ERR "patch record too small %ld\n", count);
956 return -EINVAL; 960 return -EINVAL;
957 } 961 }
958 if (copy_from_user(&patch, data, sizeof(patch))) 962 if (copy_from_user(&patch, data, sizeof(patch)))
@@ -1034,7 +1038,8 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
1034 /* panning position; -128 - 127 => 0-127 */ 1038 /* panning position; -128 - 127 => 0-127 */
1035 zone->v.pan = (patch.panning + 128) / 2; 1039 zone->v.pan = (patch.panning + 128) / 2;
1036#if 0 1040#if 0
1037 snd_printk("gus: basefrq=%d (ofs=%d) root=%d,tune=%d, range:%d-%d\n", 1041 snd_printk(KERN_DEBUG
1042 "gus: basefrq=%d (ofs=%d) root=%d,tune=%d, range:%d-%d\n",
1038 (int)patch.base_freq, zone->v.rate_offset, 1043 (int)patch.base_freq, zone->v.rate_offset,
1039 zone->v.root, zone->v.tune, zone->v.low, zone->v.high); 1044 zone->v.root, zone->v.tune, zone->v.low, zone->v.high);
1040#endif 1045#endif
@@ -1068,7 +1073,8 @@ load_guspatch(struct snd_sf_list *sflist, const char __user *data,
1068 zone->v.parm.volrelease = 0x8000 | snd_sf_calc_parm_decay(release); 1073 zone->v.parm.volrelease = 0x8000 | snd_sf_calc_parm_decay(release);
1069 zone->v.attenuation = calc_gus_attenuation(patch.env_offset[0]); 1074 zone->v.attenuation = calc_gus_attenuation(patch.env_offset[0]);
1070#if 0 1075#if 0
1071 snd_printk("gus: atkhld=%x, dcysus=%x, volrel=%x, att=%d\n", 1076 snd_printk(KERN_DEBUG
1077 "gus: atkhld=%x, dcysus=%x, volrel=%x, att=%d\n",
1072 zone->v.parm.volatkhld, 1078 zone->v.parm.volatkhld,
1073 zone->v.parm.voldcysus, 1079 zone->v.parm.voldcysus,
1074 zone->v.parm.volrelease, 1080 zone->v.parm.volrelease,