FreeBSD sblive support is buggy in oss 4.xx

OSS specific BSD discussion (FreeBSD/NetBSD/OpenBSD)

Moderators: hannu, dev, cesium, kodachi

FreeBSD sblive support is buggy in oss 4.xx

Postby Samm » Tue Jun 26, 2007 5:47 am

Hello.

I have some problems with my sound after 4.xx releases. Sometime sound stop to play and i get messages like:

run soundoff and run soundon again.
sblive: Cannot allocate DMA buffer
OSS: Unable to allocate 65536 bytes for a DMA buffer

in my syslog. After killing (killall -9) and restarting xmms all is ok. With freebsd internal drivers i had no such problems, but oss is better for me.

Sound player is latest xmms.

samm>~: ossinfo
Version info: OSS 4.0 (build 070613/200706240702/G (0x00040002)
Platform: FreeBSD/i386 6.2-RELEASE FreeBSD 6.2-RELEASE #1: Tue Jan 16 00:17:50 E
ET 2007 root@samm.local:/usr/obj/usr/src/sys/SAMMKRNL

Number of audio devices: 9
Number of audio engines: 9
Number of MIDI devices: 0
Number of mixer devices: 1


Device objects
0: sblive0 SB Live
1: vmix0 OSS transparent virtual support

MIDI devices (/dev/midi*)

Mixer devices (/dev/mixer*)
0: SB Live (TR28023) (Mixer 0 of device object 0)

Audio devices
/dev/oss/sblive0/pcm0 SB Live main (device index 0)
/dev/oss/sblive0/pcm1 SB Live front out (device index 1)
/dev/oss/sblive0/pcm2 SB Live side out (device index 2)
/dev/oss/sblive0/pcm3 SB Live center/lfe out (device index 3)
/dev/oss/sblive0/pcm4 SB Live 5.1 output device (device index 4)
/dev/oss/vmix0/pcm0 SB Live main (VMIX0) (device index 5)
/dev/oss/vmix0/pcm1 SB Live main (VMIX0) (device index 6)
/dev/oss/vmix0/pcm2 SB Live main (VMIX0) (device index 7)
/dev/oss/vmix0/pcm3 SB Live main (VMIX0) (device index 8)

If you need any additional information or debug - please, contact me.

P.S. And great thanks for the Open Source OSS :)
Samm
 
Posts: 2
Joined: Tue Jun 26, 2007 5:19 am

Postby Samm » Tue Jun 26, 2007 3:21 pm

sblive, as i wrote in the message subject:

pciconf -lv:

sblive0@pci2:3:0: class=0x040100 card=0x00201102 chip=0x00021102 rev=0x08 hdr=0x00
vendor = 'Creative Labs'
device = 'EMU10000 Sound Blaster Live! (Also Live! 5.1) - OEM from DELL - CT4780'
class = multimedia
subclass = audio
Samm
 
Posts: 2
Joined: Tue Jun 26, 2007 5:19 am

Re: FreeBSD sblive support is buggy in oss 4.xx

Postby dev » Tue Jun 26, 2007 4:17 pm

Samm wrote:Hello.

I have some problems with my sound after 4.xx releases. Sometime sound stop to play and i get messages like:

run soundoff and run soundon again.
sblive: Cannot allocate DMA buffer
OSS: Unable to allocate 65536 bytes for a DMA buffer

in my syslog. After killing (killall -9) and restarting xmms all is ok. With freebsd internal drivers i had no such problems, but oss is better for me.

Sound player is latest xmms.

samm>~: ossinfo
Version info: OSS 4.0 (build 070613/200706240702/G (0x00040002)
Platform: FreeBSD/i386 6.2-RELEASE FreeBSD 6.2-RELEASE #1: Tue Jan 16 00:17:50 E
ET 2007 root@samm.local:/usr/obj/usr/src/sys/SAMMKRNL

Number of audio devices: 9
Number of audio engines: 9
Number of MIDI devices: 0
Number of mixer devices: 1


Device objects
0: sblive0 SB Live
1: vmix0 OSS transparent virtual support

MIDI devices (/dev/midi*)

Mixer devices (/dev/mixer*)
0: SB Live (TR28023) (Mixer 0 of device object 0)

Audio devices
/dev/oss/sblive0/pcm0 SB Live main (device index 0)
/dev/oss/sblive0/pcm1 SB Live front out (device index 1)
/dev/oss/sblive0/pcm2 SB Live side out (device index 2)
/dev/oss/sblive0/pcm3 SB Live center/lfe out (device index 3)
/dev/oss/sblive0/pcm4 SB Live 5.1 output device (device index 4)
/dev/oss/vmix0/pcm0 SB Live main (VMIX0) (device index 5)
/dev/oss/vmix0/pcm1 SB Live main (VMIX0) (device index 6)
/dev/oss/vmix0/pcm2 SB Live main (VMIX0) (device index 7)
/dev/oss/vmix0/pcm3 SB Live main (VMIX0) (device index 8)

If you need any additional information or debug - please, contact me.

P.S. And great thanks for the Open Source OSS :)


