Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932726AbaJ2LTT (ORCPT ); Wed, 29 Oct 2014 07:19:19 -0400 Received: from lists.s-osg.org ([54.187.51.154]:42423 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932300AbaJ2LTR (ORCPT ); Wed, 29 Oct 2014 07:19:17 -0400 Date: Wed, 29 Oct 2014 09:19:08 -0200 From: Mauro Carvalho Chehab To: Shuah Khan Cc: Takashi Iwai , Pierre-Louis Bossart , Devin Heitmueller , alsa-devel@alsa-project.org, Lars-Peter Clausen , Linux Media Mailing List , Greg Kroah-Hartman , Hans Verkuil , Sander Eikelenboom , prabhakar.csengg@gmail.com, Antti Palosaari , Laurent Pinchart , "sakari.ailus@linux.intel.com" , Andrew Morton , Tim Gardner , "olebowle@gmx.com" , Linux Kernel Subject: Re: [RFCv1] Media Token API needs - Was: Re: [alsa-devel] [PATCH v2 5/6] sound/usb: pcm changes to use media token api Message-ID: <20141029091908.14c4856f@recife.lan> In-Reply-To: <20141028220051.68a8ab6e@recife.lan> References: <543FB374.8020604@metafoo.de> <543FC3CD.8050805@osg.samsung.com> <543FD1EC.5010206@osg.samsung.com> <543FD892.6010209@osg.samsung.com> <54467EFB.7050800@xs4all.nl> <544804F1.7090606@linux.intel.com> <20141025114115.292ff5d2@recife.lan> <20141027105237.5f5ec7fd@recife.lan> <5450077F.70101@osg.samsung.com> <20141028214250.27f0c869@recife.lan> <20141028220051.68a8ab6e@recife.lan> Organization: Samsung X-Mailer: Claws Mail 3.10.1 (GTK+ 2.24.24; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, 28 Oct 2014 22:00:51 -0200 Mauro Carvalho Chehab escreveu: > Em Tue, 28 Oct 2014 21:42:50 -0200 > Mauro Carvalho Chehab escreveu: > > > Before starting with the description, this is the simplified diagram of > > a media device (without IR, eeprom and other beasts): > > As reference, a more complete diagram would be: An even more complete (but still simplified) diagram is shown at: http://linuxtv.org/downloads/presentations/typical_hybrid_hardware.png The dot lines represent the parts of the graph that are switched by the tuner, DMA or input select. Please notice that the DMA engines, together with the stuff needed to control A/V switches is at one single chip. Changing the registers there can affect the other streams, specially on most sophisticated devices like cx231xx, where it even has a power management IP block that validades if a device to be turned on/off won't exceed the maximum drain current of 500mA. That's basically why we need to do a temporary lock alsa, dvb, v4l and IR drivers when doing certain changes. Also, please notice that I2C buses that can be as slow as 10kbps are used to control for several devices, like: - the tuner - the Digital TV (DTV) demod - Analog and/or Video demod (sometimes embedded at the main chip) - DTV demux (sometimes embedded at the main chip) - The remote controller (sometimes embedded at the main chip) For some devices, after powered on, or when certain parameters change, a new firmware (and sometimes a hardware reset) is required. The firmware size can be about 64KB or even bigger. Also, the A/V switch it is actually two independent switches (or one switch for video and one audio mux for audio) that needs to be changed together when the source changes. Regards, Mauro For those curious enough or that are using mutt/pine this is the graph, in text mode, manually adjusted to fit into 80 cols, and with a link added by hand, as graph-easy failed to represent everything on this graph: +------------------+ | IR | +------------------+ | | v +------------------+ | IR POLL or DMA | +------------------+ | | v +------------------+ | devnode input8 | +------------------+ .................................................. : : : +-------------+-----------+---------+ : | digital | tuner | analog | : +-------------+-----------+---------+ : : : : DTV IF : : off on A/V : v : +------------------+ : | DTV demod | : +------------------+ : | : | MPEG-TS : | off on A/V : v : +------------------+ : | demux | : +------------------+ : | : | MPEG-TS : | off on A/V : v : +---------------+---------+-------------+ : | dvb | DMA | analog | <----+ : +---------------+---------+-------------+ | : : : | : : MPEG-TS Video stream : Video stream | : : off on A/V off on DTV : off on DTV | : v v | : +------------------+ +----------------+ | ATV IF : | | | | | off on DTV : | devnode dvr0 | | devnode video0 | | off on Composite : | | | | | : +------------------+ +----------------+ | : | +----+-------------------------------------------------+ | v +-------------+ | +---------+------------+-----------+ +-----------+ | video demod | ------+ | tuner | A/V switch | composite | <-- | comp. src | +-------------+ +---------+------------+-----------+ +-----------+ ^ : : : : : Audio IF ................................. : off on DTV Video IF v off on DTV +------------------+ | audio demod | +------------------+ | | Audio stream | off on DTV v +------------------+ | audio DMA | +------------------+ | | Audio stream | off on DTV v +------------------+ | devnode pcmC1D0c | +------------------+ And this is the dot file to produce it: digraph media_hardware { node [shape=record] DMA1[label = " dvb | DMA |