Programming :: Alsa C API, Usage Of Function _snd_pcm_file_open()?
Feb 8, 2011
I had a look at the Spotify C API, and found that they were using the following code to output music from Spotify: snd_pcm_open(&h, dev, SND_PCM_STREAM_PLAYBACK, 0).
I want use this function instead: int _snd_pcm_file_open(snd_pcm_t **pcmp, const char *name, snd_config_t *root, snd_config_t *conf, snd_pcm_stream_t stream, int mode)The function is found here: http://www.alsa-project.org/alsa-doc...92e16f8abdc60a I'm not able to find anything in the documentation explaining what the two parameters snd_config_t *root and snd_config_t *conf is. What I'm trying to achieve is to write the stream to a file, and then read it from another application. But it would be even better if I could get the stream returned directly from the C application.
View 1 Replies
ADVERTISEMENT
Apr 27, 2010
ive finaly set up upmixing on my X-Fi (fedora 12) but now i can hear 6 channel sound in XMMS player, Mplayer but not Rhythmbox. On some forum i found that rhythmbox is using Gstream config, where i can find it in Fedora 12 and how can i make rhythmbox use my alsa 20to51 mod ?
View 3 Replies
View Related
Jun 30, 2010
OSS, even though it's emulated *through* ALSA, consumes a microscopic fraction of straight ALSA's CPU usage. For example, when I'm playing something through ALSA with XMMS2, I'm getting about 25-30% CPU usage, but with OSS output, only 2%, tops. The same applies to any other application in which I can choose the output method. And, I'm on 10.04.
View 1 Replies
View Related
Nov 16, 2010
Code:
#include <iostream>
using namespace std;
[code]...
View 1 Replies
View Related
May 18, 2010
I am doing some Linux kernel programming for my research project. I need to record the timestamp (by using cpuid and rdtsc) when an interrupt handler (top half) is first invoked. Due to the time critical nature of the problem itself, I have to do the timestamping inside the interrupt handler itself (the first operation when the handler is called). However, I understand that tasks that are not so time critical should be deferred to a tasklet function (bottom half) for processing because other interrupts are disabled in a (top-half) interrupt handler. I am currently out of idea on how I can pass the timestamp information that I have obtained in the interrupt handler to the corresponding tasklet function.
View 2 Replies
View Related
Feb 25, 2010
I'm running 9.10. I was installing ALSA so that I could run my EMU 1616, and when I tried to go through the steps to install, I'm running into two errors that I've noticed so far. I think. Anyway, the first is that is states that the panelw library isn't there, and that alsamixer: function snd_ctl_open failed for default: No such device or address. The alsamixer one is really odd, since it's there, but I don't know why it won't run.
I initially had it running, and now it isn't. I've yet to get sound out of my EMU. the terminal window also tells me that it can't find the snd_emu file, even though it exists on the computer as well. I need an answer for a dummy.
View 5 Replies
View Related
May 24, 2010
I want to declare a function in a function, but had no success till now, see the error code below and visit the project at sourceforge
[Code]...
View 14 Replies
View Related
Jun 20, 2010
I looked on the net for such function or example and didin't find anything, thus after having made one i guess it would be legitimate to drop it to see what others thinks of it.
#!/bin/bash
addelementtoarray()
{
local arrayname=$1
[code]....
View 10 Replies
View Related
Dec 19, 2008
I am unable to find a description of alsa's programing language, this sort of stuff:
[Code]...
I need to know what, for example, 'ttable' means and what is its syntax. This seems to be a state secret.
View 2 Replies
View Related
Sep 16, 2010
fit a surface i.e. W(x,y) using svdfit() provided by "Numerical Recipes in C". svdfit() is written for curve fitting and not for surface fitting.But one can use svdfit(), as claimed by authors of NR book, to do surface fitting. On page 680 of NR book, authors have given a hint on how to use svdfit() for fitting a surface. But I have not understood it.This link may be helpful (Chapter 15 th is relevant here.):[URL]This is my problem:
Code:
I have a set of 100 numbers. I want to fit a 2-Dimensional function W(x,y) to these numbers.
[code]....
View 2 Replies
View Related
Mar 10, 2010
I've worked out how to get ALSA libasound code working for an application. However I can't workout how to get multiple sounds working at once. I can't seem to find any google examples of mutiple sounds. EG tune plays while pressing buttons makes clicks. I'm using an embedded board so need to use ALSA not an addon e.g. sdlmixer, jack, etc.
View 3 Replies
View Related
Nov 19, 2010
I have recently been forced to do a hardware upgrade (my previous mobo died). Now, sounds works ok with,amarok because kde has recognized the new hardware and switched to it.
..... does not work, likely because flash uses alsa-oss which is probably not configured automatically. I have tried uninstalling and reinstalling both alsa-oss and flash, but it didn't solve the problem.
View 1 Replies
View Related
Jun 4, 2010
I have a question about calling an asm function from C....It doesn't work unless I create an asm variable to hold the value of the function in....Why?Here's the code that doesn't work...
asmfile.s - version one Code: .section .data
mydata: .ascii "this is the message!
.equ mylen, . - mydata
[code]...
View 2 Replies
View Related
Jul 23, 2010
I want to use backtrace() function to debug a crash issue. I tried this sample code to see how backtrace works. backtrace() function always returns 0 with the below code. Is there any kernel configuration that needs to be set for proper working of backtrace?
#include <execinfo.h>
#include <stdio.h>
#include <stdlib.h>
/* Obtain a backtrace and print it to stdout. */
void
print_trace (void)
[Code]...
View 2 Replies
View Related
May 30, 2010
Can you offer me the code about fmod() in C. I want to know how this function work, i am very interested in it because i have no idea to implement it, i want to know... how to write the function... not 'how to use the function' can anyone post the source codes of this function here?
View 6 Replies
View Related
Jul 5, 2010
i have an open source application that was developed in C++ (it uses objects and namespaces all over the place). I also have another application that was developed in C. Now i am trying to insert the code made in C into C++ application, but when i do that , i get this error on compilation of the source code:
Code:
error: 'mpi_init_vars' was not declared in this scope the function mpi_init_vars() is not part of object oriented programming and it doesn't belong to any scope, it was compiled into an object file and i am linking it with all objects of C++ application.
How can invoke the C function from C++ object oriented code?
View 2 Replies
View Related
May 2, 2011
I am trying to build a function inside a script.
Code:
#!/bin/sh
#System commands and other configurable.
IPT=/sbin/iptables
IP6T=/sbin/ip6tables
IPST=/usr/sbin/ipset
MODP=/sbin/modprobe
GET=/usr/bin/wget
INT_NET=192.168.1.0/24 .....
I can find lots of tutorials in how to use if, then, else. However, how do I define a variable inside the function?
SEE>>
Code:
for c in $ISO
Also, am I using the 'test' command correctly( -/+ week as valid test)?
View 7 Replies
View Related
Feb 7, 2011
I am doing a web site program and what I need is to call a C program in the PHP cloud.Do u think it would be possible? The web site would get the user input from PHP UI and pass to the C program , the C program would process the function with the user input and output the a PHP page.
View 2 Replies
View Related
Jan 4, 2011
I ask if a c++/c function is able to know its name from inside itself:
example:
Code:
int funct1(int a,b)
{
printf("%s ",funct_name());
}
or with a trick.
View 2 Replies
View Related
May 30, 2010
Code:
#!/bin/ksh
(...)
# FILL UP PARTITION
diskfillerfunction () {
[Code]....
Test 15: fill up partition /usr/bin/time: cannot run diskfillerfunction: No such file or directory
I am obviously omitting (...) a lot of the code, but the relevant part is all there. How do I 'time' a function?
View 5 Replies
View Related
Mar 26, 2010
I wrote a spinner in Perl and when I did a spinner in shell I could just run the subroutine in the background.
[code]...
In Perl, how do you run a function in a background and get the PID for that? I know PID in Perl is $$
View 2 Replies
View Related
Mar 25, 2011
I know what is the functionality of the sleep() method.
for(i = 0; i < length; i++){
sleep(1000);
printf("%c
", message[i]);
}
Result :every print of the message will be takes 1000sec of gap but i want to know why wee need to use the Sleep function. where exactly it is useful
View 14 Replies
View Related
Nov 15, 2010
On this link [URL]4 a return type is defined
Code:
return ((unsigned int)(unsigned long)base & TBASE_DEFERRABLE_FLAG);
What is the above function returning.I am not clear with definition of what is being returned in the above code.
View 7 Replies
View Related
Apr 8, 2010
i want to compile function c in java and compile library is success.. when i call the library in java and error is :
Exception in thread "main" java.lang.UnsatisfiedLinkError: no libfunc.so in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1689)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
[Code]....
View 1 Replies
View Related
Jul 31, 2010
I'm having trouble getting ALSA to play multiple sound streams (multiple sounds at once). My code is running on an embedded ARM board using a AC97 sound. It will only play one without any mixing, I have to use pure ALSA as higher sound mixers are a nightmare to cross compile for ARM. I've tested my system with aplay for example
aplay -D plughw:0,1 bang.wav
works fine. So I tried dmix with
aplay -D plug:dmix Win.wav
That gave the following error
ALSA lib pcm_direct.c:1587snd_pcm_direct_parse_open_conf) The field ipc_gid must be a valid group (create group audio)
aplay: main:550: audio open error: Invalid argument
I checked asound with
/etc # cat asound.conf
pcm.EP93XX {
type hw
[code]....
Does this mean dmix will not work? Is there someway with the above setup I can play multiple sounds? I have to use the vendor ALSA build (so can't update ALSA), I can change the .confs however. Also because I'm cross compiling things like pulseaudio SDL are very difficult to get working, so I basically need to use the above ALSA. Is there anyway I can find if dmix exists on the system?
Should add aplay -L does show dmix ?
iec958 'cards.pcm.iec958'
spdif 'cards.pcm.iec958'
[code]....
View 3 Replies
View Related
Jan 12, 2009
i am programming to get a real number to show real-time system bandwidth used ? that mean the bandwidth used at the time my fuction running? am using C language to do that. so help me please!
View 4 Replies
View Related
Jan 11, 2009
i am wondering How to get usage of CPU, Memory in linux environment? So would you able to tell me the ways?
View 10 Replies
View Related
Apr 13, 2010
In shell, I execute "./ffmpeg -f h264 - | xxx"
Now I hope use execl function to execute above operations,
I call execl("/bin/sh", "sh", "-c", "./ffmpeg -f h264 - | xxx");
but ffmpeg doesn't work, it seems that "|" pipe don't work.
how could I solve this?
View 1 Replies
View Related
May 22, 2010
I wrote some code in c, using pthread (I configured the linker and compiler in eclipse IDE first).
Code: #include <pthread.h>
#include "starter.h"
#include "UI.h"
Page* MM;
[Code]....
View 6 Replies
View Related
Jul 5, 2010
I tried to make a (very simple) function to put in my .bashrc file to make a local backup of a file, but when I call the function and try to use tab completion I get the following error: Code: cp: cannot stat `help': No such file or directory The function I added is as follows:
Code: function bk
{
cp -f --backup=numbered ${1} ${1}.bak
[code]....
View 2 Replies
View Related