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

Changeset 9b3d999 in mainline


Ignore:
Timestamp:
2012-07-06T14:17:28Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial
Children:
ef246b9
Parents:
c5c65b6
Message:

drv/auid/sb16: Refactor debug output.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/audio/sb16/dsp.c

    rc5c65b6 r9b3d999  
    4646
    4747#define BUFFER_ID 1
    48 #define BUFFER_SIZE (PAGE_SIZE)
    49 #define PLAY_BLOCK_SIZE (BUFFER_SIZE / 2)
     48#define MAX_BUFFER_SIZE (PAGE_SIZE)
    5049
    5150#ifndef DSP_RETRY_COUNT
     
    116115{
    117116        assert(dsp);
    118         if (size > BUFFER_SIZE || size == 0 || (size % 2) == 1)
    119                 size = BUFFER_SIZE;
     117        if (size > MAX_BUFFER_SIZE || size == 0 || (size % 2) == 1)
     118                size = MAX_BUFFER_SIZE;
    120119        uint8_t *buffer = dma_create_buffer24(size);
    121120        if (buffer == NULL) {
     
    126125        const uintptr_t pa = addr_to_phys(buffer);
    127126        assert(pa < (1 << 25));
     127
    128128        /* Set 16 bit channel */
    129129        const int ret = sb_setup_dma(dsp, pa, size);
     
    191191        assert(dsp);
    192192        if (dsp->event_exchange) {
    193 //              ddf_log_verbose("Sending interrupt event.");
    194193                async_msg_0(dsp->event_exchange, IPC_FIRST_USER_METHOD);
    195194        } else {
     
    248247                return ENOENT;
    249248        sb_clear_buffer(dsp);
    250         if (dsp->event_exchange)
    251                 async_exchange_end(dsp->event_exchange);
     249        async_exchange_end(dsp->event_exchange);
    252250        dsp->event_exchange = NULL;
    253251        if (dsp->event_session)
     
    273271
    274272        /* Check supported parameters */
    275         ddf_log_debug("Starting playback on buffer(%u): %uHz, %u bit, "
    276             " %u channel(s), %ssigned.", id, sampling_rate, sample_size,
    277             channels, sign ? "" : "un" );
     273        ddf_log_debug("Requested playback on buffer \"%u\" (%u parts): %uHz, "
     274            "%ssinged %u bit, %u channel(s).", id, parts, sampling_rate,
     275            sign ? "" : "un", sample_size, channels);
    278276        if (id != BUFFER_ID)
    279277                return ENOENT;
     
    293291        sb_dsp_write(dsp, sampling_rate & 0xff);
    294292
    295         ddf_log_debug("Sampling rate: %hhx:%hhx.",
     293        ddf_log_verbose("Sampling rate: %hhx:%hhx.",
    296294            sampling_rate >> 8, sampling_rate & 0xff);
    297295
     
    310308        sb_dsp_write(dsp, (dsp->playing.samples - 1) >> 8);
    311309
     310        ddf_log_verbose("Playback started, interrupt every %u samples "
     311            "(~1/%u sec)", dsp->playing.samples,
     312            sampling_rate / dsp->playing.samples);
     313
    312314        return EOK;
    313315}
Note: See TracChangeset for help on using the changeset viewer.