ALSA Issue/question

Please reproduce your error on a second machine before posting, and check the error by running without saved changes or extra modules (See FAQ No. 13, "How to report a bug"). For unstable Porteus versions (alpha, beta, rc) please use the relevant thread in our "Development" section.
Post Reply
sci_fi
Black ninja
Black ninja
Posts: 52
Joined: 28 Dec 2010, 18:25

ALSA Issue/question

Post#1 by sci_fi » 06 Aug 2011, 20:35

I am unable to get my microphone working. I am running Porteus V1.0 64 bit on an Acer AO-722. Although my sound card shows up as a capture device, the appropriate ALSA modules don't appear to be there. I am only loading ALSA from the base Porteus modules, nothing else. Is there a flag or something I should be setting to get the appropriate modules loaded.


bash-4.1# arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: SB [HDA ATI SB], device 0: HDA Generic [HDA Generic]
Subdevices: 1/1
Subdevice #0: subdevice #0


arecord error message:
bash-4.1# arecord -d 5 test
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
arecord: main:660: audio open error: Invalid argument


thank you for any advice.

Best regards,

sci_fi

User avatar
fanthom
Site Admin
Site Admin
Posts: 4547
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: ALSA Issue/question

Post#2 by fanthom » 08 Aug 2011, 04:04

@sci_fi
i think the problem remains the same: your default sound card for capturing is still ATI HDMI. please try asoundconf script mentioned in this post:
http://porteus.org/forum/viewtopic.php? ... 5714#p5714
it should set properly both: capture and output device in ~/.asoundrc.asoundconf file.
let me know if that worked for you. if yes then i'll include this script in next Porteus release as it seems to be extremely helpful in such cases.

Cheers
Please add [Solved] to your thread title if the solution was found.

sci_fi
Black ninja
Black ninja
Posts: 52
Joined: 28 Dec 2010, 18:25

Re: ALSA Issue/question

Post#3 by sci_fi » 08 Aug 2011, 17:52

@fanthom

Hi fanthom,

As always thanks for your help.

I did use asoundconf earlier as you suggested. Still with no microphone.

I just completed a reboot. File contents as follows:

.asoundrc

pcm.!default {
type plug
slave.pcm "dmixer"
}

pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:1,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}

ctl.dmixer {
type hw
card 0
}

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

.asoundrc.asoundconf

# ALSA library configuration file managed by asoundconf(1).
#
# MANUAL CHANGES TO THIS FILE WILL BE OVERWRITTEN!
#
# Manual changes to the ALSA library configuration should be implemented
# by editing the ~/.asoundrc file, not by editing this file.
!defaults.pcm.card Generic
defaults.ctl.card Generic
defaults.pcm.device 0
defaults.pcm.subdevice -1
defaults.pcm.nonblock 1
defaults.pcm.compat 0
defaults.pcm.minperiodtime 5000
defaults.pcm.ipc_key 5678293
defaults.pcm.ipc_gid audio
defaults.pcm.ipc_perm 0660
defaults.pcm.dmix.max_periods 0
defaults.pcm.dmix.rate 48000
defaults.pcm.dmix.format "unchanged"
defaults.pcm.dmix.card defaults.pcm.card
defaults.pcm.dmix.device defaults.pcm.device
defaults.pcm.dsnoop.card defaults.pcm.card
defaults.pcm.dsnoop.device defaults.pcm.device
defaults.pcm.front.card defaults.pcm.card
defaults.pcm.front.device defaults.pcm.device
defaults.pcm.rear.card defaults.pcm.card
defaults.pcm.rear.device defaults.pcm.device
defaults.pcm.center_lfe.card defaults.pcm.card
defaults.pcm.center_lfe.device defaults.pcm.device
defaults.pcm.side.card defaults.pcm.card
defaults.pcm.side.device defaults.pcm.device
defaults.pcm.surround40.card defaults.pcm.card
defaults.pcm.surround40.device defaults.pcm.device
defaults.pcm.surround41.card defaults.pcm.card
defaults.pcm.surround41.device defaults.pcm.device
defaults.pcm.surround50.card defaults.pcm.card
defaults.pcm.surround50.device defaults.pcm.device
defaults.pcm.surround51.card defaults.pcm.card
defaults.pcm.surround51.device defaults.pcm.device
defaults.pcm.surround71.card defaults.pcm.card
defaults.pcm.surround71.device defaults.pcm.device
defaults.pcm.iec958.card defaults.pcm.card
defaults.pcm.iec958.device defaults.pcm.device
defaults.pcm.modem.card defaults.pcm.card
defaults.pcm.modem.device defaults.pcm.device
defaults.pcm.file_format "raw"
defaults.pcm.file_truncate true
defaults.rawmidi.card 0
defaults.rawmidi.device 0
defaults.rawmidi.subdevice -1
defaults.hwdep.card 0
defaults.hwdep.device 0
defaults.timer.class 2
defaults.timer.sclass 0
defaults.timer.card 0
defaults.timer.device 0
defaults.timer.subdevice 0
defaults.namehint.showall off
defaults.namehint.basic on
defaults.namehint.extended off

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

