Sound freezes after a while on recent OSS versions

OSS specific BSD discussion (FreeBSD/NetBSD/OpenBSD)

Moderators: hannu, dev, cesium, kodachi

Sound freezes after a while on recent OSS versions

Postby r0bert » Sat Mar 29, 2008 9:21 am

Hi,
after my harddisk crashed i was forced to update my system. Now i am experiencing problems with the recent versions of OSS. The sound gets stuck after some time of using it, maybe something like 20 minutes. Applications like audacious stay in the state "oss" and it's no longer possible to unload the module.
I tried the following versions, wich all react the same:
oss-v4.0-build1014-src-bsd
oss-v4.0-build1015-src-bsd
oss-v4.1-build080323-src-bsd
Luckily oss-v4.0-build1013-src-bsd seems to work fine.
Before the crash i was using FreeBSD 7.0RC1 with build1008, this was working fine too.
On build1015 i tried to stream from line-in with darkice, this breaks the module after maybe 3 seconds.

I'm setting spdif.enable to ON, see below for more information:

Thanks in advance, let me know if i can provide more details.

Best regards
Robert

Code: Select all
%ossinfo -v9
Version info: OSS 4.0 (b1013/200803282152) (0x00040003) BSD
Platform: FreeBSD/i386 7.0-STABLE FreeBSD 7.0-STABLE #0: Thu Mar 27 19:44:53 CET 2008

Number of audio devices:        8
Number of audio engines:        8
Number of mixer devices:        1


Device objects
0: ymf7xx0 Yamaha YMF754
1: vmix0 OSS transparent virtual support


Mixer devices
0: Yamaha DS-XG (STAC9708) (Mixer 0 of device object 0)
    Device file /dev/oss/ymf7xx0/mix0, Legacy device /dev/mixer0
    Priority: 2
    Caps:
    Device handle: OSS-PCI-mx01
    Device priority: 2


Audio devices
Yamaha YMF754                     /dev/oss/ymf7xx0/pcm0  (device index 0)
    Legacy device /dev/dsp0
    Caps: DUPLEX TRIGGER MMAP
    Modes: IN/OUT
      Engine      1: 0/Yamaha YMF754
                     Available for use
    Input formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Device handle: OSS-PCI-au01
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 4
    Native sample rates (min - max): 5000 - 48000
    HW Type: Not indicated.
    Minimum latency: Not indicated

Yamaha YMF754                     /dev/oss/ymf7xx0/pcm1  (device index 1)
    Legacy device /dev/dsp1
    Caps: TRIGGER MMAP
    Modes: OUTPUT
      Out engine  1: 1/Yamaha YMF754
                     Available for use
      Out engine  2: 2/Yamaha YMF754
                     Busy (OUT) by PID 956 / audacious label 'audacious'
      Out engine  3: 3/Yamaha YMF754
                     Available for use
      Out engine  4: 4/Yamaha YMF754
                     Available for use
      Out engine  5: 5/Yamaha YMF754
                     Available for use
      Out engine  6: 6/Yamaha YMF754
                     Available for use
      Out engine  7: 7/Yamaha YMF754
                     Available for use
    Input formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Device handle: OSS-PCI-au02
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 4
    Native sample rates (min - max): 5000 - 48000
    HW Type: Not indicated.
    Minimum latency: Not indicated

Yamaha YMF754                     /dev/oss/ymf7xx0/pcm2  (device index 2)
    Legacy device /dev/dsp2
    Caps: TRIGGER MMAP SHADOW HIDDEN
    Modes: OUTPUT
      Out engine  1: 2/Yamaha YMF754
                     Busy (OUT) by PID 956 / audacious label 'audacious'
      Out engine  2: 3/Yamaha YMF754
                     Available for use
      Out engine  3: 4/Yamaha YMF754
                     Available for use
      Out engine  4: 5/Yamaha YMF754
                     Available for use
      Out engine  5: 6/Yamaha YMF754
                     Available for use
      Out engine  6: 7/Yamaha YMF754
                     Available for use
    Input formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Device handle: OSS-PCI-au03
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 4
    Native sample rates (min - max): 5000 - 48000
    HW Type: Not indicated.
    Minimum latency: Not indicated

Yamaha YMF754                     /dev/oss/ymf7xx0/pcm3  (device index 3)
    Legacy device /dev/dsp3
    Caps: TRIGGER MMAP SHADOW HIDDEN
    Modes: OUTPUT
      Out engine  1: 3/Yamaha YMF754
                     Available for use
      Out engine  2: 4/Yamaha YMF754
                     Available for use
      Out engine  3: 5/Yamaha YMF754
                     Available for use
      Out engine  4: 6/Yamaha YMF754
                     Available for use
      Out engine  5: 7/Yamaha YMF754
                     Available for use
    Input formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Device handle: OSS-PCI-au04
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 4
    Native sample rates (min - max): 5000 - 48000
    HW Type: Not indicated.
    Minimum latency: Not indicated

