From owner-svn-soc-all@freebsd.org Sat Jul 16 15:00:16 2016 Return-Path: Delivered-To: svn-soc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 036E7B9B247 for ; Sat, 16 Jul 2016 15:00:16 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D19B916F6 for ; Sat, 16 Jul 2016 15:00:15 +0000 (UTC) (envelope-from iateaca@FreeBSD.org) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.15.2/8.15.2) with ESMTP id u6GF0FqB082410 for ; Sat, 16 Jul 2016 15:00:15 GMT (envelope-from iateaca@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.15.2/8.15.2/Submit) id u6GF0Foc082357 for svn-soc-all@FreeBSD.org; Sat, 16 Jul 2016 15:00:15 GMT (envelope-from iateaca@FreeBSD.org) Date: Sat, 16 Jul 2016 15:00:15 GMT Message-Id: <201607161500.u6GF0Foc082357@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to iateaca@FreeBSD.org using -f From: iateaca@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r306347 - soc2016/iateaca/bhyve-hda-head/usr.sbin/bhyve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Jul 2016 15:00:16 -0000 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);