Author Topic: CB4 linux audio playback and capture at the same time failed  (Read 1911 times)

Offline 蓝天-彭

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
CB4  linux  audio playback and capture  at the same time failed

i use  CB4 linaro desktop image ,   

capture audio use the alsa-lib command:
#arecord -vv -t wav -f S16_LE -c 2 -d 10 -r 24000 ./record.wav

at the same time i play audio using speaker test  or vlc player.
#speaker-test -t wav   or  # vlc test.mp4


the result is :  play audio failed and capture audio faield too.

Offline beerstein

  • Full Member
  • ***
  • Posts: 143
  • Karma: +4/-0
  • two beers or not two beers that is the question
    • View Profile
Re: CB4 linux audio playback and capture at the same time failed
« Reply #1 on: July 03, 2016, 01:18:17 pm »
Hi: This is a common problem with most Linux OSes. I came across it some years ago on Debian/Mint/Ubuntu based operating systems.I was asking questions in numerous forums and I never got a response. Finally after spending hundreds of hours unsuccessfully trying to bring sound to Firefox/Iceweasel/Epiphany and the like I discovered that the application: Pulseaudio is the key. Pulseaudio is a sound server which is not always installed with the basic version of Debian based operating systems. Pulseaudio hat a bad reputation in the past, but I like it.
Does sound  work in VLC or in the browser (Iceweasel) ? Or does sound work in both applications?
Do you get a sound (noise) while typing in command line interface:

$ speaker-test

Try to install pulseaudio and the pulseaudio gui, which is pavucontrol:
$ sudo apt-get update
$sudo apt-get install pulseaudio pavucontrol

Then start pavucontol from CLI or from the application icon on your desktop and check that all inputs and outputs are properly set up.
OK try that first and post back and I will try to help you get this thing done.

Offline 蓝天-彭

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: CB4 linux audio playback and capture at the same time failed
« Reply #2 on: July 06, 2016, 05:54:51 am »
Hi: This is a common problem with most Linux OSes. I came across it some years ago on Debian/Mint/Ubuntu based operating systems.I was asking questions in numerous forums and I never got a response. Finally after spending hundreds of hours unsuccessfully trying to bring sound to Firefox/Iceweasel/Epiphany and the like I discovered that the application: Pulseaudio is the key. Pulseaudio is a sound server which is not always installed with the basic version of Debian based operating systems. Pulseaudio hat a bad reputation in the past, but I like it.
Does sound  work in VLC or in the browser (Iceweasel) ? Or does sound work in both applications?
Do you get a sound (noise) while typing in command line interface:

$ speaker-test

Try to install pulseaudio and the pulseaudio gui, which is pavucontrol:
$ sudo apt-get update
$sudo apt-get install pulseaudio pavucontrol

Then start pavucontol from CLI or from the application icon on your desktop and check that all inputs and outputs are properly set up.
OK try that first and post back and I will try to help you get this thing done.


Thanks for advice. i have try as your advice.
$ sudo apt-get update
$sudo apt-get install pulseaudio pavucontrol

then i setting pulseaudio's   Configuration--》 snddaudio  profile : Analog Stereo Duplex 。

So now when i test  as following

capture audio use the alsa-lib command:
#arecord -vv -t wav -f S16_LE -c 2 -d 10 -r 24000 ./test.wav

at the same time i play audio using speaker test  or chromium
#speaker-test -t wav   or   chromium

the play audio is normal, and the audio can capture but the  capture 's audio is no normal.  t the captured audio is no continuous.   i have upload it to web cloud :http://pan.baidu.com/s/1nv3wdZj

Do you have any good idea? do you try it in cb4 board?

Offline beerstein

  • Full Member
  • ***
  • Posts: 143
  • Karma: +4/-0
  • two beers or not two beers that is the question
    • View Profile
Re: CB4 linux audio playback and capture at the same time failed
« Reply #3 on: July 06, 2016, 02:05:59 pm »
nope - I use the cubieboard 3 (Cubitruck) with the Debian 8 Wheezy 3.4.106 (March 28, 2015 version)
DE=Xfce4.1, HDMI video ans ound goes to the 3.5mm audio output.
I will go back o the system within the next few days and will post my pavucontrol settings. In the meantime you can play around with various settings and watch the "input" part of pavucontrol. The bar should be moving according sound  levels.

Offline 蓝天-彭

  • Newbie
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: CB4 linux audio playback and capture at the same time failed
« Reply #4 on: July 06, 2016, 10:55:12 pm »
nope - I use the cubieboard 3 (Cubitruck) with the Debian 8 Wheezy 3.4.106 (March 28, 2015 version)
DE=Xfce4.1, HDMI video ans ound goes to the 3.5mm audio output.
I will go back o the system within the next few days and will post my pavucontrol settings. In the meantime you can play around with various settings and watch the "input" part of pavucontrol. The bar should be moving according sound  levels.

beerstein, I have try  different setting, it still has same problem.

In A20, i don't use pulseaudio and it can normaly record audio and play audio at the same time.
i have test it just now.   i use the new cb2 (wich mic ).
image:http://dl.cubieboard.org/model/CubieBoard2/CubieBoard2-20151211-EMMC/Image/Ubuntu-linaro-desktop/V-1.0/

test way is same:
capture audio use the alsa-lib command:
#arecord -vv -t wav -f S16_LE -c 2 -d 10 -r 24000 ./record.wav

at the same time i play audio
#speaker-test -t wav   

it seem that the CB4 sound drivers maybe has problem. do yo think? 
Still send your pavucontrol settings, i will try it .   if you have cb4 board, help to try it .
Thanks a lot.