asound.state

state.Generic {
control.1 {
iface MIXER
name 'IEC958 Playback Con Mask'
value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access read
type IEC958
count 1
}
}
control.2 {
iface MIXER
name 'IEC958 Playback Pro Mask'
value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access read
type IEC958
count 1
}
}
control.3 {
iface MIXER
name 'IEC958 Playback Default'
value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access 'read write'
type IEC958
count 1
}
}
control.4 {
iface MIXER
name 'IEC958 Playback Switch'
value false
comment {
access 'read write'
type BOOLEAN
count 1
}
}
}
state.SB {
control.1 {
iface MIXER
name 'Capture Source'
value Mic
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Mic
item.1 'Mic 1'
}
}
control.2 {
iface MIXER
name 'Mic Capture Volume'
value.0 6
value.1 6
comment {
access 'read write'
type INTEGER
count 2
range '0 - 80'
dbmin -7400
dbmax 600
dbvalue.0 -6800
dbvalue.1 -6800
}
}
control.3 {
iface MIXER
name 'Mic 1 Capture Volume'
value.0 74
value.1 74
comment {
access 'read write'
type INTEGER
count 2
range '0 - 80'
dbmin -7400
dbmax 600
dbvalue.0 0
dbvalue.1 0
}
}
control.4 {
iface MIXER
name 'Master Playback Switch'
value.0 true
value.1 true
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.5 {
iface MIXER
name 'Master Playback Volume'
value.0 54
value.1 54
comment {
access 'read write'
type INTEGER
count 2
range '0 - 74'
dbmin -7400
dbmax 0
dbvalue.0 -2000
dbvalue.1 -2000
}
}
}

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

/etc/modprobe.d/alsa-base.conf

options snd-hda-intel model=laptop
options snd-hda-intel model=6stack-dig probe_mask=1
options snd-hda-intel enable_msi=1

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


etc/rc.d/rc.local

modprobe snd-hda-intel
modprobe fglrx

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&


arecord -l produces:

**** List of CAPTURE Hardware Devices ****
card 1: SB [HDA ATI SB], device 0: HDA Generic [HDA Generic]
Subdevices: 1/1
Subdevice #0: subdevice #0


&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

arecord -d 6 test produces

bash-4.1# arecord -d 6 test
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
arecord: main:660: audio open error: Invalid argument
bash-4.1#

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

Looking at hardware settings PHONON says that the only device with audio capture capability is: HDA ATI SB

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

I am using the fglrx driver I got using your earlier instructions.

I hope there is some clue in this as to what is going on.

Thanks again and best regards,

sci_fi

User avatar
fanthom
Site Admin
Site Admin
Posts: 4547
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: ALSA Issue/question

Post#4 by fanthom » 08 Aug 2011, 19:20

