Re: Set fragment size for USB sound card

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



But will this still allow ALSA to revert to the laptop speakers when the
card is not plugged in? And will it work when the index of the card
changes, seemingly arbitrarily?

I attempted to define a slave PCM as follows, but with no success:

--
pcm.usbtest {
	type dmix
	ipc_key 192837465
	ipc_key_add_uid true
	slave {
		pcm "hw:2,0"
		# period_size 2048
		buffer_size 2048
	}
}
--

I switched and combined the 'period_size' and 'buffer_size' to see what
would work, but only got:

--
$ alsaplayer -i text -o alsa -d usbtest /usr/share/sounds/generic.wav
ALSA lib pcm_direct.c:985:(snd_pcm_direct_initialize_slave) unable to
install hw params
ALSA lib pcm_dmix.c:876:(snd_pcm_dmix_open) unable to initialize slave
snd_pcm_open: Broken pipe (usbtest)
Failed to initialize plugin!
Failed to register plugin: /usr/lib/alsaplayer/output/libalsa_out.so
Failed to load output plugin "alsa". Trying defaults.
ALSA lib pcm_direct.c:985:(snd_pcm_direct_initialize_slave) unable to
install hw params
ALSA lib pcm_dmix.c:876:(snd_pcm_dmix_open) unable to initialize slave
snd_pcm_open: Broken pipe (usbtest)
Failed to initialize plugin!
/usr/lib/alsaplayer/output/libalsa_out.so failed to load
jack: server not running?
/usr/lib/alsaplayer/output/libjack_out.so failed to load


...done playing
--

- Jason

On Mon, 2007-04-09 at 17:46 -0600, Michael Bourgeous wrote:
> You may look for settings like "playback buffer" or "buffer size".
> One option you might try is running jackd with a buffer size of 512 or
> 1024, and using an .asoundrc file in your home directory to create a
> jackd PCM and set it as the default PCM.
> 
> Mike Bourgeous
> 
> On 4/8/07, Jason Heeris <heerij01@xxxxxxxxxxxxxxxxxx> wrote:
> > System: NEC Versa M540 laptop
> > Dist: Debian Sarge/Etch
> > Kernel: 2.6.18
> > Alsa: using drivers in kernel, although no difference when compiled from
> > alsa-source package.
> > Card in question: C-Media USB sound card (more info below)
> >
> > I recently purchased a C-Media USB sound card, and eventually figured
> > out that it only works with a fragment size of 2048 or less. I can use
> > alsaplayer with the '-f' option to hear sound through them, but I want
> > to tell ALSA in general that it can only handle this range for the
> > fragment size (and only for this card). Hopefully then I'll be able to
> > hear all my other applications.
> >
> > I'm not even sure where to start -- udev, ALSA configuration, module
> > configuration...
> >
> > I've read every resource on ALSA configuration files that I can find,
> > and tried a whole lot of plugin definitions and parameters with no luck
> > whatsoever. I also tried forcing the index of the card by adding the
> > following to /etc/modprobe.d/alsa-base, but even this only works half of
> > the time:
> >
> > --
> > # Prevent abnormal drivers from grabbing index 0
> > options snd-bt87x index=-2
> > options snd-cx88_alsa index=-2
> > options snd-atiixp-modem index=-2
> > # options snd-intel8x0m index=-2
> > options snd-via82xx-modem index=-2
> >
> > options snd-intel8x0 index=0
> > options snd-intel8x0m index=1
> > options snd-usb-audio index=2 vid=0d8c pid=000c
> > options snd-usb-audio index=3
> > --
> >
> > The contents of '/proc/asound/cards' are:
> >
> > --
> >  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
> > --
> >
> > ...although sometimes the ICH-MODEM is missing and the C-Media card is
> > at #1.
> >
> > Card information from 'lsusb':
> >
> > Bus 002 Device 003: ID 0d8c:000c C-Media Electronics, Inc. Audio Adapter
> >
> > Usually I boot with the card plugged in, but if I plug it in after
> > booting, the new modules loaded are: snd_hwdep, snd_rawmidi,
> > snd_usb_audio and snd_usb_lib.
> >
> > By the way, nowhere could I find in the documentation what the various
> > synonyms were for 'fragment size' -- what else is this parameter called?
> > What is the equivalent in ALSA configuration files? I figured it was
> > 'packet_bytes', but I wasn't sure.
> >
> > Anyway, I would appreciate any advice on this.
> >
> > Thanks,
> > Jason
> >
> >
> > -------------------------------------------------------------------------
> > Take Surveys. Earn Cash. Influence the Future of IT
> > Join SourceForge.net's Techsay panel and you'll get the chance to share your
> > opinions on IT & business topics through brief surveys-and earn cash
> > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> > _______________________________________________
> > Alsa-user mailing list
> > Alsa-user@xxxxxxxxxxxxxxxxxxxxx
> > https://lists.sourceforge.net/lists/listinfo/alsa-user
> >


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux