search for: nbyte

Displaying 20 results from an estimated 335 matches for "nbyte".

Did you mean: byte
2005 Dec 06
1
problems decoding speex... please help
...code speex using version 1.1.10's libspeex with fixed_point enabled. copied the sample in the manual (1.1.11) with minor revisions. While running the program, encountered this warning: "Packet is larger than allocated buffer : 38" when calling speex_bits_read_from (&bits, cbits, nBytes) then my program terminated unexpectedly with errors (Unhandled exception at 0x10225e1f ( msvcr80d.dll) in sampleDEC.exe: 0xC0000005: Access violation reading location 0x645c3a63.) I declared cbits as char *cbits [500]. nBytes is 38, bit rate is 15000 bps. I'm decoding a 'speex' file...
2008 Nov 07
0
[PATCH][cfq-cgroups] Introduce ioprio class for top layer.
...} + return dispatched; } @@ -699,149 +744,164 @@ param_separate(const char *master, char *valbuf, char *pathbuf, int size) *pc2 = '\0'; } -static ssize_t cfq_cgroup_read(struct cgroup *cont, struct cftype *cft, - struct file *file, char __user *userbuf, - size_t nbytes, loff_t *ppos) -{ - struct cfq_cgroup *cfqc; - char *page; - ssize_t ret; - struct rb_node *p; - - page = (char *)__get_free_page(GFP_TEMPORARY); - if (!page) - return -ENOMEM; - - cgroup_lock(); - if (cgroup_is_removed(cont)) { - cgroup_unlock(); - ret = -ENODEV; - goto out; - } - - cfqc = cg...
2008 Nov 07
0
[PATCH][cfq-cgroups] Introduce ioprio class for top layer.
...} + return dispatched; } @@ -699,149 +744,164 @@ param_separate(const char *master, char *valbuf, char *pathbuf, int size) *pc2 = '\0'; } -static ssize_t cfq_cgroup_read(struct cgroup *cont, struct cftype *cft, - struct file *file, char __user *userbuf, - size_t nbytes, loff_t *ppos) -{ - struct cfq_cgroup *cfqc; - char *page; - ssize_t ret; - struct rb_node *p; - - page = (char *)__get_free_page(GFP_TEMPORARY); - if (!page) - return -ENOMEM; - - cgroup_lock(); - if (cgroup_is_removed(cont)) { - cgroup_unlock(); - ret = -ENODEV; - goto out; - } - - cfqc = cg...
2020 May 16
0
[PATCH RFC] vhost: add an SOF Audio DSP driver
...struct vhost_rpmsg_iter *iter) +{ + struct vhost_dsp *dsp = container_of(vr, struct vhost_dsp, vrdev); + struct vhost_virtqueue *vq = iter->vq; + struct sof_rpmsg_data_resp *resp = &dsp->data_resp; + struct sof_rpmsg_data_req req; + size_t len = vhost_rpmsg_iter_len(iter); + size_t nbytes; + + if (len < sizeof(req)) { + vq_err(vq, "%s(): data count %zu too small\n", + __func__, len); + return -EINVAL; + } + + /* copy_{to,from}_iter() can be called repeatedly to continue copying */ + nbytes = vhost_rpmsg_copy(vr, iter, &req, sizeof(req)); + if (nbytes != s...
2010 Apr 10
2
Is Speex 1.0 and >=1.1 compatible?
...++i) { sample_buf[buf_len++] = samples[i] * 32767.0; if (buf_len == frame_size) { speex_encode(enc_state, sample_buf, &bits); buf_len = 0; if (++frame_cnt == 4) // Four frames per packet { speex_bits_insert_terminator(&bits); int nbytes = speex_bits_nbytes(&bits); char output_buf[nbytes]; nbytes = speex_bits_write(&bits, output_buf, nbytes); writeEncodedSamples(output_buf, nbytes); speex_bits_reset(&bits); frame_cnt = 0; } } } return count; } /* AudioEncoderSp...
2013 Jun 03
0
libao on Debian
...tdlib.h> #include <string.h> #include <math.h> #include <ao/ao.h> int main(void) { int sr = 44100 ; // samples per second int nchan = 1 ; // number of channels of sound double dur = 3 ; // duration in seconds char *sound ; int nBytes ; extern char *Sine(int sr, int nchan, double dur, int *nBytes) ; int r, id ; ao_device *device ; ao_sample_format fmt ; sound = Sine(sr, nchan, dur, &nBytes) ; // create sine tone(s) ao_initialize() ; if ( ( id = ao_default_driver_id() < 0 ) )...
2010 Apr 11
2
Is Speex 1.0 and >=1.1 compatible?
...> > speex_encode(enc_state, sample_buf,&bits); > > buf_len = 0; > > > > if (++frame_cnt == 4) // Four frames per packet > > { > > > > speex_bits_insert_terminator(&bits); > > int nbytes = speex_bits_nbytes(&bits); > > char output_buf[nbytes]; > > nbytes = speex_bits_write(&bits, output_buf, nbytes); > > writeEncodedSamples(output_buf, nbytes); > > speex_bits_reset(&bits); > > frame_cnt = 0; &gt...
2013 Jul 17
3
Help with filing a [maybe] ZFS/mmap bug.
Hi All, I have what I think is a ZFS related bug. Unfortunately my simplest test case is a bit cumbersome and I haven't definitively proven that the problem is ZFS related. I'm hoping for some feedback on how to move forward. Quick background: I rip my CD's using grip and produce flac files. I tag the music using Musicbrainz' Picard and transcode it to mp3's within Picard
2011 Jan 18
0
XCP 1.0 beta - nfs: RPC call returned error 88
.../server/min/max=3) cat /var/log/messages from cnode1 (XCP 1.0 beta) during instalation new VM: an 18 22:57:37 cnode1 tapdisk[9661]: ERROR: errno -88 at vhd_complete: /var/run/sr-mount/2d5ed3ca-7e4d-bceb-f959-542d3bade15e/3d69f4a6-743d-486e-8a65-1734e6ef0b67.vhd: op: 2, lsec: 80003048, secs: 24, nbytes: 12288, blk: 19531, blk_offset: 4294967295 Jan 18 22:57:37 cnode1 tapdisk[9661]: ERROR: errno -88 at vhd_complete: /var/run/sr-mount/2d5ed3ca-7e4d-bceb-f959-542d3bade15e/3d69f4a6-743d-486e-8a65-1734e6ef0b67.vhd: op: 5, lsec: 79998976, secs: 6, nbytes: 3072, blk: 19531, blk_offset: 4294967295 J...
2018 Dec 12
4
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...++++++++++++++---- 4 files changed, 166 insertions(+), 35 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index dc52b0f..c7ab0dd 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, size_t nbytes; size_t len; s16 headcount; + size_t remain_len; + int i; spin_lock_bh(&vsock->send_pkt_list_lock); if (list_empty(&vsock->send_pkt_list)) { @@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, break; } - nbytes = copy_to_iter(pkt->buf,...
2018 Dec 12
4
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...++++++++++++++---- 4 files changed, 166 insertions(+), 35 deletions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index dc52b0f..c7ab0dd 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, size_t nbytes; size_t len; s16 headcount; + size_t remain_len; + int i; spin_lock_bh(&vsock->send_pkt_list_lock); if (list_empty(&vsock->send_pkt_list)) { @@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, break; } - nbytes = copy_to_iter(pkt->buf,...
2008 Oct 29
0
[PATCH][cfq-cgroups] Introduce cgroups structure with ioprio entry.
...+ return &cfqc->css; +} + +static void cfq_cgroup_destroy(struct cgroup_subsys *ss, struct cgroup *cont) +{ + kfree(cgroup_to_cfq_cgroup(cont)); +} + +static ssize_t cfq_cgroup_read(struct cgroup *cont, struct cftype *cft, + struct file *file, char __user *userbuf, + size_t nbytes, loff_t *ppos) +{ + struct cfq_cgroup *cfqc; + char *page; + ssize_t ret; + + page = (char *)__get_free_page(GFP_TEMPORARY); + if (!page) + return -ENOMEM; + + cgroup_lock(); + if (cgroup_is_removed(cont)) { + cgroup_unlock(); + ret = -ENODEV; + goto out; + } + + cfqc = cgroup_to_cfq_cgroup(co...
2018 Dec 13
2
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...vhost is changed. >> diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c >> index dc52b0f..c7ab0dd 100644 >> --- a/drivers/vhost/vsock.c >> +++ b/drivers/vhost/vsock.c >> @@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, >> size_t nbytes; >> size_t len; >> s16 headcount; >> + size_t remain_len; >> + int i; >> >> spin_lock_bh(&vsock->send_pkt_list_lock); >> if (list_empty(&vsock->send_pkt_list)) { >> @@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost...
2018 Dec 13
2
[PATCH v2 3/5] VSOCK: support receive mergeable rx buffer in guest
...vhost is changed. >> diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c >> index dc52b0f..c7ab0dd 100644 >> --- a/drivers/vhost/vsock.c >> +++ b/drivers/vhost/vsock.c >> @@ -179,6 +179,8 @@ static int get_rx_bufs(struct vhost_virtqueue *vq, >> size_t nbytes; >> size_t len; >> s16 headcount; >> + size_t remain_len; >> + int i; >> >> spin_lock_bh(&vsock->send_pkt_list_lock); >> if (list_empty(&vsock->send_pkt_list)) { >> @@ -221,11 +223,19 @@ static int get_rx_bufs(struct vhost...
2019 Apr 04
1
[PATCH RFC 2/4] vhost/vsock: split packets to send using multiple buffers
...letions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index bb5fc0e9fbc2..9951b7e661f6 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -94,7 +94,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, struct iov_iter iov_iter; unsigned out, in; size_t nbytes; - size_t len; + size_t iov_len, payload_len; int head; spin_lock_bh(&vsock->send_pkt_list_lock); @@ -139,8 +139,18 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, break; } - len = iov_length(&vq->iov[out], in); - iov_iter_init(&iov_iter, READ, &amp...
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...*vsock, > > struct vhost_virtqueue *vq) > > { ... head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), &out, &in, NULL, NULL); ... len = iov_length(&vq->iov[out], in); iov_iter_init(&iov_iter, READ, &vq->iov[out], in, len); nbytes = copy_to_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter); if (nbytes != sizeof(pkt->hdr)) { virtio_transport_free_pkt(pkt); vq_err(vq, "Faulted on copying pkt hdr\n"); break; } > > ... > > nbytes = copy_to_iter(pkt->buf, pkt->len, &io...
2019 Aug 01
2
[PATCH v4 1/5] vsock/virtio: limit the memory used per-socket
...*vsock, > > struct vhost_virtqueue *vq) > > { ... head = vhost_get_vq_desc(vq, vq->iov, ARRAY_SIZE(vq->iov), &out, &in, NULL, NULL); ... len = iov_length(&vq->iov[out], in); iov_iter_init(&iov_iter, READ, &vq->iov[out], in, len); nbytes = copy_to_iter(&pkt->hdr, sizeof(pkt->hdr), &iov_iter); if (nbytes != sizeof(pkt->hdr)) { virtio_transport_free_pkt(pkt); vq_err(vq, "Faulted on copying pkt hdr\n"); break; } > > ... > > nbytes = copy_to_iter(pkt->buf, pkt->len, &io...
2019 Jul 17
0
[PATCH v4 4/5] vhost/vsock: split packets to send using multiple buffers
...tions(-) diff --git a/drivers/vhost/vsock.c b/drivers/vhost/vsock.c index 6c8390a2af52..9f57736fe15e 100644 --- a/drivers/vhost/vsock.c +++ b/drivers/vhost/vsock.c @@ -102,7 +102,7 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, struct iov_iter iov_iter; unsigned out, in; size_t nbytes; - size_t len; + size_t iov_len, payload_len; int head; spin_lock_bh(&vsock->send_pkt_list_lock); @@ -147,8 +147,24 @@ vhost_transport_do_send_pkt(struct vhost_vsock *vsock, break; } - len = iov_length(&vq->iov[out], in); - iov_iter_init(&iov_iter, READ, &amp...
2006 Sep 16
3
converting 16-bit samples in LPSTR to short
...32 API function calls. These function calls return the sound samples in an array of characters. My assumption is that this array of characters represents pairs of bytes that make up a short integer. I'm using the following code to convert the samples: LPTSTR *lpSaveBuffer; ...... for(j=0;j<nBytes;++J) { BYTE a = lpSaveBuffer[2*j]; // left byte BYTE b = lpSaveBuffer[2*j + 1]; // right byte short sample = (a << 8) | (b & 0xff); } I'm getting garbage as a result of this conversion. Any help would be appreciated. Thanks, Peter -------------- next part -------...
2018 Nov 05
2
[PATCH 2/5] VSOCK: support fill data to mergeable rx buffer in host
...hlen = sizeof(struct virtio_vsock_hdr); + /* Avoid further vmexits, we're already processing the virtqueue */ vhost_disable_notify(&vsock->dev, vq); for (;;) { struct virtio_vsock_pkt *pkt; struct iov_iter iov_iter; - unsigned out, in; + unsigned out = 0, in = 0; size_t nbytes; size_t len; - int head; + s16 headcount; spin_lock_bh(&vsock->send_pkt_list_lock); if (list_empty(&vsock->send_pkt_list)) { @@ -116,16 +191,9 @@ static struct vhost_vsock *vhost_vsock_get(u32 guest_cid) list_del_init(&pkt->list); spin_unlock_bh(&vsock-&g...