Lsphinx.addnodesdocument)}( rawsourcechildren]( translations LanguagesNode)}(hhh](h pending_xref)}(hhh]docutils.nodesTextChinese (Simplified)}parenthsba attributes}(ids]classes]names]dupnames]backrefs] refdomainstdreftypedoc reftarget7/translations/zh_CN/driver-api/media/drivers/bttv-develmodnameN classnameN refexplicitutagnamehhh ubh)}(hhh]hChinese (Traditional)}hh2sbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/zh_TW/driver-api/media/drivers/bttv-develmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hItalian}hhFsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/it_IT/driver-api/media/drivers/bttv-develmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hJapanese}hhZsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/ja_JP/driver-api/media/drivers/bttv-develmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hKorean}hhnsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/ko_KR/driver-api/media/drivers/bttv-develmodnameN classnameN refexplicituh1hhh ubh)}(hhh]hSpanish}hhsbah}(h]h ]h"]h$]h&] refdomainh)reftypeh+ reftarget7/translations/sp_SP/driver-api/media/drivers/bttv-develmodnameN classnameN refexplicituh1hhh ubeh}(h]h ]h"]h$]h&]current_languageEnglishuh1h hh _documenthsourceNlineNubhcomment)}(h SPDX-License-Identifier: GPL-2.0h]h SPDX-License-Identifier: GPL-2.0}hhsbah}(h]h ]h"]h$]h&] xml:spacepreserveuh1hhhhhhQ/var/lib/git/docbuild/linux/Documentation/driver-api/media/drivers/bttv-devel.rsthKubhsection)}(hhh](htitle)}(hThe bttv driverh]hThe bttv driver}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh)}(hhh](h)}(hbttv and sound mini howtoh]hbttv and sound mini howto}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhhhhhKubh paragraph)}(hXThere are a lot of different bt848/849/878/879 based boards available. Making video work often is not a big deal, because this is handled completely by the bt8xx chip, which is common on all boards. But sound is handled in slightly different ways on each board.h]hXThere are a lot of different bt848/849/878/879 based boards available. Making video work often is not a big deal, because this is handled completely by the bt8xx chip, which is common on all boards. But sound is handled in slightly different ways on each board.}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hXITo handle the grabber boards correctly, there is a array tvcards[] in bttv-cards.c, which holds the information required for each board. Sound will work only, if the correct entry is used (for video it often makes no difference). The bttv driver prints a line to the kernel log, telling which card type is used. Like this one::h]hXHTo handle the grabber boards correctly, there is a array tvcards[] in bttv-cards.c, which holds the information required for each board. Sound will work only, if the correct entry is used (for video it often makes no difference). The bttv driver prints a line to the kernel log, telling which card type is used. Like this one:}(hhhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh literal_block)}(h1bttv0: model: BT848(Hauppauge old) [autodetected]h]h1bttv0: model: BT848(Hauppauge old) [autodetected]}hhsbah}(h]h ]h"]h$]h&]hhuh1hhhhKhhhhubh)}(hYou should verify this is correct. If it isn't, you have to pass the correct board type as insmod argument, ``insmod bttv card=2`` for example. The file Documentation/admin-guide/media/bttv-cardlist.rst has a list of valid arguments for card.h](hoYou should verify this is correct. If it isn’t, you have to pass the correct board type as insmod argument, }(hjhhhNhNubhliteral)}(h``insmod bttv card=2``h]hinsmod bttv card=2}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhq for example. The file Documentation/admin-guide/media/bttv-cardlist.rst has a list of valid arguments for card.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hIf your card isn't listed there, you might check the source code for new entries which are not listed yet. If there isn't one for your card, you can check if one of the existing entries does work for you (just trial and error...).h]hIf your card isn’t listed there, you might check the source code for new entries which are not listed yet. If there isn’t one for your card, you can check if one of the existing entries does work for you (just trial and error...).}(hj*hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKhhhhubh)}(hXSome boards have an extra processor for sound to do stereo decoding and other nice features. The msp34xx chips are used by Hauppauge for example. If your board has one, you might have to load a helper module like ``msp3400`` to make sound work. If there isn't one for the chip used on your board: Bad luck. Start writing a new one. Well, you might want to check the video4linux mailing list archive first...h](hSome boards have an extra processor for sound to do stereo decoding and other nice features. The msp34xx chips are used by Hauppauge for example. If your board has one, you might have to load a helper module like }(hj8hhhNhNubj)}(h ``msp3400``h]hmsp3400}(hj@hhhNhNubah}(h]h ]h"]h$]h&]uh1jhj8ubh to make sound work. If there isn’t one for the chip used on your board: Bad luck. Start writing a new one. Well, you might want to check the video4linux mailing list archive first...}(hj8hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK hhhhubh)}(hOf course you need a correctly installed soundcard unless you have the speakers connected directly to the grabber board. Hint: check the mixer settings too. ALSA for example has everything muted by default.h]hOf course you need a correctly installed soundcard unless you have the speakers connected directly to the grabber board. Hint: check the mixer settings too. ALSA for example has everything muted by default.}(hjXhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK'hhhhubh)}(hhh](h)}(hHow sound works in detailh]hHow sound works in detail}(hjihhhNhNubah}(h]h ]h"]h$]h&]uh1hhjfhhhhhK-ubh)}(hoStill doesn't work? Looks like some driver hacking is required. Below is a do-it-yourself description for you.h]hqStill doesn’t work? Looks like some driver hacking is required. Below is a do-it-yourself description for you.}(hjwhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK/hjfhhubh)}(hXbThe bt8xx chips have 32 general purpose pins, and registers to control these pins. One register is the output enable register (``BT848_GPIO_OUT_EN``), it says which pins are actively driven by the bt848 chip. Another one is the data register (``BT848_GPIO_DATA``), where you can get/set the status if these pins. They can be used for input and output.h](hThe bt8xx chips have 32 general purpose pins, and registers to control these pins. One register is the output enable register (}(hjhhhNhNubj)}(h``BT848_GPIO_OUT_EN``h]hBT848_GPIO_OUT_EN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh`), it says which pins are actively driven by the bt848 chip. Another one is the data register (}(hjhhhNhNubj)}(h``BT848_GPIO_DATA``h]hBT848_GPIO_DATA}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubhZ), where you can get/set the status if these pins. They can be used for input and output.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK2hjfhhubh)}(hX-Most grabber board vendors use these pins to control an external chip which does the sound routing. But every board is a little different. These pins are also used by some companies to drive remote control receiver chips. Some boards use the i2c bus instead of the gpio pins to connect the mux chip.h]hX-Most grabber board vendors use these pins to control an external chip which does the sound routing. But every board is a little different. These pins are also used by some companies to drive remote control receiver chips. Some boards use the i2c bus instead of the gpio pins to connect the mux chip.}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK9hjfhhubh)}(hAs mentioned above, there is a array which holds the required information for each known board. You basically have to create a new line for your board. The important fields are these two::h]hAs mentioned above, there is a array which holds the required information for each known board. You basically have to create a new line for your board. The important fields are these two:}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK?hjfhhubh)}(hstruct tvcard { [ ... ] u32 gpiomask; u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ };h]hstruct tvcard { [ ... ] u32 gpiomask; u32 audiomux[6]; /* Tuner, Radio, external, internal, mute, stereo */ };}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhKChjfhhubh)}(hgpiomask specifies which pins are used to control the audio mux chip. The corresponding bits in the output enable register (``BT848_GPIO_OUT_EN``) will be set as these pins must be driven by the bt848 chip.h](h|gpiomask specifies which pins are used to control the audio mux chip. The corresponding bits in the output enable register (}(hjhhhNhNubj)}(h``BT848_GPIO_OUT_EN``h]hBT848_GPIO_OUT_EN}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh=) will be set as these pins must be driven by the bt848 chip.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKJhjfhhubh)}(hThe ``audiomux[]`` array holds the data values for the different inputs (i.e. which pins must be high/low for tuner/mute/...). This will be written to the data register (``BT848_GPIO_DATA``) to switch the audio mux.h](hThe }(hjhhhNhNubj)}(h``audiomux[]``h]h audiomux[]}(hj hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh array holds the data values for the different inputs (i.e. which pins must be high/low for tuner/mute/...). This will be written to the data register (}(hjhhhNhNubj)}(h``BT848_GPIO_DATA``h]hBT848_GPIO_DATA}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh) to switch the audio mux.}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKOhjfhhubh)}(hXFWhat you have to do is figure out the correct values for gpiomask and the audiomux array. If you have Windows and the drivers four your card installed, you might to check out if you can read these registers values used by the windows driver. A tool to do this is available from http://btwincap.sourceforge.net/download.html.h](hXWhat you have to do is figure out the correct values for gpiomask and the audiomux array. If you have Windows and the drivers four your card installed, you might to check out if you can read these registers values used by the windows driver. A tool to do this is available from }(hj3hhhNhNubh reference)}(h-http://btwincap.sourceforge.net/download.htmlh]h-http://btwincap.sourceforge.net/download.html}(hj=hhhNhNubah}(h]h ]h"]h$]h&]refurij?uh1j;hj3ubh.}(hj3hhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKUhjfhhubh)}(hYou might also dig around in the ``*.ini`` files of the Windows applications. You can have a look at the board to see which of the gpio pins are connected at all and then start trial-and-error ...h](h!You might also dig around in the }(hjVhhhNhNubj)}(h ``*.ini``h]h*.ini}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1jhjVubh files of the Windows applications. You can have a look at the board to see which of the gpio pins are connected at all and then start trial-and-error ...}(hjVhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhK[hjfhhubh)}(hcStarting with release 0.7.41 bttv has a number of insmod options to make the gpio debugging easier:h]hcStarting with release 0.7.41 bttv has a number of insmod options to make the gpio debugging easier:}(hjvhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhK`hjfhhubh block_quote)}(hX================= ============================================== bttv_gpio=0/1 enable/disable gpio debug messages gpiomask=n set the gpiomask value audiomux=i,j,... set the values of the audiomux array audioall=a set the values of the audiomux array (one value for all array elements, useful to check out which effect the particular value has). ================= ============================================== h]htable)}(hhh]htgroup)}(hhh](hcolspec)}(hhh]h}(h]h ]h"]h$]h&]colwidthKuh1jhjubj)}(hhh]h}(h]h ]h"]h$]h&]colwidthK.uh1jhjubhtbody)}(hhh](hrow)}(hhh](hentry)}(hhh]h)}(h bttv_gpio=0/1h]h bttv_gpio=0/1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(h"enable/disable gpio debug messagesh]h"enable/disable gpio debug messages}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKdhjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h gpiomask=nh]h gpiomask=n}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh]h)}(hset the gpiomask valueh]hset the gpiomask value}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKehjubah}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(haudiomux=i,j,...h]haudiomux=i,j,...}(hj'hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhj$ubah}(h]h ]h"]h$]h&]uh1jhj!ubj)}(hhh]h)}(h$set the values of the audiomux arrayh]h$set the values of the audiomux array}(hj>hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKfhj;ubah}(h]h ]h"]h$]h&]uh1jhj!ubeh}(h]h ]h"]h$]h&]uh1jhjubj)}(hhh](j)}(hhh]h)}(h audioall=ah]h audioall=a}(hj^hhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghj[ubah}(h]h ]h"]h$]h&]uh1jhjXubj)}(hhh]h)}(hset the values of the audiomux array (one value for all array elements, useful to check out which effect the particular value has).h]hset the values of the audiomux array (one value for all array elements, useful to check out which effect the particular value has).}(hjuhhhNhNubah}(h]h ]h"]h$]h&]uh1hhhhKghjrubah}(h]h ]h"]h$]h&]uh1jhjXubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]uh1jhjubeh}(h]h ]h"]h$]h&]colsKuh1jhjubah}(h]h ]h"]h$]h&]uh1jhjubah}(h]h ]h"]h$]h&]uh1jhhhKchjfhhubh)}(h:The messages printed with ``bttv_gpio=1`` look like this::h](hThe messages printed with }(hjhhhNhNubj)}(h``bttv_gpio=1``h]h bttv_gpio=1}(hjhhhNhNubah}(h]h ]h"]h$]h&]uh1jhjubh look like this:}(hjhhhNhNubeh}(h]h ]h"]h$]h&]uh1hhhhKlhjfhhubh)}(hXAbttv0: gpio: en=00000027, out=00000024 in=00ffffd8 [audio: off] en = output _en_able register (BT848_GPIO_OUT_EN) out = _out_put bits of the data register (BT848_GPIO_DATA), i.e. BT848_GPIO_DATA & BT848_GPIO_OUT_EN in = _in_put bits of the data register, i.e. BT848_GPIO_DATA & ~BT848_GPIO_OUT_ENh]hXAbttv0: gpio: en=00000027, out=00000024 in=00ffffd8 [audio: off] en = output _en_able register (BT848_GPIO_OUT_EN) out = _out_put bits of the data register (BT848_GPIO_DATA), i.e. BT848_GPIO_DATA & BT848_GPIO_OUT_EN in = _in_put bits of the data register, i.e. BT848_GPIO_DATA & ~BT848_GPIO_OUT_EN}hjsbah}(h]h ]h"]h$]h&]hhuh1hhhhKnhjfhhubeh}(h]how-sound-works-in-detailah ]h"]how sound works in detailah$]h&]uh1hhhhhhhhK-ubeh}(h]bttv-and-sound-mini-howtoah ]h"]bttv and sound mini howtoah$]h&]uh1hhhhhhhhKubeh}(h]the-bttv-driverah ]h"]the bttv driverah$]h&]uh1hhhhhhhhKubeh}(h]h ]h"]h$]h&]sourcehuh1hcurrent_sourceN current_lineNsettingsdocutils.frontendValues)}(hN generatorN datestampN source_linkN source_urlN toc_backlinksjfootnote_backlinksK sectnum_xformKstrip_commentsNstrip_elements_with_classesN strip_classesN report_levelK halt_levelKexit_status_levelKdebugNwarning_streamN tracebackinput_encoding utf-8-siginput_encoding_error_handlerstrictoutput_encodingutf-8output_encoding_error_handlerjerror_encodingutf-8error_encoding_error_handlerbackslashreplace language_codeenrecord_dependenciesNconfigN id_prefixhauto_id_prefixid dump_settingsNdump_internalsNdump_transformsNdump_pseudo_xmlNexpose_internalsNstrict_visitorN_disable_configN_sourceh _destinationN _config_files]7/var/lib/git/docbuild/linux/Documentation/docutils.confafile_insertion_enabled raw_enabledKline_length_limitM'pep_referencesN pep_base_urlhttps://peps.python.org/pep_file_url_templatepep-%04drfc_referencesN rfc_base_url&https://datatracker.ietf.org/doc/html/ tab_widthKtrim_footnote_reference_spacesyntax_highlightlong smart_quotessmartquotes_locales]character_level_inline_markupdoctitle_xform docinfo_xformKsectsubtitle_xform image_loadinglinkembed_stylesheetcloak_email_addressessection_self_linkenvNubreporterNindirect_targets]substitution_defs}substitution_names}refnames}refids}nameids}(jjjjjju nametypes}(jjjuh}(jhjhjjfu footnote_refs} citation_refs} autofootnotes]autofootnote_refs]symbol_footnotes]symbol_footnote_refs] footnotes] citations]autofootnote_startKsymbol_footnote_startK id_counter collectionsCounter}Rparse_messages]transform_messages] transformerN include_log] decorationNhhub.