Skip to contentSkip to conversation

How to choose output channels for AD1386A sound?

DISCUSSION Ihar Hrachyshka 2 participants 4 messages Apr 17, 2008 – Apr 21, 2008

lore
Share & tools
lore
#0 lore raw

Hello!
I build my BF533-EZKIT-based board (Blackfin processor development board) sound system on AD1386A sound. I use blackfin.uclinux.org distribution for it. One of my board's function is to play three different stereo sound streams simultaneously on it. What I done is choosing for AD1386 '3 stereos' option. After loading the kernel, my software is able to open pcm 3 times and plays sound properly, with no glitches or smth. The only missed functionality is that I can't specify the needed subdevice I want to play a stream on. I should have the possibility to play, f.e., mplayer stream on the 3rd stereo output while the 1st and the 2nd are not used. How can I do it? Also that would be great if I can optionally play the same stream on all the outputs.
If I'm not wrong, this can be made through asound.conf settings though I can't figer out what are the right values. If I can choose next used output through kernel interface (kobject value or smth) then please tell me where should I look into.

Here are some info (line-in playing on the 1st subdevice):

root:~> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ad1836 [ADI ad1836], device 0: AD1836_PCM [AD1836_PCM]
Subdevices: 2/3
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2

root:~> cat /proc/asound/devices
0: [ 0] : control
16: [ 0- 0]: digital audio playback
24: [ 0- 0]: digital audio capture
33: : timer

root:~> cat /proc/asound/pcm
00-00: AD1836_PCM : AD1836_PCM : playback 3 : capture 1

root:~> cat /proc/asound/cards
0 [ad1836 ]: AD1836 - ADI ad1836
ADI ad1836 at PF4 SPORT0 rx/tx dma 1/2 err irq 10

root:~> cat /proc/asound/ad1836/registers
DAC_CTRL_1 0x0000
DAC_CTRL_2 0x1000
DAC_VOL_1L 0x23ff
DAC_VOL_1R 0x33ff
DAC_VOL_2L 0x43fa
DAC_VOL_2R 0x53fa
DAC_VOL_3L 0x63fa
DAC_VOL_3R 0x73fa
ADC_PEAK_1L 0xffff -63 dBFS
ADC_PEAK_1R 0xffff -63 dBFS
ADC_PEAK_2L 0xffff -63 dBFS
ADC_PEAK_2R 0xffff -63 dBFS
ADC_CTRL_1 0xc000
ADC_CTRL_2 0xd180
ADC_CTRL_3 0xe03a

root:~> cat /proc/asound/ad1836/pcm0p/info
card: 0
device: 0
subdevice: 0
stream: PLAYBACK
id: AD1836_PCM
name: AD1836_PCM
subname: subdevice #0
class: 0
subclass: 0
subdevices_count: 3
subdevices_avail: 2

root:~> ls /proc/asound/ad1836/pcm0p/
info oss sub0 sub1 sub2 xrun_debug

root:~> cat /proc/asound/ad1836/pcm0p/sub0/status
state: RUNNING
trigger_time: 1208611073.963748000
tstamp : 1208611991.506408000
delay : 6441
avail : 1751
avail_max : 6188
-----
hw_ptr : 44035799
appl_ptr : 44042240

root:~> cat /proc/asound/ad1836/pcm0p/sub1/status
closed

root:~> cat /proc/asound/ad1836/pcm0p/sub2/status
closed

Thanks for help.

#1 lore raw

At Thu, 17 Apr 2008 10:27:59 +0000,

Quoted 12 lines · Ihar Hrachyshka

Hello!
I build my BF533-EZKIT-based board (Blackfin processor development board) sound system on AD1386A sound. I use blackfin.uclinux.org distribution for it. One of my board's function is to play three different stereo sound streams simultaneously on it. What I done is choosing for AD1386 '3 stereos' option. After loading the kernel, my software is able to open pcm 3 times and plays sound properly, with no glitches or smth. The only missed functionality is that I can't specify the needed subdevice I want to play a stream on. I should have the possibility to play, f.e., mplayer stream on the 3rd stereo output while the 1st and the 2nd are not used. How can I do it?

You can pass three numbers to PCM arguments: card, device and subdevice. For example, the below will choose card = 0, device = 2, subdevice = 1, i.e. the secondary substream:

	% aplay -Dplughw:0,2,1
Quoted 2 lines

Also that would be great if I can optionally play the same stream on all the outputs.

You'll need to define a PCM with multi plugin.

Takashi

#2 lore raw
Quoted 16 lines · Takashi Iwai

At Thu, 17 Apr 2008 10:27:59 +0000,

Quoted 12 lines · Ihar Hrachyshka

Hello!
I build my BF533-EZKIT-based board (Blackfin processor development board) sound system on AD1386A sound. I use blackfin.uclinux.org distribution for it. One of my board's function is to play three different stereo sound streams simultaneously on it. What I done is choosing for AD1386 '3 stereos' option. After loading the kernel, my software is able to open pcm 3 times and plays sound properly, with no glitches or smth. The only missed functionality is that I can't specify the needed subdevice I want to play a stream on. I should have the possibility to play, f.e., mplayer stream on the 3rd stereo output while the 1st and the 2nd are not used. How can I do it?