Yamaha YMF754                     /dev/oss/ymf7xx0/pcm4  (device index 4)
    Legacy device /dev/dsp4
    Caps: TRIGGER MMAP SHADOW HIDDEN
    Modes: OUTPUT
      Out engine  1: 4/Yamaha YMF754
                     Available for use
      Out engine  2: 5/Yamaha YMF754
                     Available for use
      Out engine  3: 6/Yamaha YMF754
                     Available for use
      Out engine  4: 7/Yamaha YMF754
                     Available for use
    Input formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Device handle: OSS-PCI-au05
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 4
    Native sample rates (min - max): 5000 - 48000
    HW Type: Not indicated.
    Minimum latency: Not indicated

Yamaha YMF754                     /dev/oss/ymf7xx0/pcm5  (device index 5)
    Legacy device /dev/dsp5
    Caps: TRIGGER MMAP SHADOW HIDDEN
    Modes: OUTPUT
      Out engine  1: 5/Yamaha YMF754
                     Available for use
      Out engine  2: 6/Yamaha YMF754
                     Available for use
      Out engine  3: 7/Yamaha YMF754
                     Available for use
    Input formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Device handle: OSS-PCI-au06
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 4
    Native sample rates (min - max): 5000 - 48000
    HW Type: Not indicated.
    Minimum latency: Not indicated

Yamaha YMF754                     /dev/oss/ymf7xx0/pcm6  (device index 6)
    Legacy device /dev/dsp6
    Caps: TRIGGER MMAP SHADOW HIDDEN
    Modes: OUTPUT
      Out engine  1: 6/Yamaha YMF754
                     Available for use
      Out engine  2: 7/Yamaha YMF754
                     Available for use
    Input formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Device handle: OSS-PCI-au07
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 4
    Native sample rates (min - max): 5000 - 48000
    HW Type: Not indicated.
    Minimum latency: Not indicated

Yamaha YMF754                     /dev/oss/ymf7xx0/pcm7  (device index 7)
    Legacy device /dev/dsp7
    Caps: TRIGGER MMAP SHADOW HIDDEN
    Modes: OUTPUT
      Out engine  1: 7/Yamaha YMF754
                     Available for use
    Input formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Output formats (0x00000418):
      AFMT_U8           - 8 bit unsigned
      AFMT_S16_LE       - 16 bit signed little endian
      AFMT_AC3          - AC3 (Dolby Digital) encoded audio
    Device handle: OSS-PCI-au08
    Related mixer dev: 0
    Sample rate source: 0
    Preferred channel configuration: Not indicated
    Supported number of channels (min - max): 2 - 4
    Native sample rates (min - max): 5000 - 48000
    HW Type: Not indicated.
    Minimum latency: Not indicated
r0bert
 
Posts: 8
Joined: Sat Mar 29, 2008 8:52 am

Postby r0bert » Sat Mar 29, 2008 10:43 am

