Lines Matching refs:vss
85 * @vss: VirtIO substream.
91 static int virtsnd_pcm_build_hw(struct virtio_pcm_substream *vss,
94 struct virtio_device *vdev = vss->snd->vdev;
100 vss->features = le32_to_cpu(info->features);
106 vss->hw.info =
117 vss->sid, info->channels_min, info->channels_max);
121 vss->hw.channels_min = info->channels_min;
122 vss->hw.channels_max = info->channels_max;
126 vss->hw.formats = 0;
139 vss->hw.formats |= pcm_format_to_bits(alsa_fmt);
142 if (!vss->hw.formats) {
145 vss->sid);
151 vss->hw.rates = 0;
155 if (!vss->hw.rate_min ||
156 vss->hw.rate_min > g_v2a_rate_map[i].rate)
157 vss->hw.rate_min = g_v2a_rate_map[i].rate;
159 if (vss->hw.rate_max < g_v2a_rate_map[i].rate)
160 vss->hw.rate_max = g_v2a_rate_map[i].rate;
162 vss->hw.rates |= g_v2a_rate_map[i].alsa_bit;
165 if (!vss->hw.rates) {
168 vss->sid);
172 vss->hw.periods_min = pcm_periods_min;
173 vss->hw.periods_max = pcm_periods_max;
182 vss->hw.buffer_bytes_max =
183 PAGE_ALIGN(sample_max * vss->hw.channels_max * pcm_buffer_ms *
184 (vss->hw.rate_max / MSEC_PER_SEC));
193 vss->hw.period_bytes_min =
194 sample_min * vss->hw.channels_min * pcm_period_ms_min *
195 (vss->hw.rate_min / MSEC_PER_SEC);
201 vss->hw.period_bytes_max =
202 sample_max * vss->hw.channels_max * pcm_period_ms_max *
203 (vss->hw.rate_max / MSEC_PER_SEC);
308 struct virtio_pcm_substream *vss =
311 snd_pcm_period_elapsed(vss->substream);
350 struct virtio_pcm_substream *vss = &snd->substreams[i];
353 vss->snd = snd;
354 vss->sid = i;
355 INIT_WORK(&vss->elapsed_period, virtsnd_pcm_period_elapsed);
356 init_waitqueue_head(&vss->msg_empty);
357 spin_lock_init(&vss->lock);
359 rc = virtsnd_pcm_build_hw(vss, &info[i]);
363 vss->nid = le32_to_cpu(info[i].hdr.hda_fn_nid);
365 vpcm = virtsnd_pcm_find_or_create(snd, vss->nid);
373 vss->direction = SNDRV_PCM_STREAM_PLAYBACK;
376 vss->direction = SNDRV_PCM_STREAM_CAPTURE;
380 vss->sid, info[i].direction);
385 vpcm->streams[vss->direction].nsubstreams++;
452 struct virtio_pcm_substream *vss = &snd->substreams[i];
454 vpcm = virtsnd_pcm_find(snd, vss->nid);
458 vs = &vpcm->streams[vss->direction];
459 vs->substreams[vs->nsubstreams++] = vss;
494 struct virtio_pcm_substream *vss;
500 vss = &snd->substreams[sid];
507 spin_lock(&vss->lock);
508 if (vss->xfer_enabled)
509 vss->xfer_xrun = true;
510 spin_unlock(&vss->lock);