Quoted 4 lines

You can pass three numbers to PCM arguments: card, device and subdevice. For example, the below will choose card = 0, device = 2, subdevice = 1, i.e. the secondary substream:

        % aplay -Dplughw:0,2,1

That's what I've done:

# arecord -c 2 -f dat -d 30 a.wav
# aplay -Dplughw:0,0,0 a.wav
ALSA sound/blackfin/ad1836.c:924: snd_ad1836_playback_open
Playing WAVE 'aAwLvS A  isnodu1n di/ biltaecEkdfai,nR/ta d8108 3z6 .tcr:o1

046: snd_ad1836_hw_free
ALSA lib ../../../alsa-lib-1.0.12-svn-rev6478/src/pcm/pcm_plug.c:773:(snd_pcm_plug_hw_refine_schange) find an usable access for 'plughw:0,0,0'
aplay: set_params:904: Sample format non available

# arecord -c 2 -f S32_LE -d 30 a.wav
# aplay -Dplughw:0,0,0 a.wav
ALSA sound/blackfin/ad1836.c:924: snd_ad1836_playback_open
Playing WAVEA'L.SaA' :sSoguen d2/bbtlLatclk fniinn/ aade18803 6z. ct:r1o0

46: snd_ad1836_hw_free
ALSA lib ../../../alsa-lib-1.0.12-svn-rev6478/src/pcm/pcm_plug.c:773:(snd_pcm_plug_hw_refine_schange) to find an usable access for 'plughw:0,0,0'
aplay: ../../aplay/aplay.c: 919: set_params: Assertion `err >= 0' failed.
Aborted by signal Aborted...

Though ALSA shows that I have 3 subdevices it doesn't work with plughw:0,0,0..2. What else can I do to iinvestigate the problem?

Quoted 10 lines
Quoted 4 lines

Also that would be great if I can optionally play the same stream on all the outputs.

You'll need to define a PCM with multi plugin.

Takashi

#3 lore raw

At Mon, 21 Apr 2008 10:45:51 +0300,

Quoted 29 lines · Ihar Hrachyshka
Quoted 16 lines · Takashi Iwai

At Thu, 17 Apr 2008 10:27:59 +0000,

Quoted 12 lines · Ihar Hrachyshka

Hello!
I build my BF533-EZKIT-based board (Blackfin processor development board) sound system on AD1386A sound. I use blackfin.uclinux.org distribution for it. One of my board's function is to play three different stereo sound streams simultaneously on it. What I done is choosing for AD1386 '3 stereos' option. After loading the kernel, my software is able to open pcm 3 times and plays sound properly, with no glitches or smth. The only missed functionality is that I can't specify the needed subdevice I want to play a stream on. I should have the possibility to play, f.e., mplayer stream on the 3rd stereo output while the 1st and the 2nd are not used. How can I do it?

Quoted 4 lines

You can pass three numbers to PCM arguments: card, device and subdevice. For example, the below will choose card = 0, device = 2, subdevice = 1, i.e. the secondary substream:

        % aplay -Dplughw:0,2,1

That's what I've done:

# arecord -c 2 -f dat -d 30 a.wav
# aplay -Dplughw:0,0,0 a.wav
ALSA sound/blackfin/ad1836.c:924: snd_ad1836_playback_open
Playing WAVE 'aAwLvS A  isnodu1n di/ biltaecEkdfai,nR/ta d8108 3z6 .tcr:o1
Quoted 4 lines
   046: snd_ad1836_hw_free

ALSA lib ../../../alsa-lib-1.0.12-svn-rev6478/src/pcm/pcm_plug.c:773:(snd_pcm_plug_hw_refine_schange) find an usable access for 'plughw:0,0,0'
aplay: set_params:904: Sample format non available

The problem seems different. I guess you can't run with 'plughw:0' as well? According to the message, the sample format isn't available although wrapped with plug layer. Did you install all alsa-lib plugins properly? If you don't pass any configure options, all plugins should be built.

Takashi

Quoted 29 lines
# arecord -c 2 -f S32_LE -d 30 a.wav
# aplay -Dplughw:0,0,0 a.wav
ALSA sound/blackfin/ad1836.c:924: snd_ad1836_playback_open
Playing WAVEA'L.SaA' :sSoguen d2/bbtlLatclk fniinn/ aade18803 6z. ct:r1o0

46: snd_ad1836_hw_free
ALSA lib ../../../alsa-lib-1.0.12-svn-rev6478/src/pcm/pcm_plug.c:773:(snd_pcm_plug_hw_refine_schange) to find an usable access for 'plughw:0,0,0'
aplay: ../../aplay/aplay.c: 919: set_params: Assertion `err >= 0' failed.
Aborted by signal Aborted...

Though ALSA shows that I have 3 subdevices it doesn't work with plughw:0,0,0..2. What else can I do to iinvestigate the problem?

Quoted 10 lines
Quoted 4 lines

Also that would be great if I can optionally play the same stream on all the outputs.

You'll need to define a PCM with multi plugin.

Takashi

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