@sci_fi
hello,
few questions:
a) is the microphone working without fgrlx driver?
b) how many devices are listed when you type 'alsamixer' in console, then press F4 and then F6? (pls attach screenshot)
c) sow me output of 'asoundconf list' command

there must be something to fix this issue... :wink:
Please add [Solved] to your thread title if the solution was found.

sci_fi
Black ninja
Black ninja
Posts: 52
Joined: 28 Dec 2010, 18:25

Re: ALSA Issue/question

Post#5 by sci_fi » 09 Aug 2011, 00:14

Hi fanthom,

Answers to questions and links to screenshots:

a, No the microphone has never worked no matter what driver I use. It has worked in skype on windows 7 so hw is not the issue.

b. links to screenshots from alsa

http://www.mediafire.com/?83cz3dlditik7rq

http://www.mediafire.com/?3gp73uu2gueup41

http://www.mediafire.com/?zvp9tgve2lz66fs

http://www.mediafire.com/?sd14z0bgpacqw7q

http://www.mediafire.com/?q7uzx9tuq9wd15f

http://www.mediafire.com/?j3nx1nnn35idxzz

http://www.mediafire.com/?i557csh9etx3ohz

Output for asoundconf list:
lease note that you are attempting to run asoundconf as a privileged superuser, which may have unintended consequences.

Names of available sound cards:
Generic
SB

NOTE:

I never saw an F4 code indicated in alsa (see screenshots) and so had never tried it. f4 shows capture devices for SB. This is real progress. No microphone working yet, but at least alsa thinks SB has capture capability. I saw this using the built in driver, not the fglrx I built with your help. I don't know if this matters or not. I am going to try setting my default card to SB and adjust settings. I will let you know.

Thanks again.

sci_fi

User avatar
fanthom
Site Admin
Site Admin
Posts: 4547
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: ALSA Issue/question

Post#6 by fanthom » 09 Aug 2011, 08:06

@sci_fi
seems that your mic is supported but names of your sound cards are really confusing... first i thought that 'GENERIC' is your main card while now it looks like it's rather 'SB'. try to swap the cards with:

Code: Select all

asoundconf set-default-card SB
and check if that works.
also, please remove all your previous changes to make sure they wont mess up anything. modprobe fglrx and snd-hda-intel is not necessary as these drivers are loaded automatically by xorg and udev. 'Always Fresh' mode with clean /porteus/rootcopy is a good idea.

hope that helps.
Please add [Solved] to your thread title if the solution was found.

sci_fi
Black ninja
Black ninja
Posts: 52
Joined: 28 Dec 2010, 18:25

Re: ALSA Issue/question

Post#7 by sci_fi » 09 Aug 2011, 10:33

@ fanthom

I have rebooted with a totally base system except for one module which sets
.asoundrc (necessary for proper playback)
.asoundrc.asoundconf (contents shown below; sets SB to default; same as before)
asound.state (previously done; contents below)

Microphone does not work.
"asoundconf -d 5 test" produces:

bash-4.1# arecord -d 5 test
ALSA lib pcm_dmix.c:957:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
arecord: main:660: audio open error: Invalid argument
bash-4.1#

############################################################
.asoundrc

pcm.!default {
type plug
slave.pcm "dmixer"
}

pcm.dmixer {
type dmix
ipc_key 1024
slave {
pcm "hw:1,0"
period_time 0
period_size 1024
buffer_size 4096
rate 44100
}
bindings {
0 0
1 1
}
}

ctl.dmixer {
type hw
card 0
}

#######################################################
.asoundrc.asoundconf

