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

Ignore:
Timestamp:
2014-08-26T10:10:50Z (6 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
master
Children:
6747b929
Parents:
99cb9bf
Message:

Garbled playback via hound.

File:
1 edited

Legend:

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

    r99cb9bf r159c722d  
    4343#include "hdactl.h"
    4444#include "hdaudio.h"
     45#include "pcm_iface.h"
    4546#include "spec/fmt.h"
    4647#include "stream.h"
     
    155156        uint32_t fmt;
    156157        /* 48 kHz, 16-bits, 1 channel */
    157         fmt = fmt_bits_16 << fmt_bits_l;
     158        fmt = (fmt_base_44khz << fmt_base) | (fmt_bits_16 << fmt_bits_l);
    158159
    159160        ddf_msg(LVL_NOTE, "hda_get_buffer() - create stream");
     
    165166        /* XXX This is only one buffer */
    166167        *buffer = hda->pcm_stream->buf[0];
    167         *size = hda->pcm_stream->bufsize;
     168        *size = hda->pcm_stream->bufsize * hda->pcm_stream->nbuffers;
    168169
    169170        ddf_msg(LVL_NOTE, "hda_get_buffer() retturing EOK, buffer=%p, size=%zu",
     
    180181static int hda_set_event_session(ddf_fun_t *fun, async_sess_t *sess)
    181182{
     183        hda_t *hda = fun_to_hda(fun);
     184
    182185        ddf_msg(LVL_NOTE, "hda_set_event_session()");
    183         return ENOTSUP;
     186        hda->ev_sess = sess;
     187        return EOK;
    184188}
    185189
    186190static async_sess_t *hda_get_event_session(ddf_fun_t *fun)
    187191{
     192        hda_t *hda = fun_to_hda(fun);
     193
    188194        ddf_msg(LVL_NOTE, "hda_get_event_session()");
    189         return NULL;
     195        return hda->ev_sess;
    190196}
    191197
     
    215221                return rc;
    216222
     223        async_usleep(1000*1000);
    217224        hda_stream_start(hda->pcm_stream);
    218225        return EOK;
     
    238245}
    239246
     247void hda_pcm_event(hda_t *hda, pcm_event_t event)
     248{
     249        async_exch_t *exchange;
     250
     251        if (hda->ev_sess == NULL) {
     252                ddf_log_warning("No one listening for event %u", event);
     253                return;
     254        }
     255
     256        exchange = async_exchange_begin(hda->ev_sess);
     257        async_msg_1(exchange, event, 0);
     258        async_exchange_end(exchange);
     259}
     260
    240261/** @}
    241262 */
Note: See TracChangeset for help on using the changeset viewer.