LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 03-24-2007, 11:32 AM   #1
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Rep: Reputation: 15
C Media USB sound card not working with ALSA


System: NEC Versa M540 (laptop)
Distribution: Debian Sarge/Etch
Kernel: Custom 2.6.18

I am trying to use a C Media USB Audio Adapter, but cannot get a sound out of it. I have no clue what the model is, because it's not written anywhere on the device. I don't know where to start, or even how test the thing.

lsusb -v gives:

Code:
Bus 003 Device 005: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
Device Descriptor:
...
  idVendor           0x0d8c C-Media Electronics, Inc.
  idProduct          0x000c Audio Adapter
I plug it in, and the snd-usb-audio module is loaded, and I can see:

Code:
$ cat /proc/asound/cards
 0 [I82801DBICH4   ]: ICH4 - Intel 82801DB-ICH4
                      Intel 82801DB-ICH4 with ALC655 at 0xf0000400, irq 5
 1 [Modem          ]: ICH-MODEM - Intel 82801DB-ICH4 Modem
                      Intel 82801DB-ICH4 Modem at 0xe200, irq 5
 2 [default        ]: USB-Audio - C-Media USB Headphone Set
                      C-Media USB Headphone Set   at usb-0000:00:1d.1-1, full speed
So it seems that my card is somehow named 'default'...

alsamixer -c 2 brings up a mixer dialog for the device, with nothing muted.

Trying aplay -D "default" whatever.wav to test it simply plays the sound through the laptop speakers.

Ultimately I would like to automatically select it when I plug it in, but for now I'd just like to get a peep out of it.

Any help would be appreciated -- anything at all

More detail:

