0

I've installed Alsamixer from Google Play.

Gadget is Samsung Galaxy S3.

It has one soundcard (indexed as 0), and 4 devices (0-3). The device list (from /proc/asound/devices) is the following:

 0: [ 0]   : control
16: [ 0- 0]: digital audio playback
17: [ 0- 1]: digital audio playback
18: [ 0- 2]: digital audio playback
19: [ 0- 3]: digital audio playback
24: [ 0- 0]: digital audio capture
25: [ 0- 1]: digital audio capture
26: [ 0- 2]: digital audio capture
27: [ 0- 3]: digital audio capture
33:        : timer

So pcms list from /dev/snd is

crwxrwxrwx system   audio    116,   0 2014-01-16 12:56 controlC0
crwxrwxrwx system   audio    116,  24 2014-01-16 12:56 pcmC0D0c
crwxrwxrwx system   audio    116,  16 2014-01-16 12:56 pcmC0D0p
crwxrwxrwx system   audio    116,  25 2014-01-16 12:56 pcmC0D1c
crwxrwxrwx system   audio    116,  17 2014-01-16 12:56 pcmC0D1p
crwxrwxrwx system   audio    116,  26 2014-01-16 12:56 pcmC0D2c
crwxrwxrwx system   audio    116,  18 2014-01-16 12:56 pcmC0D2p
crwxrwxrwx system   audio    116,  27 2014-01-16 12:56 pcmC0D3c
crwxrwxrwx system   audio    116,  19 2014-01-16 12:56 pcmC0D3p
crwxrwxrwx system   audio    116,  33 2014-01-16 12:56 timer

alsa_aplay can playback sound ok, but when i try to record it records only noise or emptiness. By experiments i found out that sound can be only 'recorded' with 3-rd device, so the call is:

alsa_aplay -C -D hw:0,3 -r 44100 -f S16_LE -c 1 -d 2 /foo.wav

when hw:0,1 or other is specified i get "pcm_read: read error: invalid argument".

We tried different sampling rates and other arguments.

The same thing happens when i try to record with C-code (jni).

With devices 0-2 it has run-time errors. With device 3 in pcm_read function it infinitely records emptiness.

We use tinyalsa.

Also i tried to manage the devices from Alsamixer app list, i've set most of them into 100% (don't know which stays for the recorder, so set all) but no effect.

Thanks for your response.

silver_rocket
  • 418
  • 1
  • 4
  • 15
  • And what is your question? – CL. Jan 21 '14 at 14:38
  • How to make the things work properly and to record sound? What adjustments i need to do, and what things to check? – silver_rocket Jan 21 '14 at 14:47
  • Use the same device and configuration that Samsung uses. – CL. Jan 21 '14 at 15:04
  • Isn't there a duration/time option for `arec` (like `-T ` or something like that)? Anyway, to record something you'll have to set up the audio path properly, and this requires you to be familiar with the platform used in your phone and the ALSA controls it provides. – Michael Jan 21 '14 at 15:53
  • @Michael `-d` is the parameter you talking about, it stays for duration. It is not actually the problem, even when making recording in code, cause you can manually insert `break` into recording process after some loops or something like that. And what do you mean by 'audio path'? – silver_rocket Jan 24 '14 at 11:26
  • @CL. ,Michael, Any advices where to get desired config information? Google does not help much. Would appreciate that. I also had a glance on gadget's soundcard (it appears to be WM1811) datasheet, still no clue. – silver_rocket Jan 24 '14 at 11:27
  • 1
    You need to know how exactly the various chips are connected. Samsung is unlikely to have published this information. – CL. Jan 24 '14 at 11:32
  • 1
    @degot: By the audio path I mean that all the necessary blocks in the hardware codec need to be enabled / configured (the right ADCs need to be selected, the gain values need to be set, etc). This is usually done by writing to a set of ALSA controls, but these controls aren't the same across different platforms, so you need to be familiar with the particular platform that you're targeting. Typically you can find useful info in the ALSA SoC drivers and the hardware codec documentation provided by the platform vendor (which may only be available to partner companies). – Michael Jan 24 '14 at 14:31
  • @Michael Well ok, it seems i need to dig deeper into docs. Thanks for advice. – silver_rocket Jan 24 '14 at 15:00

0 Answers0