Opened 15 years ago

Closed 15 years ago

Last modified 13 years ago

#4656 closed bug (fixed)

choppy, cracking sound on Haiku

Reported by: farvardin Owned by: korli
Priority: normal Milestone: R1
Component: Drivers/Audio/auich Version: R1/alpha1
Keywords: Cc:
Blocked By: Blocking:
Platform: x86

Description (last modified by diver)

I can play ogg vorbis or mp3 files with the MediaPlayer. But the sound is choppy and cracks quite much. I noticed if I disable a CPU (it's an amd64 dual core), it sounds a bit better. Yet if I do something on the system (right clicking on the ProcessController, clicking on a tab in Firefox/BeZilla), then the sound is even more degradated, as if my computer was not powerful enough to handle this.

(this issue was discussed on: http://www.haiku-os.org/community/forum/playing_music )

I noticed also when turning the "real time audio" off, and restarting the media_server, the sound seemed slightly better too (and when I reboot Haiku, the real time audio option is checked again)

I'm running Haiku on real hardware, and the music files are stored on the BeOS partition (on the Desktop). I have 2 Gb of Ram.

Here is the full listdev for my hardware:

device Bridge (Host bridge) [6|0|0]
  vendor 1022: Advanced Micro Devices [AMD]
  device 1103: K8 [Athlon64/Opteron] Miscellaneous Control

device Bridge (Host bridge) [6|0|0]
  vendor 1022: Advanced Micro Devices [AMD]
  device 1102: K8 [Athlon64/Opteron] DRAM Controller

device Bridge (Host bridge) [6|0|0]
  vendor 1022: Advanced Micro Devices [AMD]
  device 1101: K8 [Athlon64/Opteron] Address Map

device Bridge (Host bridge) [6|0|0]
  vendor 1022: Advanced Micro Devices [AMD]
  device 1100: K8 [Athlon64/Opteron] HyperTransport Technology Configuration

device Bridge [6|80|0]
  vendor 10de: nVidia Corporation
  device 0269: MCP51 Ethernet Controller

device Multimedia controller (Multimedia audio controller) [4|1|0]
  vendor 10de: nVidia Corporation
  device 026b: MCP51 AC97 Audio Controller

device Serial bus controller (FireWire (IEEE 1394), OHCI) [c|0|10]
  vendor 104c: Texas Instruments
  device 8023: TSB43AB22/A IEEE-1394a-2000 Controller (PHY/Link)

device Bridge (PCI bridge, Subtractive decode) [6|4|1]
  vendor 10de: nVidia Corporation
  device 026f: MCP51 PCI Bridge

device Mass storage controller (IDE interface) [1|1|85]
  vendor 10de: nVidia Corporation
  device 0267: MCP51 Serial ATA Controller

device Mass storage controller (IDE interface) [1|1|85]
  vendor 10de: nVidia Corporation
  device 0266: MCP51 Serial ATA Controller

device Mass storage controller (IDE interface) [1|1|8a]
  vendor 10de: nVidia Corporation
  device 0265: MCP51 IDE

device Serial bus controller (USB Controller, EHCI) [c|3|20]
  vendor 10de: nVidia Corporation
  device 026e: MCP51 USB Controller

device Serial bus controller (USB Controller, OHCI) [c|3|10]
  vendor 10de: nVidia Corporation
  device 026d: MCP51 USB Controller

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 0272: MCP51 Memory Controller 0

device Serial bus controller (SMBus) [c|5|0]
  vendor 10de: nVidia Corporation
  device 0264: MCP51 SMBus

device Bridge (ISA bridge) [6|1|0]
  vendor 10de: nVidia Corporation
  device 0260: MCP51 LPC Bridge

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 0270: MCP51 Host Bridge

device Display controller (VGA compatible controller, VGA controller) [3|0|0]
  vendor 10de: nVidia Corporation
  device 0242: C51G [GeForce 6100]

device Bridge (PCI bridge, Normal decode) [6|4|0]
  vendor 10de: nVidia Corporation
  device 02fb: C51 PCI Express Bridge

device Bridge (PCI bridge, Normal decode) [6|4|0]
  vendor 10de: nVidia Corporation
  device 02fc: C51 PCI Express Bridge

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 027e: C51 Memory Controller 2

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 027f: C51 Memory Controller 3

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 02ff: C51 Host Bridge

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 02f9: C51 Memory Controller 4

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 02f8: C51 Memory Controller 5

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 02fe: C51 Memory Controller 1

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 02fa: C51 Memory Controller 0

device Memory controller (RAM memory) [5|0|0]
  vendor 10de: nVidia Corporation
  device 02f1: C51 Host Bridge

Change History (16)

comment:1 by dlmcpaul, 15 years ago

Do you know what audio driver is being used?

OSS? HDA?

comment:2 by farvardin, 15 years ago

I'm afraid I didn't manage to find which audio driver is being used. Is there a command line to find this out?

The Media preferences gives me for audio input and output: Auich nVidia, but that's all. It's the basic Haiku installation and I haven't installed further drivers. Are the OSS drivers included in the iso as well?

comment:3 by farvardin, 15 years ago

it seems they are not so it's probably the HDA I'm using.

http://www.haiku-os.org/community/forum/please_include_oss_driver

comment:4 by anevilyak, 15 years ago

Actually neither, you're using auich based off what Media prefs sees.

comment:5 by umccullough, 15 years ago

I believe you can find out what driver is loaded and in use with the following from a terminal:

ls /dev/audio/hmulti

comment:6 by jrash, 15 years ago

I have this problem on my Dell GX270 and Latitude C640 as well, both use the auich driver, any heavy CPU activity will cause the audio to crack and breakup, and I have noticed that sometimes right clicking on ProcessController will kill the audio all together, although restarting the media server fixes this.

comment:7 by dlmcpaul, 15 years ago

Component: Audio & VideoDrivers/Audio
Owner: changed from nobody to korli

Ok, so it looks like the AUICH driver has some issues.

comment:8 by dlmcpaul, 15 years ago

With the auich driver there are some settings you can play with.

# Settings file for the auich driver # # This file should be moved to the directory # ~/config/settings/kernel/drivers/ #

#sample_rate 48000 #buffer_frames 256 #buffer_count 4 #use_thread false

I would put this line in the place mentioned above and uncomment buffer_frames and buffer_count.

Then make changes like increase buffer_frames to 4096 say and reboot. See if it makes any difference.

I think buffer_frames is how many frames can be played from one buffer and buffer_count is how many buffers there are available.

cracks and pops I think would be improved by increasing buffer_frames.

comment:9 by jrash, 15 years ago

I cut and pasted those settings into "~/config/settings/kernel/drivers/auich" and made the adjustments but I couldn't tell a difference, the popping and clicking were still present. I did notice that they are more pronounced on a slower machine, if I play an mp3 on my 2.4Ghz P4 GX270 using CL-AMP or VLC, and then move a Firefox window in circles the audio will pop and crack, however if I do the same on my 2Ghz P4m Latitude C640, the popping and cracking is more pronounced, and if I am running on battery power at 1.3 Ghz, moving the firefox window in tight circles will bring the audio to a halt.

Also MediaPlayer seems MUCH more susceptible to to popping and cracking than VLC or CL-AMP

comment:10 by dlmcpaul, 15 years ago

Sorry I missed the filename part. The file has to be called auich.settings

see http://svn.berlios.de/viewcvs/haiku/haiku/trunk/src/add-ons/kernel/drivers/audio/ac97/auich/auich.h?revision=27972&view=markup

for this define

#define AUICH_SETTINGS "auich.settings"

and the driver has to be reloaded with a reboot.

I am not sure if the right settings will fix the issue but I am interested in what effect they have for you.

comment:11 by jrash, 15 years ago

Ok, that fixed the popping and clicking for my GX270, I put a massive load on my machine (QEMU running, moving the firefox window in tight circles while it was loading 10 tabs and switching workspaces with multiple windows and apps opened) and the audio played perfectly, I also added the file to my Latitude C640 but it didn't seem to improve anything, the audio still pops and cracks. Here is the listdev for both audio cards.

GX270 Audio: device Multimedia controller (Multimedia audio controller) [4|1|0]

vendor 8086: Intel Corporation device 24d5: 82801EB/ER (ICH5/ICH5R) AC'97 Audio Controller

C640 Audio: device Multimedia controller (Multimedia audio controller) [4|1|0]

vendor 8086: Intel Corporation device 2485: 82801CA/CAM AC'97 Audio Controller

comment:12 by dlmcpaul, 15 years ago

Interesting, what settings did you try?

You can keep increasing the buffer size to see what effect it has. You can also try setting use_thread true on the C640 machine.

This runs a high priority thread to perform the streaming instead of interrupts.

Or try more buffers with buffer_count

comment:13 by farvardin, 15 years ago

Hello,

thank you for the tips, it's working for me too:

I've create a ~/config/settings/kernel/drivers/auich.settings file, and I've set :

sample_rate 48000 buffer_frames 4096 buffer_count 4 use_thread false

And now there is no more cracking and error messages. Problably the buffer_frames should be set to a higher value by default.

Version 0, edited 15 years ago by farvardin (next)

comment:14 by dlmcpaul, 15 years ago

Resolution: fixed
Status: newclosed

Ok I have made the default 4096 buffer_frames

Please close this ticket

comment:15 by jrash, 15 years ago

I increased buffer_frames to 8192 and the audio came out garbled, the same when buffer_count was increased to 8, when I enabled use_thread my machine locked up when the app_server started, I tried a few times and was able to get to the deskbar but the clock was frozen and the caps lock didn't respond so I am assuming it locked the machine. I'll do more in depth testing when I get a chance and submit a bug report.

comment:16 by diver, 13 years ago

Component: Drivers/AudioDrivers/Audio/AUICH
Description: modified (diff)
Note: See TracTickets for help on using tickets.