You are not logged in.

#1 2017-11-13 15:33:44

jussih
Member
From: Finland
Registered: 2017-10-24
Posts: 12

ALSA interface and distorted sound with C++

Hello, I'm trying to compile & play some s3m tunes with a s3m mod player I wrote while back.

When I wrote it I was still using Ubuntu, and it worked very well on my ubuntu machine. On Arch, the same program still compiles but for some reason it doesn't seem to work. The sound is very distorted.

Could you help me?

The player can be downloaded from
https://github.com/jussihi/playd

Thanks in advance!

Last edited by jussih (2017-11-13 18:04:55)

Offline

#2 2017-11-13 17:06:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: ALSA interface and distorted sound with C++

Please edit your thread title to one that actually describes your issue: https://wiki.archlinux.org/index.php/Co … ow_to_post



Not a Programming issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2017-11-13 17:19:06

jussih
Member
From: Finland
Registered: 2017-10-24
Posts: 12

Re: ALSA interface and distorted sound with C++

jasonwryan wrote:

Please edit your thread title to one that actually describes your issue: https://wiki.archlinux.org/index.php/Co … ow_to_post



Not a Programming issue, moving to NC...

Sorry, but how is this not a programming issue?

For some reason the ALSA interface implementation makes the sound very distorted  - The interface I've written can be found from here: https://github.com/jussihi/playd/blob/m … Player.cpp

I can get proper audio output from spotify etc... But my own program does not playback properly. And it is written in C/C++. I think it is programming related problem.

Offline

#4 2017-11-13 17:30:38

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: ALSA interface and distorted sound with C++

I moved it to Newbie Corner because your post contains no useful information. You expect the community to download, compile your application and then attempt to reproduce your issue, but you can't even be bothered making an effort to provide basic debugging information?

I asked you to change the title, politely.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#5 2017-11-13 18:07:55

jussih
Member
From: Finland
Registered: 2017-10-24
Posts: 12

Re: ALSA interface and distorted sound with C++

jasonwryan wrote:

I moved it to Newbie Corner because your post contains no useful information. You expect the community to download, compile your application and then attempt to reproduce your issue, but you can't even be bothered making an effort to provide basic debugging information?

I asked you to change the title, politely.

Ok, I edited the title. It was a bit vague I must admit.

For the debugging information I can't really supply any. I'm just wondering if it is a hardware issue, that's why I would love to hear if someone else could also compile it on their hardware and try to run it. I've tried to run it with valgrind, debugged with gdb and it doesn't seem to give any (memory) errors while initializing the ALSA interface.

I'm using 1024 byte buffer (stores 1024 8 bit smaples obviously). I've tried enlarging the buffer size but there was no change; distortion was still present.

I'm very happy to hear new debugging methods, because I'm completely lost here. Thanks for your effort for replying. I appreciate it a lot and I'm always open to learn more smile

Last edited by jussih (2017-11-13 18:09:21)

Offline

#6 2017-11-13 18:12:45

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: ALSA interface and distorted sound with C++

I'd start by looking at the primary differences between Ubuntu and Arch: library versions and any upstream changes. Also check if they build any of the components with specific flags etc.

I know SFA about audio, so I can't be much help. Thanks for changing the title: that is much more helpful.


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#7 2017-11-15 20:29:38

jussih
Member
From: Finland
Registered: 2017-10-24
Posts: 12

Re: ALSA interface and distorted sound with C++

jasonwryan wrote:

I'd start by looking at the primary differences between Ubuntu and Arch: library versions and any upstream changes. Also check if they build any of the components with specific flags etc.

I know SFA about audio, so I can't be much help. Thanks for changing the title: that is much more helpful.

It was problem with the 8-bit integer values. I was feeding the card with unsigned values (0-255) and the card was expecting -128 - 127.

Weird that ubuntu doesn't seem to mind when inputting the values wrong. But lesson learned once again. Happy to have it working now smile

Offline

Board footer

Powered by FluxBB