Date: Sat, 16 Jul 2016 15:00:15 GMT From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r306347 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve Message-ID: <201607161500.u6GF0Foc082357@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: iateaca Date: Sat Jul 16 15:00:14 2016 New Revision: 306347 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=306347 Log: implement the HDA_CMD_VERB_GET_CONV_STREAM_CHAN and HDA_CMD_VERB_GET_CONV_FMT verbs stop the stream audio context when the stream tag is set to 0 M bhyve/hda_codec.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c Modified: soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c ============================================================================== --- soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c Sat Jul 16 13:26:18 2016 (r306346) +++ soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve/hda_codec.c Sat Jul 16 15:00:14 2016 (r306347) @@ -388,13 +388,18 @@ sc = (struct hda_codec_softc *)hci->priv; assert(sc); - DPRINTF("run: %d, stream: 0x%x, dir: %d\n", run, stream, dir); - /* TODO search the right stream * For now, there is only one stream */ st = &sc->streams[HDA_CODEC_STREAM_OUTPUT]; + DPRINTF("run: %d, stream: 0x%x, st->stream: 0x%x dir: %d\n", run, stream, st->stream, dir); + + if (!st->stream) { + DPRINTF("Stream not set\n"); + return 0; + } + if (stream != st->stream) return -1; @@ -467,6 +472,9 @@ st = &sc->streams[HDA_CODEC_STREAM_OUTPUT]; switch (verb) { + case HDA_CMD_VERB_GET_CONV_FMT: + res = st->fmt; + break; case HDA_CMD_VERB_SET_CONV_FMT: st->fmt = payload; break; @@ -498,9 +506,15 @@ DPRINTF("SET_AMP_GAIN_MUTE_RIGHT: mute: 0x%x gain: 0x%x\n", mute, gain); } break; + case HDA_CMD_VERB_GET_CONV_STREAM_CHAN: + res = (st->stream << 4) | st->channel; + break; case HDA_CMD_VERB_SET_CONV_STREAM_CHAN: st->channel = payload & 0x0f; st->stream = (payload >> 4) & 0x0f; + DPRINTF("st->channel: 0x%x st->stream: 0x%x\n", st->channel, st->stream); + if (!st->stream) + hda_audio_ctxt_stop(&st->actx); break; default: DPRINTF("Unknown VERB: 0x%x\n", verb);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201607161500.u6GF0Foc082357>