LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Error enabling dmix with ALSA (http://www.linuxquestions.org/questions/linux-software-2/error-enabling-dmix-with-alsa-747746/)

RuchiS 08-15-2009 08:55 AM

Error enabling dmix with ALSA
 
Hi,

I am trying to enable a software mixer (using ALSA and dmix) on an OMAP3 based embedded target board using the twl4030 codec.

When I try to play audio using the command,

# aplay -D playback rec.wav

I am getting the following error:

ALSA lib pcm_direct.c:1098:(snd_pcm_direct_initialize_poll_fd) unable to
open timer 'hw:CLASS=3,SCLASS=0,CARD=0,DEV=0,SUBDEV=0'
ALSA lib pcm_dmix.c:943:(snd_pcm_dmix_open) unable to initialize poll_fd
aplay: main:546: audio open error: No such file or directory

The contents of my /etc/asound.conf is given below.

pcm.playback {
type dmix
ipc_key 2048
ipc_key_add_uid true
ipc_gid 1
slave {
rate 44100
pcm hw:0
}
}

I have tested it on two kernel versions, 2.6.22 and 2.6.29, but it fails on both.
Playback and recording works fine if -D option is not provided.

I also tried configuring ALSA (dmix) with a different configuration file which is given in the following link:
http://amarok.kde.org/wiki/Setting_up_Dmix_for_ALSA

# aplay -D plug:ossmix /mnt/Audio1_1.wav
ALSA lib pcm_direct.c:1098:(snd_pcm_direct_initialize_poll_fd) unable to open timer 'hw:CLASS=3,SCLASS=0,CARD=0,DEV=0,SUBDEV=0'
ALSA lib pcm_dmix.c:943:(snd_pcm_dmix_open) unable to initialize poll_fd
aplay: main:546: audio open error: No such file or directory

But as you can see the same error turns up again.

What could be the cause of this error?

Is the above error related to ALSA configuration (for dmix)?
Do I need to patch the kernel or ALSA for using dmix?

Please help me resolve this issue. Let me know if any more setup info is required.

Thanks and Regards,

Ruchi

======================================================================


Some information I obtained from the proc filesystem is given below for your reference.

-----------------------
For Linux kernel 2.6.29
-----------------------

[root@OMAP3 tests]# cat /proc/asound/version
Advanced Linux Sound Architecture Driver Version 1.0.19


[root@OMAP3 tests]# cat /proc/asound/cards
0 [omap3evm ]: twl4030 - omap3evm
omap3evm (twl4030)

[root@OMAP3 tests]# omap-dss: Could not find exact pixel clock. Requested 25188 kHz, got 25187 kHz

[root@OMAP3 tests]# cat /proc/asound/devices
2: : timer
3: [ 0- 0]: digital audio playback
4: [ 0- 0]: digital audio capture
5: [ 0] : control

[root@OMAP3 tests]# cat /proc/asound/timers
G0: system timer : 7812.500us (10000000 ticks)
P0-0-0: PCM playback 0-0-0 : SLAVE
P0-0-1: PCM capture 0-0-1 : SLAVE

[root@OMAP3 tests]# cat /proc/asound/pcm
00-00: TWL4030 twl4030-0 : : playback 1 : capture 1

[root@OMAP3 tests]# cat /proc/asound/devices
2: : timer
3: [ 0- 0]: digital audio playback
4: [ 0- 0]: digital audio capture
5: [ 0] : control

[root@OMAP3 tests]# cat /proc/asound/pcm
00-00: TWL4030 twl4030-0 : : playback 1 : capture 1

[root@OMAP3 tests]# cat /proc/asound/oss/devices
3: [0- 0]: digital audio
4: [0- 0]: digital audio

[root@OMAP3 tests]# cat /proc/asound/oss/sndstat
Sound Driver:3.8.1a-980706 (ALSA v1.0.19 emulation code)
Kernel: Linux OMAP3 2.6.29-rc3-omap1 #1 Fri Jul 24 14:45:37 IST 2009 armv7l
Config options: 0
Installed drivers:
Type 10: ALSA emulation

Card config:
omap3evm (twl4030)

Audio devices:
0: (DUPLEX)

Synth devices: NOT ENABLED IN CONFIG

Midi devices: NOT ENABLED IN CONFIG

Timers:
31: system timer

Mixers: NOT ENABLED IN CONFIG

[root@OMAP3 tests]# aplay -D playback /mnt/Audio1_1.wav
ALSA lib pcm_direct.c:1098:(snd_pcm_direct_initialize_poll_fd) unable to open timer 'hw:CLASS=3,SCLASS=0,CARD=0,DEV=0,SUBDEV=0'
ALSA lib pcm_dmix.c:943:(snd_pcm_dmix_open) unable to initialize poll_fd
aplay: main:546: audio open error: No such file or directory


-----------------------
For Linux kernel 2.6.22
-----------------------

[root@OMAP3 tests]# cat /proc/asound/devices
2: : timer
3: [ 0- 0]: digital audio playback
4: [ 0- 0]: digital audio capture
5: [ 0] : control

[root@OMAP3 tests]# cat /proc/asound/pcm
00-00: OMAP PCM : omap alsa pcm : playback 1 : capture 1

[root@OMAP3 tests]# cat /proc/asound/timers
G0: system timer : 7812.500us (10000000 ticks)
P0-0-0: PCM playback 0-0-0 : SLAVE
P0-0-1: PCM capture 0-0-1 : SLAVE

[root@OMAP3 tests]# cat /proc/asound/
/proc/asound/TWL4030/ /proc/asound/devices /proc/asound/timers
/proc/asound/card0/ /proc/asound/hwdep /proc/asound/version
/proc/asound/cards /proc/asound/pcm

[root@OMAP3 tests]# cat /proc/asound/cards
0 [TWL4030 ]: OMAP_ALSA - TWL4030
TWL4030

/proc/asound/oss was not found in the proc file system when booted with kernel 2.6.22.

mushroomboy 08-16-2009 08:49 PM

because you don't need -D, that's to select device and this '# aplay -D playback rec.wav' has no device in it!

Code:

xxx@debian:~$ aplay --help
Usage: aplay [OPTION]... [FILE]...

-h, --help              help
    --version          print current version
-l, --list-devices      list all soundcards and digital audio devices
-L, --list-pcms        list device names
-D, --device=NAME      select PCM by name
-q, --quiet            quiet mode
-t, --file-type TYPE    file type (voc, wav, raw or au)
-c, --channels=#        channels
-f, --format=FORMAT    sample format (case insensitive)
-r, --rate=#            sample rate
-d, --duration=#        interrupt after # seconds
-M, --mmap              mmap stream
-N, --nonblock          nonblocking mode
-F, --period-time=#    distance between interrupts is # microseconds
-B, --buffer-time=#    buffer duration is # microseconds
    --period-size=#    distance between interrupts is # frames
    --buffer-size=#    buffer duration is # frames
-A, --avail-min=#      min available space for wakeup is # microseconds
-R, --start-delay=#    delay for automatic PCM start is # microseconds
                        (relative to buffer size if <= 0)
-T, --stop-delay=#      delay for automatic PCM stop is # microseconds from xru
-v, --verbose          show PCM structure and setup (accumulative)
-V, --vumeter=TYPE      enable VU meter (TYPE: mono or stereo)
-I, --separate-channels one file for each channel
    --disable-resample  disable automatic rate resample
    --disable-channels  disable automatic channel conversions
    --disable-format    disable automatic format conversions
    --disable-softvol  disable software volume control (softvol)
    --test-position    test ring buffer position
    --test-coef=#        test coeficient for ring buffer position (default 8)
                        expression for validation is: coef * (buffer_size / 2)
    --test-nowait      do not wait for ring buffer - eats whole CPU
Recognized sample formats are: S8 U8 S16_LE S16_BE U16_LE U16_BE S24_LE S24_BE
24_LE U24_BE S32_LE S32_BE U32_LE U32_BE FLOAT_LE FLOAT_BE FLOAT64_LE FLOAT64_B
 IEC958_SUBFRAME_LE IEC958_SUBFRAME_BE MU_LAW A_LAW IMA_ADPCM MPEG GSM SPECIAL
24_3LE S24_3BE U24_3LE U24_3BE S20_3LE S20_3BE U20_3LE U20_3BE S18_3LE S18_3BE
18_3LE
Some of these may not be available on selected hardware
The availabled format shortcuts are:
-f cd (16 bit little endian, 44100, stereo)
-f cdr (16 bit big endian, 44100, stereo)
-f dat (16 bit little endian, 48000, stereo)
xxx@debian:~$

[edit] awh i forgot, dmix is in by default as of 1.0.9rc2, you seem to have 1.0.19. I'm guessing you don't need to mess with dmix, but if you wan the -D flag you are going to have to specifiy a defice /dev/snd or something. but if sound already works than i wouldn't bother with that either.


All times are GMT -5. The time now is 12:48 AM.