Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 3fec817 in mainline


Ignore:
Timestamp:
2014-09-04T15:51:56Z (7 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
de16f89
Parents:
149dd52d
Message:

Get format from stream.

Location:
uspace/drv/audio/hdaudio
Files:
4 edited

Legend:

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

    r149dd52d r3fec817  
    547547}
    548548
    549 int hda_out_converter_setup(hda_codec_t *codec, uint8_t sid)
     549int hda_out_converter_setup(hda_codec_t *codec, hda_stream_t *stream)
    550550{
    551551        int rc;
     
    556556                out_aw = codec->out_aw_list[i];
    557557
    558                 /* XXX Choose appropriate parameters */
    559                 uint32_t fmt;
    560                 /* 48 kHz, 16-bits, 1 channel */
    561                 fmt = (fmt_base_44khz << fmt_base) | (fmt_bits_16 << fmt_bits_l) | 1;
    562 
    563558                /* Configure converter */
    564559
    565560                ddf_msg(LVL_NOTE, "Configure converter format");
    566                 rc = hda_set_converter_fmt(codec, out_aw, fmt);
     561                rc = hda_set_converter_fmt(codec, out_aw, stream->fmt);
    567562                if (rc != EOK)
    568563                        goto error;
    569564
    570565                ddf_msg(LVL_NOTE, "Configure converter stream, channel");
    571                 rc = hda_set_converter_ctl(codec, out_aw, sid, 0);
     566                rc = hda_set_converter_ctl(codec, out_aw, stream->sid, 0);
    572567                if (rc != EOK)
    573568                        goto error;
  • uspace/drv/audio/hdaudio/codec.h

    r149dd52d r3fec817  
    3737
    3838#include "hdaudio.h"
     39#include "stream.h"
    3940
    4041#define MAX_OUT_AW 256
     
    5051extern hda_codec_t *hda_codec_init(hda_t *, uint8_t);
    5152extern void hda_codec_fini(hda_codec_t *);
    52 extern int hda_out_converter_setup(hda_codec_t *, uint8_t);
     53extern int hda_out_converter_setup(hda_codec_t *, hda_stream_t *);
    5354
    5455#endif
  • uspace/drv/audio/hdaudio/pcm_iface.c

    r149dd52d r3fec817  
    217217        ddf_msg(LVL_NOTE, "hda_start_playback()");
    218218
    219         rc = hda_out_converter_setup(hda->ctl->codec, hda->pcm_stream->sid);
     219        rc = hda_out_converter_setup(hda->ctl->codec, hda->pcm_stream);
    220220        if (rc != EOK)
    221221                return rc;
  • uspace/drv/audio/hdaudio/stream.h

    r149dd52d r3fec817  
    3434
    3535#ifndef STREAM_H
    36 #define STERAM_H
     36#define STREAM_H
    3737
    3838#include "hdaudio.h"
Note: See TracChangeset for help on using the changeset viewer.