Hi,

Your error:
OSS: Unable to allocate 65536 bytes for a DMA buffer

implies that memory is too fragmented. You should run soundon right after the system boots - before any other apps can run and fragment up kernel memory.


regards
dev mazumdar
dev
 
Posts: 577
Joined: Fri Sep 12, 2003 6:08 am
Location: Culver City, CA

Postby Tarick » Mon Jul 02, 2007 6:18 pm

~ $ ossinfo
Version info: OSS 4.0 (build 070613/200706261808/G (0x00040002)
Platform: FreeBSD/amd64 6.2-STABLE FreeBSD 6.2-STABLE #10: Fri Jan 19 23:17:22 EET 2007
Number of audio devices: 9
Number of audio engines: 9
Number of MIDI devices: 0
Number of mixer devices: 1
Device objects
0: sblive0 SB Live
1: vmix0 OSS transparent virtual support
MIDI devices (/dev/midi*)
Mixer devices (/dev/mixer*)
0: SB Live (EM28028) (Mixer 0 of device object 0)
Audio devices
/dev/oss/sblive0/pcm0 SB Live main (device index 0)
/dev/oss/sblive0/pcm1 SB Live front out (device index 1)
/dev/oss/sblive0/pcm2 SB Live side out (device index 2)
/dev/oss/sblive0/pcm3 SB Live center/lfe out (device index 3)
/dev/oss/sblive0/pcm4 SB Live 5.1 output device (device index 4)
/dev/oss/vmix0/pcm0 SB Live main (VMIX0) (device index 5)
/dev/oss/vmix0/pcm1 SB Live main (VMIX0) (device index 6)
/dev/oss/vmix0/pcm2 SB Live main (VMIX0) (device index 7)
/dev/oss/vmix0/pcm3 SB Live main (VMIX0) (device index 8)

sblive0@pci2:9:0: class=0x040100 card=0x80641102 chip=0x00021102 rev=0x07 hdr=0x00
vendor = 'Creative Labs'
device = 'EMU10000 Sound Blaster Live! (Also Live! 5.1) - OEM from DELL - CT4780'
class = multimedia
subclass = audio


The same problem. As you see, soundcard is identical, so I guess this problem is specific for SB Live 5.1 only. Oss starts before Xorg and any audio applications.

Earlier versions didn't have this error.
Tarick
 
Posts: 11
Joined: Sat Jun 30, 2007 6:01 pm

Postby hannu » Tue Jul 03, 2007 7:45 pm

FreeBSD makes only limited amount of DMA memory available for drivers. The sblive driver implements several parallel audio devices. The vmix (virtual mixing) driver adds few more of them and the system will run out of memory.

As a workaround you can edit /usr/lib/oss/etc/installed_drivers and to remove the line containing "vmix". After a reboot OSS should work again.
Hannu Savolainen (hannu@opensound.com)
hannu
Site Admin
 
Posts: 10
Joined: Fri Sep 12, 2003 6:28 am

Postby sven » Tue Jul 03, 2007 9:23 pm

Could someone PLEASE look after the docs? :) I had and have had my problems there, too....
sven
 
Posts: 7
Joined: Tue Jun 19, 2007 10:35 pm

Postby Tarick » Fri Jul 06, 2007 10:46 pm

hannu
I still see error in log despite disabled vmx. Is there any method to increase buffers?

It is confusing that earlier version (before opening sources, I forgot exact number) didn't have this problem.
Tarick
 
Posts: 11
Joined: Sat Jun 30, 2007 6:01 pm

Postby dev » Fri Jul 06, 2007 11:19 pm

Tarick wrote:hannu
I still see error in log despite disabled vmx. Is there any method to increase buffers?

It is confusing that earlier version (before opening sources, I forgot exact number) didn't have this problem.


you can download the OSS source code and look at osscore.c in oss-4.0/setup/FreeBSD/oss/build/ and then change the memory allocation there. The default memory allocaiton is 64K per channel

Rebuild it and see if that helps.

regards
Dev
dev
 
Posts: 577
Joined: Fri Sep 12, 2003 6:08 am
Location: Culver City, CA

Postby hannu » Sat Jul 07, 2007 7:46 am

Actually the right place is in kernel/OS/FreeBSD/os_freebsd.c. Change the "int size = 64 * 1024;" line in the beginning of __oss_alloc_dmabuf(). Dropping the "64" to 32 or even 16 should fix the problem. However anything below 64k will break application(s) that assume 64k buffers (I recall it was RealPlayer).
Hannu Savolainen (hannu@opensound.com)
hannu
Site Admin
 
Posts: 10
Joined: Fri Sep 12, 2003 6:28 am

Postby Tarick » Thu Jul 12, 2007 6:05 pm

Thanks, hannu, dropping to 32 fixed problem. BTW, RP10 works.
Tarick
 
Posts: 11
Joined: Sat Jun 30, 2007 6:01 pm


Return to BSD

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

cron