# ALSA library configuration file managed by asoundconf(1).
#
# MANUAL CHANGES TO THIS FILE WILL BE OVERWRITTEN!
#
# Manual changes to the ALSA library configuration should be implemented
# by editing the ~/.asoundrc file, not by editing this file.
!defaults.pcm.card SB
defaults.ctl.card SB
defaults.pcm.device 0
defaults.pcm.subdevice -1
defaults.pcm.nonblock 1
defaults.pcm.compat 0
defaults.pcm.minperiodtime 5000
defaults.pcm.ipc_key 5678293
defaults.pcm.ipc_gid audio
defaults.pcm.ipc_perm 0660
defaults.pcm.dmix.max_periods 0
defaults.pcm.dmix.rate 48000
defaults.pcm.dmix.format "unchanged"
defaults.pcm.dmix.card defaults.pcm.card
defaults.pcm.dmix.device defaults.pcm.device
defaults.pcm.dsnoop.card defaults.pcm.card
defaults.pcm.dsnoop.device defaults.pcm.device
defaults.pcm.front.card defaults.pcm.card
defaults.pcm.front.device defaults.pcm.device
defaults.pcm.rear.card defaults.pcm.card
defaults.pcm.rear.device defaults.pcm.device
defaults.pcm.center_lfe.card defaults.pcm.card
defaults.pcm.center_lfe.device defaults.pcm.device
defaults.pcm.side.card defaults.pcm.card
defaults.pcm.side.device defaults.pcm.device
defaults.pcm.surround40.card defaults.pcm.card
defaults.pcm.surround40.device defaults.pcm.device
defaults.pcm.surround41.card defaults.pcm.card
defaults.pcm.surround41.device defaults.pcm.device
defaults.pcm.surround50.card defaults.pcm.card
defaults.pcm.surround50.device defaults.pcm.device
defaults.pcm.surround51.card defaults.pcm.card
defaults.pcm.surround51.device defaults.pcm.device
defaults.pcm.surround71.card defaults.pcm.card
defaults.pcm.surround71.device defaults.pcm.device
defaults.pcm.iec958.card defaults.pcm.card
defaults.pcm.iec958.device defaults.pcm.device
defaults.pcm.modem.card defaults.pcm.card
defaults.pcm.modem.device defaults.pcm.device
defaults.pcm.file_format "raw"
defaults.pcm.file_truncate true
defaults.rawmidi.card 0
defaults.rawmidi.device 0
defaults.rawmidi.subdevice -1
defaults.hwdep.card 0
defaults.hwdep.device 0
defaults.timer.class 2
defaults.timer.sclass 0
defaults.timer.card 0
defaults.timer.device 0
defaults.timer.subdevice 0
defaults.namehint.showall off
defaults.namehint.basic on
defaults.namehint.extended off

############################################################

asound.state

state.Generic {
control.1 {
iface MIXER
name 'IEC958 Playback Con Mask'
value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access read
type IEC958
count 1
}
}
control.2 {
iface MIXER
name 'IEC958 Playback Pro Mask'
value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access read
type IEC958
count 1
}
}
control.3 {
iface MIXER
name 'IEC958 Playback Default'
value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
comment {
access 'read write'
type IEC958
count 1
}
}
control.4 {
iface MIXER
name 'IEC958 Playback Switch'
value true
comment {
access 'read write'
type BOOLEAN
count 1
}
}
}
state.SB {
control.1 {
iface MIXER
name 'Capture Source'
value Mic
comment {
access 'read write'
type ENUMERATED
count 1
item.0 Mic
item.1 'Mic 1'
}
}
control.2 {
iface MIXER
name 'Mic Capture Volume'
value.0 72
value.1 72
comment {
access 'read write'
type INTEGER
count 2
range '0 - 80'
dbmin -7400
dbmax 600
dbvalue.0 -200
dbvalue.1 -200
}
}
control.3 {
iface MIXER
name 'Mic 1 Capture Volume'
value.0 74
value.1 74
comment {
access 'read write'
type INTEGER
count 2
range '0 - 80'
dbmin -7400
dbmax 600
dbvalue.0 0
dbvalue.1 0
}
}
control.4 {
iface MIXER
name 'Master Playback Switch'
value.0 true
value.1 true
comment {
access 'read write'
type BOOLEAN
count 2
}
}
control.5 {
iface MIXER
name 'Master Playback Volume'
value.0 54
value.1 54
comment {
access 'read write'
type INTEGER
count 2
range '0 - 74'
dbmin -7400
dbmax 0
dbvalue.0 -2000
dbvalue.1 -2000
}
}
control.6 {
iface MIXER
name 'PCM Playback Volume'
value.0 237
value.1 237
comment {
access 'read write user'
type INTEGER
count 2
range '0 - 255'
tlv '0000000100000008ffffec1400000014'
dbmin -5100
dbmax 0
dbvalue.0 -360
dbvalue.1 -360
}
}
}


