sound volume in ALSA
Hi all,
I'm doing sound on an embedded board using alsa libasound. I've got the sound up and can load and play a tune using snd_pcm_writei. However the sound is very high. I've checked through ALSA documents (there's a lot :s) and found snd_ctl_open which I think opens up the volume for writting?
However I can't get the function to work. I've found a sample
char name[20];
if ( snd_ctl_open( &handle, name, 0 ) < 0 ) {
std::cerr << "control open (" << n_cards << ") failed." << std::endl;
continue;
}
However name seems uninitialized to me? So I tried but got and error, I then tried sending "hw:0,0" which is my hardware device from snd_pcm_open
this also gives me an error. My error is
(snd_ctl_open_noupdate) invalid CTL hw:0,0
Can anyone advise on what I need to send for that parameter? Thanks!
|