Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
New Contributor II
2,069 Views

alsa raw data issue

Hi All,

I have two .wav sound files.

When I do "aplay "

One of them is played properly. But the other one is giving a disturbing sound.

The difference in output of both the files is :

Playing WAVE 'bubble.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

&

Playing raw data 'Hello.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

Does anyone have an idea on this? What exactly playing raw data mean?

Thanks

--Paridhi

0 Kudos
13 Replies
Highlighted
11 Views

IMHO *.wav is not raw data.

you'd have to give more log data in order to analyze your prob.

e.g. "aplay -vv" or "aplay -vvv" should already give some more info.

Besides which of those files plays "correctly"?

is it correct that one is stereo 16 bit, 44.1kHz and the other only 8bit mono 8kHz?

0 Kudos
Highlighted
New Contributor II
11 Views

Hi mhahn,

 

Following is the output for file not working:

 

root@quark003356:~# aplay -vvv Hello.wav

Playing raw data 'Hello.wav' : Unsigned 8 bit, Rate 8000 Hz, Mono

Plug PCM: Rate conversion PCM (48000, sformat=U8)

Converter: linear-interpolation

Protocol version: 10002

Its setup is:

stream : PLAYBACK

access : RW_INTERLEAVED

format : U8

subformat : STD

channels : 1

rate : 8000

exact rate : 8000 (8000/1)

msbits : 8

buffer_size : 4000

period_size : 1000

period_time : 125000

tstamp_mode : NONE

period_step : 1

avail_min : 1000

period_event : 0

start_threshold : 4000

stop_threshold : 4000

silence_threshold: 0

silence_size : 0

boundary : 262144000

Slave: Route conversion PCM (sformat=S16_LE)

Transformation table:

0 <- 0</em>

1 <- 0</em>

Its setup is:

stream : PLAYBACK

access : MMAP_INTERLEAVED

format : U8

subformat : STD

channels : 1

rate : 48000

exact rate : 48000 (48000/1)

msbits : 8

buffer_size : 24006

period_size : 6000

period_time : 125000

tstamp_mode : NONE

period_step : 1

avail_min : 6000

period_event : 0

start_threshold : 24000

stop_threshold : 24006

silence_threshold: 0

silence_size : 0

boundary : 1573257216

Slave: Hardware PCM card 0 'C-Media USB Headphone Set' device 0 subdevice 0

Its setup is:

stream : PLAYBACK

access : MMAP_INTERLEAVED

format : S16_LE

subformat : STD

channels : 2

rate : 48000

exact rate : 48000 (48000/1)

msbits : 16

buffer_size : 24006

period_size : 6000

period_time : 125000

tstamp_mode : NONE

period_step : 1

avail_min : 6000

period_event : 0

start_threshold : 24000

stop_threshold : 24006

silence_threshold: 0

silence_size : 0

boundary : 1573257216

appl_ptr : 0

hw_ptr : 0

100%

100%

100%

100%

100%

100%

Max peak (1000 samples): 0x00000080 # Max peak (1000 samples): 0x00000080 # Max peak (1000 samples): 0x00000080 # Max peak (1000 samples): 0x00000080 # Max peak (1000 samples): 0x00000080 # Max peak (1000 samples): 0x00000080 # root@quark003356:~#

Thanks

--Paridhi 

0 Kudos
Highlighted
New Contributor II
11 Views

hi mhahn,

This is the output of file "fresh.wav" which is working: (Is there a way I can attach my audio files in this discussion?)

root@quark003356:~# aplay -vvv fresh.wav

Playing WAVE 'fresh.wav' : Unsigned 8 bit, Rate 11025 Hz, Mono

Plug PCM: Rate conversion PCM (44100, sformat=U8)

Converter: linear-interpolation

Protocol version: 10002

Its setup is:

stream : PLAYBACK

access : RW_INTERLEAVED

format : U8

subformat : STD

channels : 1

rate : 11025

exact rate : 11025 (11025/1)

msbits : 8

buffer_size : 5513

period_size : 1378

period_time : 125011

tstamp_mode : NONE

period_step : 1

avail_min : 1378

period_event : 0

start_threshold : 5513

stop_threshold : 5513

silence_threshold: 0

silence_size : 0

boundary : 361299968

Slave: Route conversion PCM (sformat=S16_LE)

Transformation table:

0 <- 0</em>

1 <- 0</em>

Its setup is:

stream : PLAYBACK

access : MMAP_INTERLEAVED

format : U8

subformat : STD

channels : 1

rate : 44100

exact rate : 44100 (44100/1)

msbits : 8

buffer_size : 22056

period_size : 5513

period_time : 125011

tstamp_mode : NONE

period_step : 1

avail_min : 5513

period_event : 0

start_threshold : 22052

stop_threshold : 22056

silence_threshold: 0

silence_size : 0

boundary : 1445462016

Slave: Hardware PCM card 0 'C-Media USB Headphone Set' device 0 subdevice 0

Its setup is:

stream : PLAYBACK

access : MMAP_INTERLEAVED

format : S16_LE

subformat : STD

