Code Monkey home page Code Monkey logo

ar9331-i2s-alsa's People

Contributors

franzflasch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ar9331-i2s-alsa's Issues

which version is most current ?

Github has FranzFlasch and enc-X, which version is most current and/or what are the differences ??
also, what is the difference between I2S and PCM.... Ar9331 has these two, but i am not sure when connecting to a gsm modem, whether i2S or pcm should be used ?
thanks

Testing audio capture

Hi Franz
(thank you for share your job)

I've been using this driver module without problems. It works flawlessly with all the software I've tested (mpd, ffmpeg, madplay, alsa, pulseaudio).
Now I want to use audio input. For such purpose I've modified wm8727.c file in order to add a capture interface like this:

static const struct snd_soc_dapm_widget wm8727_dapm_widgets[] = {
SND_SOC_DAPM_OUTPUT("VOUTL"),
SND_SOC_DAPM_OUTPUT("VOUTR"),
SND_SOC_DAPM_INPUT("VINL"),
SND_SOC_DAPM_INPUT("VINR"),
};

static const struct snd_soc_dapm_route wm8727_dapm_routes[] = {
	{ "VOUTL", NULL, "Playback" },
	{ "VOUTR", NULL, "Playback" },
	{ "VINL", NULL, "Capture" },
	{ "VINR", NULL, "Capture" },
};

/*
 * Note this is a simple chip with no configuration interface, sample rate is
 * determined automatically by examining the Master clock and Bit clock ratios
 */
#define WM8727_RATES  (SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 |\
			SNDRV_PCM_RATE_48000 | SNDRV_PCM_RATE_96000 |\
			SNDRV_PCM_RATE_192000)


static struct snd_soc_dai_driver wm8727_dai = {
	.name = "wm8727-hifi",
	.playback = {
		.stream_name = "Playback",
		.channels_min = 2,
		.channels_max = 2,
		.rates = WM8727_RATES,
		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
		},
    .capture = {
		.stream_name = "Capture",
		.channels_min = 2,
		.channels_max = 2,
		.rates = WM8727_RATES,
		.formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE,
		},
};

Now besides the playback interface, I can see the capture interface:

cat /proc/asound/Carambola2/pcm0c/info
card: 0
device: 0
subdevice: 0
stream: CAPTURE
id: Carambola2 audio wm8727-hifi-0
name: 
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 1
subdevices_avail: 1

But when I run "arecord -fcd" command all I get is:

root@OpenWrt:/# arecord -f cd
[68255.670000] ath79_i2s_startup
[68255.670000] ath79_stereo_reset
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, [68255.680000] ath79_i2s_hw_params
[68255.690000] Set clk config: 11-b726-2 for freq: 44100
[68255.690000] ath79_stereo_reset
[68255.690000] ath79_stereo_reset
[68255.700000] ath79_i2s_trigger
Stereo
RIFF$�WAVEfmt D��data�[68256.270000] ath79_i2s_trigger
[68256.780000] ath79_stereo_reset
[68256.780000] ath79_i2s_trigger
overrun!!! (at least 476.617 ms long)
[68257.330000] ath79_i2s_trigger
[68257.510000] ath79_stereo_reset
[68257.510000] ath79_i2s_trigger
overrun!!! (at least 143.291 ms long)
[68258.050000] ath79_i2s_trigger
[68258.230000] ath79_stereo_reset
[68258.240000] ath79_i2s_trigger
overrun!!! (at least 143.281 ms long)
[68258.480000] ath79_i2s_trigger
[68258.510000] ath79_i2s_shutdown
...

Please, could you help me in order to debug further such situation or give some clue in order to resolve it?

Regards,
Sergios

Audio input left right randomly

Hi franz

I've detected that running an arecord command, and connecting audio source to left channel, sometimes stores data on the left buffer, and sometimes stores data on the right buffer.

Basically I run a command like "arecord -fcd -vumeter = stereo > / dev / null " and sometimes it returns (I use /dev/null to discard audio but same result writing to temporary storage, thank you for the tip).

  • ############### 47% | 00%
    And sometimes returns:
  • 00% | 47% ################ +

This behaviour seems to be random, not sure about any cause of it.
Could you please give some clue in order to debug further this issue?

Regards,
Sergio

Unknown symbol snd_jack_report

Hi franz

Thank you for share this git repo.

I'm trying to test audio in my AR9331 board (SKW71),with 3.10.44 kernel version and whenever I run:

root@OpenWrt:/# insmod ath79-i2s.ko
[30030.600000] ath79_i2s: Unknown symbol snd_soc_unregister_component (err 0)
[30030.610000] ath79_i2s: Unknown symbol snd_soc_register_component (err 0)
kmod: failed to insert /lib/modules/3.10.44/ath79-i2s.ko

Seems like snd-soc-core module isn't loaded. Then i run
insmod snd-soc-core.ko
[29845.960000] snd_soc_core: Unknown symbol snd_jack_report (err 0)
[29845.970000] snd_soc_core: Unknown symbol snd_jack_new (err 0)
kmod: failed to insert /lib/modules/3.10.44/snd-soc-core.ko

Seems like jack.c file isn't not linked together with the kernel, but my .config file it's showing CONFIG_SND_JACK=y.

Please can you guide me on how to debug it or go forward in order to test your module?

sergio

can not make the module.

I have build openwrt SDK for source for AR9331 soc. I have successfully build helloworld program with this SDK. I kept the helloworld folder in package folder of SDK topdir. inside helloworld folder there is a src filder containing helloworld.c along with a Makefile. I run make command from SDK topdir.

To build your i2s module I unzip ar9331-i2s-alsa-master.zip at package folder and run make V=s from SDK topdir but nothing build. console message make[2]: Nothing to be done for `package/compile'.

Please help me to build the kernel module. I am using Ubuntu 14.04 host

Thanks & regards
/jags

output nothing except DC noise !

franz:
I've migrated this code to lower version kernel of 2.6.31, the audio codec is wm8731,control interface is i2c that is simulated by gpio,but only DC noise output when play music file, can you give some debug hint ?

snd_soc_register_component cannot find when compiling

Hi Franz,
I run this code on linux3.38 ,snd_soc_register_component cannot find when compiling,so I changed "return snd_soc_register_component(&pdev->dev, &ath79_i2s_component, &ath79_i2s_dai, 1);" to "return snd_soc_register_dai(&pdev->dev, &ath79_i2s_dai);" ,but when insmod ath79-i2s.ko I got some error as below:
Apr 2 16:43:11 OpenWrt kern.warn kernel: [ 3075.270000] ath79_i2s: Unknown symbol snd_soc_register_dai (err 0)
Apr 2 16:43:11 OpenWrt kern.warn kernel: [ 3075.280000] ath79_i2s: Unknown symbol snd_soc_unregister_dai (err 0)

what should I do to fix above error? thanks

how to test it after inserting modules ?

Hi Franz,
all the modules have been inserted , but seems not works. there is no controlC0,seq etc under /dev/snd/ ,below are some information ,thanks very much if you can help
root@OpenWrt:~# dmesg
.................only print those info
[ 185.900000] ath_audio_init
[ 242.710000] ath79_i2s_drv_probe
[ 242.710000] ath79_stereo_reset
[ 267.790000] ath79_soc_platform_probe

root@OpenWrt:# cat /proc/s
self/ softirqs stat swaps sys/ sysrq-trigger sysvipc/
root@OpenWrt:
# cat /proc/asound/devices
33: : timer
root@OpenWrt:~# ls -l /dev/snd/
crw-r--r-- 1 root root 116, 33 Jan 1 1970 timer

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.