Lines Matching refs:vss

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