channels : 2

rate : 44100

exact rate : 44100 (44100/1)

msbits : 16

buffer_size : 22056

period_size : 5513

period_time : 125011

tstamp_mode : NONE

period_step : 1

avail_min : 5513

period_event : 0

start_threshold : 22052

stop_threshold : 22056

silence_threshold: 0

silence_size : 0

boundary : 1445462016

appl_ptr : 0

hw_ptr : 0

21%

61%

56%

21%

84%

26%

19%

36%

72%

10%

6%

33%

22%

7%

14%

33%

39%

72%

63%

52%

45%

66%

54%

28%

26%

100%

53%

42%

47%

19%

57%

48%

10%

27%

67%

68%

38%

36%

43%

61%

25%

25%

10%

7%

21%

7%

20%

24%

23%

43%

28%

26%

7%

16%

28%

21%

15%

33%

23%

73%

71%

29%

24%

25%

17%

59%

14%

71%

7%

17%

50%

7%

3%

Max peak (1378 samples): 0x0000001c # Max peak (1378 samples): 0x0000004f # Max peak (1378 samples): 0x00000048 # Max peak (1378 samples): 0x0000001c # Max peak (1378 samples): 0x0000006c # Max peak (1378 samples): 0x00000022 # Max peak (1378 samples): 0x00000019 # Max peak (1378 samples): 0x0000002f # Max peak (1378 samples): 0x0000005d # Max peak (1378 samples): 0x0000000e # Max peak (1378 samples): 0x00000008 # Max peak (1378 samples): 0x0000002b # Max peak (1378 samples): 0x0000001d # Max peak (1378 samples): 0x0000000a # Max peak (1378 samples): 0x00000012 # ...

0 Kudos
Highlighted
New Contributor II
11 Views

HI mhahn,

Does it also have to do with the kind of formats my sound card supports irrespective of what aplay can? It was not working on Galileo , so I tried running the same on Ubuntu 12.04. Same issue occurs there.

Thanks

--Paridhi

0 Kudos
Highlighted
11 Views

sure - just tried to analyze from the very beginning 😉

you could e.g. convert the data format using gstreamer to make it fitting to your sound card

0 Kudos
Highlighted
New Contributor II
11 Views

Hi mhahn

Searching about it on internet led me to one of the RasberryPi's forum http://www.raspberrypi.org/forums/viewtopic.php?f=38&t=20866&start=25 Raspberry Pi • View topic - USB soundcard...Finally good (non HDMI) Analog Audio ,wherein it says that "Alsa can sometimes be a pain, the recording rate 8000Hz you chose for arecord is probably not supported by the card."

Do you know how can I get sampling rate of 8000Hz to work with alsa ? Or do you suggest an alternative to alsa for Galileo?

--Paridhi

0 Kudos
Highlighted
11 Views

as mentioned: you might use gstreamer to resample to a fitting rate

0 Kudos
Highlighted
New Contributor II
11 Views

hi mhahn,

Can you point me to the gstreamer repo for galileo?

I am able to find for edison which is not compatible it says.

0 Kudos
Highlighted
11 Views

not sure which Galileo image you use. If it's the eglibc one from Intel(R) IoT devkit, then you can take from http://iotdk.intel.com/repos/1.1/iotdk/i586/ i586/ (gst-*). If you're on a uclibc image AlexT_Intel might be able to add to his repo if you kindly ask him

0 Kudos
Highlighted
Honored Contributor II
11 Views

Adding gstreamer is definitely a possibility though I suspect that if it doesn't play on the Ubuntu system, then it's neither Galileo nor ALSA is the reason, but the file is simply corrupted (or the sound that was recorded was of the kind you hear back?).

Paridhi_Agrawal, you can attach files to your posts, just click on the "Use advanced editor" link in the upper right-hand corned of the post editor and then there will be a link for attaching files in the lower right-hand corned, next to "Mention" and "App". Attach your file, I'd be curious to look at it.

0 Kudos
Highlighted
11 Views

AlexT_Intel only some wav files play. gstreamer would be used to resample to a format the soundcard would support

0 Kudos
Highlighted
Honored Contributor II
11 Views

Yeah, that might be a card limitation too, I just took the "tried on Ubuntu" as if it was a different card there. Paridhi_Agrawal, do you mean that you've moved the USB sound card + the wav file in question to the Ubuntu machine, then trying to play it back through the same card and it didn't work? Or that Ubuntu machine had a different sound card?

0 Kudos
Highlighted
New Contributor II
11 Views

Hello All,

I have found a workaround solution to my problem

Here is what I did:

Since , the .wav raw U8 8 bit 8000Hz Mono format of my file was not playing using aplay on Gen1 (it was giving noise) , I found .mp3 version for same and

did the following to play it through aplay:

1) Downloaded http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz http://sourceforge.net/projects/lame/files/lame/3.99/lame-3.99.5.tar.gz

untar

./configure

make

make install

2) on the shell: lame --decode gw.mp3 gw_con.wav

3) aplay gw_con.wav and it works !!

--Paridhi

0 Kudos