Output from aplay -L:
Code:
PCM list:
hw {
	@args.0 CARD
	@args.1 DEV
	@args.2 SUBDEV
	@args.CARD {
		type string
		default {
			@func getenv
			vars {
				0 ALSA_PCM_CARD
				1 ALSA_CARD
			}
			default {
				@func refer
				name 'defaults.pcm.card'
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars {
				0 ALSA_PCM_DEVICE
			}
			default {
				@func refer
				name 'defaults.pcm.device'
			}
		}
	}
	@args.SUBDEV {
		type integer
		default {
			@func refer
			name 'defaults.pcm.subdevice'
		}
	}
	type hw
	card $CARD
	device $DEV
	subdevice $SUBDEV
}
plughw {
	@args.0 CARD
	@args.1 DEV
	@args.2 SUBDEV
	@args.CARD {
		type string
		default {
			@func getenv
			vars {
				0 ALSA_PCM_CARD
				1 ALSA_CARD
			}
			default {
				@func refer
				name 'defaults.pcm.card'
			}
		}
	}
	@args.DEV {
		type integer
		default {
			@func igetenv
			vars {
				0 ALSA_PCM_DEVICE
			}
			default {
				@func refer
				name 'defaults.pcm.device'
			}
		}
	}
	@args.SUBDEV {
		type integer
		default {
			@func refer
			name 'defaults.pcm.subdevice'
		}
	}
	type plug
	slave.pcm {
		type hw
		card $CARD
		device $DEV
		subdevice $SUBDEV
	}
}
plug {
	@args.0 SLAVE
	@args.SLAVE {
		type string
	}
	type plug
	slave.pcm $SLAVE
}
shm {
	@args.0 SOCKET
	@args.1 PCM
	@args.SOCKET {
		type string
	}
	@args.PCM {
		type string
	}
	type shm
	server $SOCKET
	pcm $PCM
}
tee {
	@args.0 SLAVE
	@args.1 FILE
	@args.2 FORMAT
	@args.SLAVE {
		type string
	}
	@args.FILE {
		type string
	}
	@args.FORMAT {
		type string
		default raw
	}
	type file
	slave.pcm $SLAVE
	file $FILE
	format $FORMAT
}
file {
	@args.0 FILE
	@args.1 FORMAT
	@args.FILE {
		type string
	}
	@args.FORMAT {
		type string
		default raw
	}
	type file
	slave.pcm null
	file $FILE
	format $FORMAT
}
null {
	type null
}
cards 'cards.pcm'
front 'cards.pcm.front'
rear 'cards.pcm.rear'
center_lfe 'cards.pcm.center_lfe'
side 'cards.pcm.side'
surround40 'cards.pcm.surround40'
surround41 'cards.pcm.surround41'
surround50 'cards.pcm.surround50'
surround51 'cards.pcm.surround51'
surround71 'cards.pcm.surround71'
iec958 'cards.pcm.iec958'
spdif 'cards.pcm.iec958'
modem 'cards.pcm.modem'
phoneline 'cards.pcm.phoneline'
default 'cards.pcm.default'
dmix 'cards.pcm.dmix'
dsnoop 'cards.pcm.dsnoop'
 
Old 03-25-2007, 05:11 AM   #2
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
In addition, the kernel ring buffer says, after plugging it in:

Code:
usb 2-1: new full speed USB device using uhci_hcd and address 2
PM: Adding info for usb:2-1
PM: Adding info for No Bus:usbdev2.2_ep00
usb 2-1: configuration #1 chosen from 1 choice
PM: Adding info for usb:2-1:1.0
PM: Adding info for usb:2-1:1.1
PM: Adding info for usb:2-1:1.2
PM: Adding info for usb:2-1:1.3
input: C-Media USB Headphone Set   as /class/input/input5
input: USB HID v1.00 Device [C-Media USB Headphone Set  ] on usb-0000:00:1d.1-1
PM: Adding info for No Bus:usbdev2.2_ep83
PM: Adding info for No Bus:usbdev2.2_ep01
PM: Removing info for No Bus:usbdev2.2_ep01
PM: Adding info for No Bus:usbdev2.2_ep82
PM: Removing info for No Bus:usbdev2.2_ep82
usbcore: registered new driver snd-usb-audio
Don't know if that's useful, though :/
 
Old 03-26-2007, 06:21 AM   #3
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
Continuing in the list of things that don't work: disabling ALSA in the kernel and compiling the drivers separately from source.
 
Old 03-26-2007, 11:48 AM   #4
fds
LQ Newbie
 
Registered: Mar 2007
Posts: 1

Rep: Reputation: 0
Same trouble
Laptops often have sound card trouble (inspiron 1300 > micro trouble). The only way to use Skype/phone apps could be to use C Media USB Audio Adapter. I think that a driver for such product would be very important.
Is there someone to create such driver ?
 
Old 03-27-2007, 08:01 AM   #5
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
More non-working things: figuring out that the card is CM9738, downloading the drivers, compiling and installing them.
 
Old 03-27-2007, 11:15 PM   #6
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
So I recompiled my kernel, enabling every single sound card and debugging feature that didn't cause compilation to die halfway and it still doesn't work. I think my head may explode slightly.

Code:
$ alsaplayer -i text -o alsa /usr/share/sounds/generic.wav -d hw:2
Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (23219 23220)
PERIOD_SIZE: 1024
PERIOD_BYTES: 4096
PERIODS: 8
BUFFER_TIME: (185759 185760)
BUFFER_SIZE: 8192
BUFFER_BYTES: 32768
TICK_TIME: 1000
failed to configure output device...trying OSS


...done playing
After playing through the OSS output driver, the sound simply plays through my laptop speakers.

Tried loading snd_hda_intel and cmaudio modules manually -- no luck.
 
Old 03-28-2007, 11:48 PM   #7
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
Got it! I found a few posts explaining that ALSA's default fragment size didn't always work. It works if I use alsaplayer -i text -o alsa -d hw:2 -f 2048 whatever.wav

I just need to figure out how to make it set that permanently.
 
Old 04-18-2007, 08:47 AM   #8
detly
Member
 
Registered: Nov 2003
Distribution: Debian Sarge/Etch
Posts: 54

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by detly
I just need to figure out how to make it set that permanently.
Yeah. Right.

Turns out that this isn't as trivial as I imagined:

http://sourceforge.net/mailarchive/f...name=alsa-user
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ALSA not working for Creative Sound Blaster Live 24 Bit sound card vishalsonu Linux - Hardware 7 08-20-2005 01:02 PM
alsa - card detected, media plays, no sound, not the usual problem qwijibow Linux - General 8 06-02-2005 01:35 PM
C-Media CMI8738 sound card drivers not working??? LordRaven Slackware 9 08-24-2004 02:36 PM
Sound not working with Kernel 2.6, ALSA, FC1, C-media 8738 crdiscoverer Linux - Hardware 5 03-01-2004 02:13 AM
C-Media (cm8738) sound card & alsa problems BBQ_Matt Linux - Hardware 3 02-05-2004 03:39 AM


All times are GMT -5. The time now is 06:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration