Re: Alsa driver data transfer problem: the MSB is changed to 1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At Thu, 28 Sep 2006 16:43:06 +0800,
YongLi wrote:
> 
> Hello All,
> 
> I am desiging a TI sound card driver on my ARM board using Linux 2.6.18.
> 
> The ARM SOC uses IIS and IIC to control this soud codec chip. 
> 
> I found a stranger problem reltaed to the sound PCM data: The data transfered by DMA is different from the data I write to the sound device!
> 
> If I perform this command:
> 
> cat test.txt > /dev/dsp
> 
> using the printk to trace the data flow, I found the snd_pcm_oss_write function write all the data in test.txt to 
> substream->runtime->oss.buffer. However, In the snd_pcm_plug_write_transfer function, the channel changes and the data is different:
> 
> original data(text.txt):
> [00]=30
> [01]=31
> [02]=32
> [03]=33
> [04]=34
> [05]=35
> [06]=36
> [07]=37
> [08]=38
> [09]=39
> [10]=0a
> 
> The modified data:
> [00]=00
> [01]=b0
> [02]=00
> [03]=b0
> [04]=00
> [05]=b1
> [06]=00
> [07]=b1
> [08]=00
> [09]=b2
> [10]=00
> [11]=b2
> [12]=00
> [13]=b3
> [14]=00
> [15]=b3
> 
> It seems that all the 8th bit are changed to 1. I am not sure if it is correct.

The OSS-emulation code converts format, rate, channels, etc,
automatically for the parameters that hardware accepts.
So, "cat /dev/dsp" doesn't always pass the raw data as it is.

Check the PCM status on /proc/asound/card0/pcm0p/sub0/* (enabled when
built with CONFIG_SND_VERBOSE_PROCFS).


Takashi

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux