Changeset 470 for GPL/trunk/alsa-kernel


Ignore:
Timestamp:
Nov 6, 2009, 11:24:20 PM (16 years ago)
Author:
vladest
Message:

Fixed Uniaud API support. Please, take in account this diffs when making updates from ALSA tree for following files: pcm.c and pcm_lib.c

Location:
GPL/trunk/alsa-kernel/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GPL/trunk/alsa-kernel/core/pcm.c

    r426 r470  
    156156                {
    157157                        int val;
    158                        
     158
    159159                        if (get_user(val, (int __user *)arg))
    160160                                return -EFAULT;
     
    177177#define START(v) [SNDRV_PCM_START_##v] = #v
    178178#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
    180180
    181181static char *snd_pcm_format_names[] = {
     
    242242
    243243static char *snd_pcm_access_names[] = {
    244         ACCESS(MMAP_INTERLEAVED), 
     244        ACCESS(MMAP_INTERLEAVED),
    245245        ACCESS(MMAP_NONINTERLEAVED),
    246246        ACCESS(MMAP_COMPLEX),
     
    250250
    251251static char *snd_pcm_subformat_names[] = {
    252         SUBFORMAT(STD), 
     252        SUBFORMAT(STD),
    253253};
    254254
     
    380380        snd_iprintf(buffer, "format: %s\n", snd_pcm_format_name(runtime->format));
    381381        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);
    386386#if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE)
    387387        if (substream->oss.oss) {
    388388                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);
    390390                snd_iprintf(buffer, "OSS rate: %u\n", runtime->oss.rate);
    391391                snd_iprintf(buffer, "OSS period bytes: %lu\n", (unsigned long)runtime->oss.period_bytes);
     
    473473        char name[16];
    474474
    475         sprintf(name, "pcm%i%c", pcm->device, 
     475        sprintf(name, "pcm%i%c", pcm->device,
    476476                pstr->stream == SNDRV_PCM_STREAM_PLAYBACK ? 'p' : 'c');
    477477        if ((entry = snd_info_create_card_entry(pcm->card, name, pcm->card->proc_root)) == NULL)
     
    675675        }
    676676        return 0;
    677 }                               
     677}
    678678
    679679EXPORT_SYMBOL(snd_pcm_new_stream);
     
    11321132void pcm_info(void)
    11331133{
    1134         int idx;
    1135         struct snd_pcm *pcm;
    1136 
    1137         down(&register_mutex);
    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(&register_mutex);
    1151 }
     1134    int idx = 0;
     1135    struct snd_pcm *pcm;
     1136
     1137    down(&register_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(&register_mutex);
     1150}
     1151
    11521152/* get number of pcm instance s for given card */
    11531153int pcm_instances(int card_id)
    11541154{
    1155         int idx;
    1156         int pcms = 0;
    1157         struct snd_pcm *pcm;
    1158 
    1159         down(&register_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(&register_mutex);
    1167         return pcms;
     1155    int idx;
     1156    int pcms = 0;
     1157    struct snd_pcm *pcm;
     1158
     1159    down(&register_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(&register_mutex);
     1165    return pcms;
    11681166}
    11691167
  • GPL/trunk/alsa-kernel/core/pcm_lib.c

    r464 r470  
    3030#include <sound/pcm_params.h>
    3131#include <sound/timer.h>
     32
     33/*
     34 * Uniaud API support
     35 */
     36int uniaud_set_interrupted_substream(struct snd_pcm_substream *substream);
    3237
    3338/*
     
    16501655                goto _end;
    16511656
     1657        uniaud_set_interrupted_substream(substream);
     1658
    16521659        if (substream->timer_running)
    16531660                snd_timer_interrupt(substream->timer, 1);
Note: See TracChangeset for help on using the changeset viewer.