No, build1013 is not workin correctly too.
mplayer was using /dev/dsp0 and audacious /dev/dsp1, mplayer stuck with state "oss" but audacious was still playing :(
Now I'll try the package i found on the FreeBSD FTP (OSS 4.0 (b071011/200802131307))
r0bert
 
Posts: 8
Joined: Sat Mar 29, 2008 8:52 am

Postby r0bert » Sun Mar 30, 2008 5:18 pm

OK, this version is working as expected, no problems so far.
Still it would be nice if further versions of OSS would work like this, so please don't hesitate to ask if I can provide more information or I should test something.
Thanks!
r0bert
 
Posts: 8
Joined: Sat Mar 29, 2008 8:52 am

Postby cesium » Sun Mar 30, 2008 6:19 pm

The source code for builds 1011-1013 is available here:

http://voimakentta.vpalvelin.com/source ... pl.tar.bz2
http://www.fileupyours.com/view/77985/o ... pl.tar.bz2
http://www.4front-tech.com/developer/so ... pl.tar.bz2

(IIRC, OSS was released under BSD during the release of 1012, so we use the GPL version for easy comparison).

If you could test build 1012, compare the files and see what went wrong it would be very nice.
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby r0bert » Mon Mar 31, 2008 12:57 am

Hi cesium,
Thanks for the reply!
The link to build1011 is not working right now, so I tried to install 1012.
Unfortunately I get some errors I can't fix on my own:
Code: Select all
# cd /usr/src/oss/
# /home/robert/oss/oss-v4.0-build1012-src-gpl/configure
Using the default script
srcdir=/home/robert/oss/oss-v4.0-build1012-src-gpl
Source directory is /home/robert/oss/oss-v4.0-build1012-src-gpl
Build directory is /usr/src/oss
FLE /home/robert/oss/oss-v4.0-build1012-src-gpl/.license->.license
...
FLE /home/robert/oss/oss-v4.0-build1012-src-gpl/buildid.dat->buildid.dat
Build tree created OK
/home/robert/oss/oss-v4.0-build1012-src-gpl/setup/srcconf.c:322:34: error: gen_driver_freebsd.inc: No such file or directory
/home/robert/oss/oss-v4.0-build1012-src-gpl/setup/srcconf.c:917:31: error: srcconf_freebsd.inc: No such file or directory
/home/robert/oss/oss-v4.0-build1012-src-gpl/setup/setupdir.sh: ./srcconf: not found
Source configuration failed

Build ID will become 200803310023
make: don't know how to make dep. Stop
Directory preparation complete.
Build ID will be 1012

I even tried to copy the linux stuff to the missing files, but this is not working. I guess something inside this files has to be altered too, but I'm not experienced enough to fix this.
Any advice?
r0bert
 
Posts: 8
Joined: Sat Mar 29, 2008 8:52 am

Postby cesium » Mon Mar 31, 2008 1:20 am

Try instead:
http://www.4front-tech.com/developer/so ... sd.tar.bz2
http://www.fileupyours.com/view/77985/o ... sd.tar.bz2
http://www.fileupyours.com/view/77985/o ... pl.tar.bz2

The 1012-bsd should compile on FreeBSD. Once this is tested we could compare 1011 and 1012 (or 1012 and 1013), and see what went wrong.
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby Artem » Mon Mar 31, 2008 4:30 pm

Try to comment this line in "kernel/OS/FreeBSD/wrapper/bsddefs.h" and recompile OSS
Code: Select all
#define USE_SX_LOCK 1
Artem
 
Posts: 2
Joined: Fri Dec 21, 2007 5:24 pm

Postby r0bert » Mon Mar 31, 2008 8:14 pm

Hi,
I made a package out of 1012, deinstalled the working 1008 package and installed the 1012 package i made. Then OSS froze immediately.
I rebooted and now this version is running for more than 8 hours without problems. I made packages from the other versions and tried them for some minutes too, it seems that I can't provoke the problem on a quick way. I'll try to do some endurance testing with every version now.
On the next version where the problem occurs I'll try Artems hint, thanks for that!
Any idea what information I should save after/while the problem is present?
r0bert
 
Posts: 8
Joined: Sat Mar 29, 2008 8:52 am

Postby cesium » Mon Mar 31, 2008 8:55 pm

"Any idea what information I should save after/while the problem is present?"

Sorry, but FreeBSD kernel programming isn't my forte. A core dump will probably be useful.

I'd suggest:
A. Test Artem's patch with a build which is known to fail.
B. Find the earliest version to freeze.
C. Compare that version's code to the version preceeding it, so we can find the regression. This could be untrivial.

P.S. which build is known good 1008 or 1011?
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby r0bert » Mon Mar 31, 2008 9:25 pm

And it froze again :(
After my last post I paused audacious (dsp1), wich was running all the day and used mplayer (dsp0). Now mplayer stuck, but I still can use audacious.
I'll try Artems suggestion as soon as possible, unfortunately I wont have so much time in the next days.

The package that seems to work is named "oss-4.0.b1008_1.tbz", ossinfo returns OSS 4.0 (b071011/200802131307) for it.
http://freebsd.mirrors.tds.net/pub/FreeBSD/ports/i386/packages-7.0-release/kld/oss-4.0.b1008_1.tbz
At least with this package no problems occured so far, and I think this is what I was using before the crash too.
r0bert
 
Posts: 8
Joined: Sat Mar 29, 2008 8:52 am

Postby cesium » Mon Mar 31, 2008 9:50 pm

It looks like it is build 1008 which is known good.

So here are sources for builds 1008-1009:

http://www.fileupyours.com/view/77985/o ... pl.tar.bz2
http://www.fileupyours.com/view/77985/o ... pl.tar.bz2

(There wasn't any build 1010).
cesium
 
Posts: 903
Joined: Sun Aug 12, 2007 12:51 am

Postby r0bert » Wed Apr 02, 2008 9:49 pm

Thanks for all the code.
I removed the define from version 1015 but this made it worse, now the whole system hangs after a while.
I'll try that with other versions too and I'll try to compile 1009 in the next days.
r0bert
 
Posts: 8
Joined: Sat Mar 29, 2008 8:52 am

Postby CuleX » Sun May 04, 2008 10:51 am

I have the same problem and the same results, FreeBSD 7.0-RELEASE. :-/
Come to the OSS-IRC channel!
Server: chat.freenode.net
Port: 6667
Channel: #oss
See you there ;)
CuleX
 
Posts: 2
Joined: Fri Dec 28, 2007 11:55 am


Return to BSD

Who is online

Users browsing this forum: No registered users and 2 guests