Skip to contentSkip to conversation

Noisy USB audio stream using MPlayer

DISCUSSION Eran Ben-Avi 2 participants 4 messages Jun 22, 2009 – Jun 23, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I encountered some issue with my USB audio device and couldn't find any similar issue in previous mailing lists, any help will be appreciated.
When playing an audio stream using MPlayer Ver1.0rc2-4.1.2 (tried different sample rates 44K, 48K and different files WAV , MP3) using my Creative SB0271 USB device on ARM based system(Marvell Kirkwood SoC) and kernel 2.6.22.18, I hear an interfering constant noise additionally to the original audio stream. At the beginning I heard this noise also when I used aplay(for WAV) but after I reinstalled the ALSA-LIB and ALSA-UTILS(version 1.0.14rc4), the aplay suddenly started to work smooth.
I tested different USB audio device(AKM) but got same noisy results.
Another piece of information I can provide is that increasing the CPU utilization eliminates the noise completely - maybe a timing issue ???

Any ideas ?

Thanks,
Eran.

#1 lore raw

At Mon, 22 Jun 2009 01:17:25 -0700 (PDT),

Quoted 9 lines · Eran Ben-Avi

Hi,

I encountered some issue with my USB audio device and couldn't find any similar issue in previous mailing lists, any help will be appreciated.
When playing an audio stream using MPlayer Ver1.0rc2-4.1.2 (tried different sample rates 44K, 48K and different files WAV , MP3) using my Creative SB0271 USB device on ARM based system(Marvell Kirkwood SoC) and kernel 2.6.22.18, I hear an interfering constant noise additionally to the original audio stream. At the beginning I heard this noise also when I used aplay(for WAV) but after I reinstalled the ALSA-LIB and ALSA-UTILS(version 1.0.14rc4), the aplay suddenly started to work smooth.
I tested different USB audio device(AKM) but got same noisy results.
Another piece of information I can provide is that increasing the CPU utilization eliminates the noise completely - maybe a timing issue ???

Could it be the cache coherency?
The usb-audio driver uses vmalloc'ed buffers as intermediate buffers, and they can be exposed to user-space via mmap.

Does the problem disappears when you disable mmap support by commenting out SNDRV_PCM_INFO_MMAP* in snd_usb_hardware info field?

Takashi

#2 lore raw

----- Original Message ----

Quoted 23 lines

From: Takashi Iwai <[email protected]>
To: Eran Ben-Avi <[email protected]>
Cc: [email protected]
Sent: Monday, June 22, 2009 7:41:19 PM
Subject: Re: [alsa-devel] Noisy USB audio stream using MPlayer

At Mon, 22 Jun 2009 01:17:25 -0700 (PDT),

Quoted 5 lines · Eran Ben-Avi

Hi,

I encountered some issue with my USB audio device and couldn't find any

similar issue in previous mailing lists, any help will be appreciated.

Quoted 1 line

When playing an audio stream using MPlayer Ver1.0rc2-4.1.2 (tried different

sample rates 44K, 48K and different files WAV , MP3) using my Creative SB0271 USB device on ARM based system(Marvell Kirkwood SoC) and kernel 2.6.22.18, I hear an interfering constant noise additionally to the original audio stream.

Quoted 1 line

At the beginning I heard this noise also when I used aplay(for WAV) but after

I reinstalled the ALSA-LIB and ALSA-UTILS(version 1.0.14rc4), the aplay suddenly started to work smooth.

Quoted 2 lines

I tested different USB audio device(AKM) but got same noisy results. Another piece of information I can provide is that increasing the CPU

Quoted 8 lines

utilization eliminates the noise completely - maybe a timing issue ???

Could it be the cache coherency?
The usb-audio driver uses vmalloc'ed buffers as intermediate buffers, and they can be  exposed to user-space via mmap.

Does the problem disappears when you disable mmap support by commenting out SNDRV_PCM_INFO_MMAP* in snd_usb_hardware info field?

When I disabled the mmap support I got the following messages while running the mplayer:

[AO_ALSA] alsa-lib: pcm_direct.c:874:(snd_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access
[AO_ALSA] alsa-lib: pcm_dmix.c:876:(snd_pcm_dmix_open) unable to initialize slave
[AO_ALSA] Playback open error: Invalid argument
Opening /dev/dvb/adapter0/audio0
DVB AUDIO DEVICE: No such file or directory

seems like ALSA-LIB doesn't really like it.

Thanks,
Eran

Quoted 7 lines

Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#3 lore raw

At Tue, 23 Jun 2009 03:03:43 -0700 (PDT),

Quoted 41 lines · Eran Ben-Avi

----- Original Message ----

Quoted 23 lines

From: Takashi Iwai <[email protected]>
To: Eran Ben-Avi <[email protected]>
Cc: [email protected]
Sent: Monday, June 22, 2009 7:41:19 PM
Subject: Re: [alsa-devel] Noisy USB audio stream using MPlayer

At Mon, 22 Jun 2009 01:17:25 -0700 (PDT),

Quoted 5 lines · Eran Ben-Avi

Hi,

I encountered some issue with my USB audio device and couldn't find any

similar issue in previous mailing lists, any help will be appreciated.

Quoted 1 line

When playing an audio stream using MPlayer Ver1.0rc2-4.1.2 (tried different

sample rates 44K, 48K and different files WAV , MP3) using my Creative SB0271 USB device on ARM based system(Marvell Kirkwood SoC) and kernel 2.6.22.18, I hear an interfering constant noise additionally to the original audio stream.

Quoted 1 line

At the beginning I heard this noise also when I used aplay(for WAV) but after

I reinstalled the ALSA-LIB and ALSA-UTILS(version 1.0.14rc4), the aplay suddenly started to work smooth.

Quoted 2 lines

I tested different USB audio device(AKM) but got same noisy results. Another piece of information I can provide is that increasing the CPU

Quoted 8 lines

utilization eliminates the noise completely - maybe a timing issue ???

Could it be the cache coherency?
The usb-audio driver uses vmalloc'ed buffers as intermediate buffers, and they can be  exposed to user-space via mmap.

Does the problem disappears when you disable mmap support by commenting out SNDRV_PCM_INFO_MMAP* in snd_usb_hardware info field?

When I disabled the mmap support I got the following messages while running the mplayer:

Quoted 8 lines

[AO_ALSA] alsa-lib: pcm_direct.c:874:(snd_pcm_direct_initialize_slave) slave plugin does not support mmap interleaved or mmap noninterleaved access
[AO_ALSA] alsa-lib: pcm_dmix.c:876:(snd_pcm_dmix_open) unable to initialize slave
[AO_ALSA] Playback open error: Invalid argument
Opening /dev/dvb/adapter0/audio0
DVB AUDIO DEVICE: No such file or directory

seems like ALSA-LIB doesn't really like it.

Because dmix requires the mmap explicitly by its nature.

Pass mplayer an appropriate option to use directly "hw" PCM device. (plughw might work with alsa-lib 1.0.20, too)

Takashi