Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/hdaudio/codec.c

    r0d59ea7e rcf78637  
    11/*
    2  * Copyright (c) 2022 Jiri Svoboda
     2 * Copyright (c) 2014 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    512512        codec->address = address;
    513513        codec->in_aw = -1;
    514         codec->out_aw = -1;
    515514
    516515        rc = hda_get_subnc(codec, 0, &sfg, &nfg);
     
    585584                                        goto error;
    586585                        } else if (awtype == awt_audio_output) {
     586                                codec->out_aw_list[codec->out_aw_num++] = aw;
     587
    587588                                rc = hda_get_supp_rates(codec, aw, &rates);
    588589                                if (rc != EOK)
     
    593594                                        goto error;
    594595
    595                                 if (rates != 0 && formats != 0 &&
    596                                     codec->out_aw < 0) {
    597                                         ddf_msg(LVL_DEBUG, "Selected output "
    598                                             "widget %d\n", aw);
    599                                         codec->out_aw = aw;
    600                                 } else {
    601                                         ddf_msg(LVL_DEBUG, "Ignoring output "
    602                                             "widget %d\n", aw);
    603                                 }
    604 
    605                                 ddf_msg(LVL_NOTE, "Output widget %d: rates=0x%x formats=0x%x",
     596                                ddf_msg(LVL_DEBUG, "Output widget %d: rates=0x%x formats=0x%x",
    606597                                    aw, rates, formats);
    607                                 codec->out_aw_rates = rates;
    608                                 codec->out_aw_formats = formats;
    609598                        } else if (awtype == awt_audio_input) {
    610599                                if (codec->in_aw < 0) {
     
    627616                                ddf_msg(LVL_DEBUG, "Input widget %d: rates=0x%x formats=0x%x",
    628617                                    aw, rates, formats);
    629                                 codec->in_aw_rates = rates;
    630                                 codec->in_aw_formats = formats;
    631618                        }
    632619
     
    657644{
    658645        errno_t rc;
    659 
    660         /* Configure converter */
    661         ddf_msg(LVL_DEBUG, "Configure output converter format / %d",
    662             codec->out_aw);
    663         rc = hda_set_converter_fmt(codec, codec->out_aw, stream->fmt);
    664         if (rc != EOK)
    665                 goto error;
    666 
    667         ddf_msg(LVL_DEBUG, "Configure output converter stream, channel");
    668         rc = hda_set_converter_ctl(codec, codec->out_aw, stream->sid, 0);
    669         if (rc != EOK)
    670                 goto error;
     646        int out_aw;
     647        int i;
     648
     649        for (i = 0; i < codec->out_aw_num; i++) {
     650                out_aw = codec->out_aw_list[i];
     651
     652                /* Configure converter */
     653
     654                ddf_msg(LVL_DEBUG, "Configure output converter format");
     655                rc = hda_set_converter_fmt(codec, out_aw, stream->fmt);
     656                if (rc != EOK)
     657                        goto error;
     658
     659                ddf_msg(LVL_DEBUG, "Configure output converter stream, channel");
     660                rc = hda_set_converter_ctl(codec, out_aw, stream->sid, 0);
     661                if (rc != EOK)
     662                        goto error;
     663        }
    671664
    672665        return EOK;
Note: See TracChangeset for help on using the changeset viewer.