Changeset 470 for GPL/trunk/alsa-kernel
- Timestamp:
- Nov 6, 2009, 11:24:20 PM (16 years ago)
- Location:
- GPL/trunk/alsa-kernel/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk/alsa-kernel/core/pcm.c
r426 r470 156 156 { 157 157 int val; 158 158 159 159 if (get_user(val, (int __user *)arg)) 160 160 return -EFAULT; … … 177 177 #define START(v) [SNDRV_PCM_START_##v] = #v 178 178 #define FORMAT(v) [SNDRV_PCM_FORMAT_##v] = #v 179 #define SUBFORMAT(v) [SNDRV_PCM_SUBFORMAT_##v] = #v 179 #define SUBFORMAT(v) [SNDRV_PCM_SUBFORMAT_##v] = #v 180 180 181 181 static char *snd_pcm_format_names[] = { … … 242 242 243 243 static char *snd_pcm_access_names[] = { 244 ACCESS(MMAP_INTERLEAVED), 244 ACCESS(MMAP_INTERLEAVED), 245 245 ACCESS(MMAP_NONINTERLEAVED), 246 246 ACCESS(MMAP_COMPLEX), … … 250 250 251 251 static char *snd_pcm_subformat_names[] = { 252 SUBFORMAT(STD), 252 SUBFORMAT(STD), 253 253 }; 254 254 … … 380 380 snd_iprintf(buffer, "format: %s\n", snd_pcm_format_name(runtime->format)); 381 381 snd_iprintf(buffer, "subformat: %s\n", snd_pcm_subformat_name(runtime->subformat)); 382 snd_iprintf(buffer, "channels: %u\n", runtime->channels); 383 snd_iprintf(buffer, "rate: %u (%u/%u)\n", runtime->rate, runtime->rate_num, runtime->rate_den); 384 snd_iprintf(buffer, "period_size: %lu\n", runtime->period_size); 385 snd_iprintf(buffer, "buffer_size: %lu\n", runtime->buffer_size); 382 snd_iprintf(buffer, "channels: %u\n", runtime->channels); 383 snd_iprintf(buffer, "rate: %u (%u/%u)\n", runtime->rate, runtime->rate_num, runtime->rate_den); 384 snd_iprintf(buffer, "period_size: %lu\n", runtime->period_size); 385 snd_iprintf(buffer, "buffer_size: %lu\n", runtime->buffer_size); 386 386 #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) 387 387 if (substream->oss.oss) { 388 388 snd_iprintf(buffer, "OSS format: %s\n", snd_pcm_oss_format_name(runtime->oss.format)); 389 snd_iprintf(buffer, "OSS channels: %u\n", runtime->oss.channels); 389 snd_iprintf(buffer, "OSS channels: %u\n", runtime->oss.channels); 390 390 snd_iprintf(buffer, "OSS rate: %u\n", runtime->oss.rate); 391 391 snd_iprintf(buffer, "OSS period bytes: %lu\n", (unsigned long)runtime->oss.period_bytes); … … 473 473 char name[16]; 474 474 475 sprintf(name, "pcm%i%c", pcm->device, 475 sprintf(name, "pcm%i%c", pcm->device, 476 476 pstr->stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c'); 477 477 if ((entry = snd_info_create_card_entry(pcm->card, name, pcm->card->proc_root)) == NULL) … … 675 675 } 676 676 return 0; 677 } 677 } 678 678 679 679 EXPORT_SYMBOL(snd_pcm_new_stream); … … 1132 1132 void pcm_info(void) 1133 1133 { 1134 int idx;1135 1136 1137 1138 for (idx = 0; idx < SNDRV_CARDS * SNDRV_PCM_DEVICES; idx++) { 1139 pcm = snd_pcm_devices_os2[idx]; 1140 if (pcm == NULL) 1141 continue;1142 printk("%02i-%02i: %s : %s", idx / SNDRV_PCM_DEVICES, 1143 idx % SNDRV_PCM_DEVICES, pcm->id, pcm->name);1144 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream)1145 printk(" : playback %i", pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count);1146 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) 1147 printk(" : capture %i", pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count);1148 printk("\n"); 1149 } 1150 up(®ister_mutex); 1151 } 1134 int idx = 0; 1135 struct snd_pcm *pcm; 1136 1137 down(®ister_mutex); 1138 list_for_each_entry(pcm, &snd_pcm_devices, list, struct snd_pcm) 1139 { 1140 printk("%02i-%02i: %s : %s", pcm->card->number, pcm->device, 1141 pcm->id, pcm->name); 1142 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) 1143 printk(" : playback %i", pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count); 1144 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) 1145 printk(" : capture %i", pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count); 1146 printk("\n"); 1147 idx++; 1148 } 1149 up(®ister_mutex); 1150 } 1151 1152 1152 /* get number of pcm instance s for given card */ 1153 1153 int pcm_instances(int card_id) 1154 1154 { 1155 int idx; 1156 int pcms = 0; 1157 struct snd_pcm *pcm; 1158 1159 down(®ister_mutex); 1160 for (idx = 0; idx < SNDRV_PCM_DEVICES; idx++) { 1161 pcm = snd_pcm_devices_os2[(card_id*SNDRV_PCM_DEVICES)+idx]; 1162 if (pcm == NULL) 1163 continue; 1164 pcms++; 1165 } 1166 up(®ister_mutex); 1167 return pcms; 1155 int idx; 1156 int pcms = 0; 1157 struct snd_pcm *pcm; 1158 1159 down(®ister_mutex); 1160 list_for_each_entry(pcm, &snd_pcm_devices, list, struct snd_pcm) { 1161 if (pcm->card->number == card_id) 1162 pcms++; 1163 } 1164 up(®ister_mutex); 1165 return pcms; 1168 1166 } 1169 1167 -
GPL/trunk/alsa-kernel/core/pcm_lib.c
r464 r470 30 30 #include <sound/pcm_params.h> 31 31 #include <sound/timer.h> 32 33 /* 34 * Uniaud API support 35 */ 36 int uniaud_set_interrupted_substream(struct snd_pcm_substream *substream); 32 37 33 38 /* … … 1650 1655 goto _end; 1651 1656 1657 uniaud_set_interrupted_substream(substream); 1658 1652 1659 if (substream->timer_running) 1653 1660 snd_timer_interrupt(substream->timer, 1);
Note:
See TracChangeset
for help on using the changeset viewer.