Problems using Java to record audio using Alsa on Intel Edison

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

 



Hi,


I am quite new to this topic, so please forgive me if I am asking stupid questions. I did quite some searches in google, and tried all different things for about 3 full days, but I'm sort of stuck.


I setup a WM8731 chip (http://www.mikroe.com/add-on-boards/audio-voice/audio-codec-proto/) to act as a sound-card on my Intel Edison system. I tried both the approach of manually setting up the sound hardware using manual i2c commands as well as using a system driver for that chipset. In both cases it was easy to setup everything to play audio. Now I was trying to record audio via microphone. In any case all I got was silence with clicking sounds in the recording. 


As the only source and target for any audio information is one single Java application, I decided to stick to the dummy audio driver and to setup the sound chip by setting the i2c registers from inside the Java application. It worked great for the audio output. The input only produces these clicking sounds :-(


Now I dumped the settings from pactl:

Source #1
State: SUSPENDED
Name: alsa_input.platform-merr_dpcm_dummy.0.analog-stereo
Description: dummy-audio Analog Stereo
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 48000Hz
Channel Map: front-left,front-right
Owner Module: 1
Mute: no
Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
Base Volume: 65536 / 100% / 0.00 dB
Monitor of Sink: n/a
Latency: 0 usec, configured 0 usec
Flags: HARDWARE DECIBEL_VOLUME LATENCY
Properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = ""
alsa.id = "14"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "1"
alsa.card_name = "dummy-audio"
alsa.long_card_name = "dummy-audio"
device.bus_path = "platform-merr_dpcm_dummy.0"
sysfs.path = "/devices/platform/merr_dpcm_dummy.0/sound/card1"
device.string = "hw:1"
device.buffering.buffer_size = "96000"
device.buffering.fragment_size = "48000"
device.access_mode = "mmap+timer"
device.profile.name = "analog-stereo"
device.profile.description = "Analog Stereo"
device.description = "dummy-audio Analog Stereo"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
Ports:
analog-input: Analog Input (priority: 10000)
Active Port: analog-input
Formats:
pcm
Then I created a small program to dump the settings from inside java:

Name: dummyaudio [plughw:1,0], description: Direct Audio Device: dummy-audio, 14,

-----------------------------------
Source Lines
-----------------------------------
Line.Info: interface SourceDataLine supporting 8 audio formats, and buffers of at least 32 bytes
- Format: Sample Rate: 44100.0, Frame Size: 4, Sample Size (bits): 16, Channels: 2, Big Endian: false, Encoding: PCM_SIGNED
Line.Info: interface Clip supporting 8 audio formats, and buffers of at least 32 bytes
- Format: Sample Rate: 44100.0, Frame Size: 4, Sample Size (bits): 16, Channels: 2, Big Endian: false, Encoding: PCM_SIGNED
-----------------------------------
Target Lines
-----------------------------------
Line.Info: interface TargetDataLine supporting 8 audio formats, and buffers of at least 32 bytes
- Format: Sample Rate: 44100.0, Frame Size: 4, Sample Size (bits): 16, Channels: 2, Big Endian: false, Encoding: PCM_SIGNED
So the funny thing is that Alsa is claiming to use a sample rate of 44100, but Alsa is using 48000, the rest seems to match. Is this correct?

Does anyone have an idea why all I am getting is these clicking sounds? Help greatly appreciated :-)

Chris






------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux