Changeset f8608f2 in mainline


Ignore:
Timestamp:
2012-07-05T17:25:29Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8de7ef2
Parents:
2f7042e
Message:

libdrv,audio: Be a bit more verbose about buffer setup.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/drv/generic/remote_audio_pcm_buffer.c

    r2f7042e rf8608f2  
    3333
    3434#include <async.h>
     35#include <ddf/log.h>
    3536#include <errno.h>
    3637#include <str.h>
     
    224225        /* Share the buffer. */
    225226        if (ret == EOK && size > 0) {
    226                 size_t share_size;
    227                 ipc_callid_t name_id;
    228                 if (!async_share_in_receive(&name_id, &share_size)) {
    229                         async_answer_0(name_id, EPARTY);
    230                         return;
    231                 }
     227                size_t share_size = 0;
     228                ipc_callid_t share_id = 0;
     229                ddf_msg(LVL_DEBUG2, "Calling share receive.");
     230                if (!async_share_in_receive(&share_id, &share_size)) {
     231                        ddf_msg(LVL_DEBUG, "Failed to share pcm buffer.");
     232                        if (pcm_iface->release_buffer)
     233                                pcm_iface->release_buffer(fun, id);
     234                        async_answer_0(share_id, EPARTY);
     235                        return;
     236                }
     237                ddf_msg(LVL_DEBUG2, "Checking requested share size");
    232238                if (share_size != size) {
    233                         async_answer_0(name_id, ELIMIT);
    234                         return;
    235                 }
    236                 async_share_in_finalize(name_id, buffer, PROTO_READ | PROTO_WRITE);
     239                        ddf_msg(LVL_DEBUG, "Incorrect pcm buffer size requested.");
     240                        if (pcm_iface->release_buffer)
     241                                pcm_iface->release_buffer(fun, id);
     242                        async_answer_0(share_id, ELIMIT);
     243                        return;
     244                }
     245                ddf_msg(LVL_DEBUG2, "Calling share finalize");
     246                const int ret = async_share_in_finalize(share_id, buffer, 0);
     247                if (ret != EOK) {
     248                        ddf_msg(LVL_DEBUG, "Failed to share buffer");
     249                        if (pcm_iface->release_buffer)
     250                                pcm_iface->release_buffer(fun, id);
     251                        return;
     252
     253                }
     254                ddf_msg(LVL_DEBUG2, "Buffer shared ok with size %zu.",
     255                    share_size);
    237256        }
    238257}
Note: See TracChangeset for help on using the changeset viewer.