[Stk] RtAudioFormat and static at output

David Michael david at unnature.net
Wed, 26 Mar 2008 12:08:59 -0400


Thanks Gary,

As far as I can tell, I am using the __LITTLE_ENDIAN__ preprocessor  
flag like so:

'-O3 -Wall -D__LINUX_ALSA__ -D__LINUX_ALSASEQ__ -D__LITTLE_ENDIAN__'

Additionally I have tested this with a Parallels installation of  
Ubuntu and everything works fine (Apple MacBook Pro stock soundcard).  
So it does not seem to be OS (platform) specific.

This leads me to believe that it is something concerning the VIA  
soundcard itself, like the driver. But if that was the case, it leaves  
me confused as to why "aplay" would work, but RtAudio would not... .


D

On Mar 26, 2008, at 9:26 AM, Gary Scavone wrote:

> Hi David,
>
> Did you run the "configure" script before compiling STK?  It sounds  
> like the endian flag was not set.  I don't know the endianness of a  
> Pico-ITX board but the default STK configuration is big-endian.  If  
> you are using a little-endian system, provide the __LITTLE_ENDIAN__  
> preprocessor flag to the compiler.
>
> Regards,
>
> --gary
>
> On 26-Mar-08, at 9:03 AM, David Michael wrote:
>
>> Hello
>>
>> I wonder if someone can help me out.
>>
>> I have an STK/RtAudio based application running under Ubuntu Server  
>> 7.1(ALSA) on a Pico-ITX board, and thus the VIA VT82xx chip.
>>
>> The only problem is that the audio sounds like static (and only on  
>> one channel, the other is silent) even though the app does not  
>> complain at compilation nor at runtime. What makes this especially  
>> odd is that using "aplay" to play a soundfile does not suffer from  
>> this problem. It plays fine like so.
>>
>> $ aplay public/soundfiles/chimes.wav
>> Playing WAVE 'public/soundfiles/chimes.wav' : Signed 16 bit Little  
>> Endian, Rate 44100 Hz, Stereo
>>
>> Additionally, I can connect a USB soundcard, and everything works  
>> swimmingly - I suppose this is to be expected.
>>
>> What am I doing wrong??
>> Is the RtAudioFormat incorrect?
>>
>> I am using the following to determine format:
>> RtAudioFormat format = ( sizeof(StkFloat) == 8 ) ?  
>> RTAUDIO_FLOAT64 : RTAUDIO_FLOAT32;
>>
>> Does this have to do with duplex channels input and output channels  
>> registering for the soundcard?
>>
>> Any help would be much appreciated
>> Best
>> David
>>
>> PS - it is still possible that the problem has to do with the ALSA  
>> driver, but since I am able to use aplay successfully, I thought  
>> maybe no...
>>
>>
>> Here is the dump of the probe.cpp application - the soundcards as  
>> RtAudio sees them:
>>
>> Device Name = hw:HDA VIA VT82xx,0
>> Probe Status = Successful
>> Output Channels = 2
>> Input Channels = 2
>> Duplex Channels = 2
>> This is the default output device.
>> This is the default input device.
>> Natively supported data formats:
>>  16-bit int
>>  32-bit int
>> Supported sample rates = 44100 48000 88200 96000 176400 192000
>>
>> Device Name = hw:HDA VIA VT82xx,1
>> Probe Status = Successful
>> Output Channels = 2
>> Input Channels = 2
>> Duplex Channels = 2
>> This is NOT the default output device.
>> This is NOT the default input device.
>> Natively supported data formats:
>>  16-bit int
>>  32-bit int
>> Supported sample rates = 44100 48000 88200 96000 176400 192000
>>
>>
>>
>>
>> Here is the attached USB Audio Device dump that works:
>>
>> Device Name = hw:USB Audio Device,0
>> Probe Status = Successful
>> Output Channels = 2
>> Input Channels = 0
>> Duplex Channels = 0
>> This is NOT the default output device.
>> This is NOT the default input device.
>> Natively supported data formats:
>>  16-bit int
>> Supported sample rates = 48000
>> _______________________________________________
>> Stk mailing list
>> Stk@ccrma.stanford.edu
>> http://ccrma-mail.stanford.edu/mailman/listinfo/stk
>