###########################################################

I must confess I do not understand the contents of .asoundrc. I have it there because it allows playback to work properly. I found it googling azalia soundcard problems. Possibly some additions to this file will do the trick. I will keep looking.

As always, thank you for your help.

Best regards,

sci_fi

User avatar
fanthom
Site Admin
Site Admin
Posts: 4547
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: ALSA Issue/question

Post#8 by fanthom » 09 Aug 2011, 21:23

@sci_fi
i dont understand this config either :)
thy this command:

Code: Select all

arecord -f cd -D hw:1,0 -d 20 test.wav
or

Code: Select all

arecord -f cd -D plughw:1,0 -d 20 test.wav
in which application are you trying to use the microphone?

EDIT:\\
try also these settings in .asoundrc

Code: Select all

pcm.!default {
    type plug
    slave.pcm "asymed"
}

pcm.asymed {
        type asym
        playback.pcm "dmixer"
}
and remove everything else.
another config worth trying:
http://forums.gentoo.org/viewtopic.php?p=958187
Please add [Solved] to your thread title if the solution was found.

sci_fi
Black ninja
Black ninja
Posts: 52
Joined: 28 Dec 2010, 18:25

Re: ALSA Issue/question

Post#9 by sci_fi » 10 Aug 2011, 00:42

@ fanthom

Thank you for the recommendations. I have started experimenting with mixed results. I will continue and pass more results tomorrow.
First observations:

1. The arecord commands you gave appear to work. They do not generate error messages and seem to create a test.wav file.
2. Some combination of configuration (not sure what exactly yet) allowed these .wav files to play with smplayer. also with the default player in dolphin. I have not been able to reproduce this but it did happen.

3. When it appeared to be recording and playing I loaded skype (the application I want to get working). Skype did not work.

I will experiment some more and when I can (hopefully) reproduce the partial success, will let you know the details.

Thanks again.

sci_fi

User avatar
fanthom
Site Admin
Site Admin
Posts: 4547
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
Contact:

Re: ALSA Issue/question

Post#10 by fanthom » 10 Aug 2011, 07:02

The arecord commands you gave appear to work. They do not generate error messages and seem to create a test.wav file.
this is good news :) microphone is working so it's just a matter of picking up correct asoundrc settings.
search The dmix plugin supports only playback stream in google for more examples.

Skype did not work.
skype has extended selection of mic sources:
http://www.skypeassets.com/i/images/scr ... ophone.png
click on the red marked button and try every option possible.
one of them must work :)

cheers
Please add [Solved] to your thread title if the solution was found.

sci_fi
Black ninja
Black ninja
Posts: 52
Joined: 28 Dec 2010, 18:25

Re: ALSA Issue/question

Post#11 by sci_fi » 10 Aug 2011, 10:20

@ fanthom

I tried the skype options with no success. Unfortunately, I have not yet been able to repeat the apparent successful recording using arecord. While the test.wav file is being created, nothing can play it back. I am sure that something I did last night corrected this but I have not been able to re-create it. I believe this is necessary before skype can work. I will google the other topic you suggest.

Also, a question:

Sometime ago, I ran asoundconf and created a .asoundrc.asoundconf file in my home directory. This file is present in my home directory (root, for now) on boot up. However, I notice that after boot, the file /usr/share/alsa/alsa.conf still has defaults of card 0. Do I need to run asoundconf after each boot?

Thanks as always. I will experiment some more later on and let you know what happens. Seems to be getting close.

Best regards,

sci_fi

Post Reply