Intrepid/Jaunty: K3B fails to rip to MP3

Bug #267399 reported by Sokraates
112
This bug affects 10 people
Affects Status Importance Assigned to Milestone
k3b
Fix Released
Medium
kdemultimedia (Ubuntu)
Fix Released
Undecided
Unassigned
Nominated for Jaunty by Marius B. Kotsbak
Nominated for Karmic by Marius B. Kotsbak

Bug Description

Clean installation of Kubuntu Intrepid Ibex, last updated 07.09.2008, ca. 12:00 CET. Using a new user.

Kubuntu-restricted-extras, lame, libmp3lame0 and libk3b3-extracodecs are installed (by the way: Shouldn't lame etc be installed with Kubuntu-restricted-extras? I had to install them manually). libk3b2mp3 is not available.

Ripping a CD to MP3 fails with "Command failed: lame -h *snip*", "Error while encoding track 1". Starting k3b from the command line doesn't provide further details.

Ripping to ogg works.

Revision history for this message
Moreno Bartalucci (moreno-bartalucci) wrote :

I have the same problem on a fresh install of Kubuntu Intrepid made on 29/10/2008.

Furthermore (I don't know if it's related or not) trying to rip an audio cd to mp3 using konqueror results in files containing only garbage.

To ogg both work.

Revision history for this message
Stefan Ebner (sebner) wrote :

I can confirm this to so setting to "Confirmed"

Changed in k3b:
status: New → Confirmed
Revision history for this message
cosi (rg-cosiworld) wrote :

Same here. K3B fails immediately, event if I exchange lame with cat.
Ripping in Konqueror via audiocd: produces white noise, which is probably not related to the k3b bug.

I'm using x64. Are you, too?

Revision history for this message
jetpeach (jetster) wrote :

is there a workaround? same problem here...

Revision history for this message
Tom Ridge (t-launchpad-tom-ridge-com) wrote :

I have the same problem:

* k3b fails to rip on calling lame
* using audiocd:// in konqueror and copying results in file containing garbage

This is on a 32 bit install of Kubuntu.

This is very basic functionality that users expect should work without issue. For this reason, I would like to see this bug fixed quickly, or at least a workaround suggested.

Revision history for this message
steviedons (steviedons) wrote :

I am seeing the exact same issue with K3B and the white noise when using audiocd:// using a fully updated 32bit version of Kubuntu.

Revision history for this message
Andrej (andrej.zagar) wrote :

The same problem on my machine. But I have a workaround:

1.) Use k3b to extract wav-files
2.) Run the following script to convert wav-files into mp3-files

     find -name *wav | awk '{system( "lame -h \"" $0 "\" \"" substr($0,0,match($0,".wav")) ".mp3\"")}'

Revision history for this message
Chris Purves (chris-northfolk) wrote :

https://bugs.launchpad.net/ubuntu/+source/k3b/+bug/297320 appears to be the same bug with a workaround:

Edit the lame settings in k3b and enable both "Swap Byte Order" and "Write Wave Header"

Revision history for this message
Leo Milano (lmilano) wrote :

Yes, the workaround mentioned by Chris works for me on k3b. However, Dolphin has the same issue (try using audiocd:/ and dragging an mp3 from the MP3 Subdirectory, it will create a whitenoise sounding mp3). Notably, you can't configure this in the System Settings in Kubuntu, and fixing it in K3b doesn't fix it for Dolphin.

Hope this helps.

Revision history for this message
emuman (emuman-gmx) wrote :

See KDE bug https://bugs.kde.org/show_bug.cgi?id=171065. There is a big/little endian check in encoderlame.cpp. Perhaps this check doesn't work. To fix the static noise, command line option -x should added.

Revision history for this message
Leo Milano (lmilano) wrote :

Emuman, are you a KDE dev? THanks for the link to the upstream bug report.

This page suggests apparently more robust methods for checking endianness at runtime:
http://unixpapa.com/incnote/byteorder.html

Something like a runtime check:
  int am_big_endian()
  {
     long one= 1;
     return !(*((char *)(&one)));
  }

It seems like __BYTE_ORDER is not always properly defined. Oh well, hope this helps!

Revision history for this message
emuman (emuman-gmx) wrote :

No, I'm not an KDE dev. The solution from Chris to enable "Swap Byte Order" shows that the error is a little/big endian problem. But why __BYTE_ORDER is undefined in Intrepid? Maybe a runtime check is the proper solution. IMHO the check should be done in lame and not in the application calling lame.

Revision history for this message
Leo Milano (lmilano) wrote :

I agree, lame should check for this internally, instead of asking the caller to figure it out. But since this has been like this forever, it is hard to change at this point, I guess.

I did a bit of search around my system (I have 8.04 and 8.10 in two separate partitions). This is an AMD Athlon machine. In both cases, the endian order is defined, in what appears to be the proper place (/media/sda1/usr/include/bits), and to the correct value (__LITTLE_ENDIAN). This file is included in libc6-dev

So this doesn't seem to have changed. I am not sure why this regression was introduced, but I thought I should share what I learned in case it helps someone else figure out what's going on.

Revision history for this message
Chris Griffiths (cgriffiths-iinet) wrote :

I'm using Kubuntu Intrepid 2.6.27-9-generic x86_64 and LAME 64bits version 3.98

When using audiocd:/ in Dolphin or Konqueror I was getting the white noise problem. I looked at what parameters were being passed to lame and the -x switch was included, telling lame to use big-endian byte order on my little-endian system.

As a crude hack to resolve this I renamed /usr/bin/lame to lame-actual and saved a new script as /usr/bin/lame. The new script contained:

lame-actual --big-endian -x "$@"

this ensures lame always operates in little-endian mode. (Set big-endian and then swap it). Another -x is passed in "$@" but this is ignored.

Using audiocd:/ now works, and k3b works with the wave header and swap byte order options.
Hopefully the upstream developers will get this sorted in 4.2.

Revision history for this message
Ilja Pavkovic (ipavkovic) wrote :

less intrusive is:

create dir ~/bin

create a script ~/bin/lame with

  #!/bin/sh
  usr/bin/lame --big-endian -x "$@"

chmod +x ~/bin/lame

if you have created the dir ~/bin you must relogin to get ~/bin as part of your PATH (see ~/.profile)

Revision history for this message
Xiborg (xiborg) wrote :

I had the exactly same problem with KDE 4.1.x on Intrepid x86.
I tried several workarounds and fixes mentioned here, but none has worked for me.

Yesterday I got the KDE 4.2 packages for Intrepid and K3b with lame works again!

cheers
Xiborg

Changed in k3b:
status: Unknown → Confirmed
Changed in k3b:
status: Confirmed → Triaged
Revision history for this message
julos (julos68) wrote :

Same problem on a fresh installed Kubuntu 8.10 (2.6.27-11-generic): I couldn't rip an audio CD to MP3 using K3B.

I installed lame and it still didn't work.

As mentioned above, the workaround "solved the problem":
--> Edit the lame settings in k3b and enable both "Swap Byte Order" and "Write Wave Header"

Revision history for this message
R (Chandra) Chandrasekhar (chandra) wrote :

I have upgraded Intrepid to Jaunty on Kubuntu and I still have the problem. The elegant workaround at

https://bugs.launchpad.net/ubuntu/+source/k3b/+bug/267399/comments/15

does not work for me either.

For the record, although I am running KDE 4.2.2, K3b is 1.0.5 on KDE 3.5.10.

dpkg -l lame gives

ii lame 3.98-0.0 LAME Ain't an MP3 Encoder

Kindly solve this issue.

Thanks.

Revision history for this message
Ralf Jung (ralfjung-e) wrote :

Manually changing the K3b settings works fine for me:
"--> Edit the lame settings in k3b and enable both "Swap Byte Order" and "Write Wave Header""

Please enable these per default.

In addition, k3b should somehow ask the user that he has to install lame, or even better ask him to install kubuntu-restricted-extras and let that one depend on lame. It could even be done like in amarok that the suer just has to click "Ok" and the packets are installed. Currently, one has to find that out manually.

Revision history for this message
R (Chandra) Chandrasekhar (chandra) wrote :

Thank you so much Ralf Jung. I did what you suggested and it now works!

Because it is not obvious how to do it, I have recorded below my sequence of steps:

Settings -> Configure K3b -> Plugins -> Audio Encoder -> External Audio Encoder -> Configure -> Mp3 Lame -> Edit

Tick the checkboxes for Swap Byte Order and Write Wave Header in the popup.

Then Apply -> OK twice and you are good to go.

Once more, many thanks for the workaround.

Revision history for this message
Leo Milano (lmilano) wrote :

The problem is: this workaround is impossible to figure out by a new user. We need to do better! Also, I still can't listen to mp3's from a CD in Dolphin using audiocd:/ - it seems like we need a more fundamental solution for this bug.

Cheers!

Revision history for this message
Ralf Jung (ralfjung-e) wrote :

I would say whoever can do that should change the settings of that lame mp3 entry - it should be possible to enable these two checkboxes in some global config file which is used when no local config is found, right?

For the audiocd:/ problem, I'm not sure if they are related... you might have a look at https://bugs.launchpad.net/ubuntu/+source/kdemultimedia/+bug/366141

Revision history for this message
Troy Sims (troysims72) wrote :

I'm running Jaunty, and selecting the two Lame settings do not fix my problem. So far, not a single ripping software works with Jaunty. I'm about ready to go back to Windows. This is unbelievable.

summary: - Intrepid: K3B fails to rip to MP3
+ Intrepid/Jaunty: K3B fails to rip to MP3
Revision history for this message
Wolfgang_Pfalzgraf (wolfgang-pfalzgraf) wrote :

Using Kubuntu 9.04
I had the same problem.
I did as recommended above: Tick the checkboxes for Swap Byte Order and Write Wave Header in the popup.
then i tried #find . -name "*.[Ww][Aa][Vv]" -print -exec lame -h {} \;
and found, that lame was not installed on my system.
Using synaptic to install lame and
now I can use k3b to read a cd and convert it to mp3.

But I expect Kubuntu to do that out of the box.

Revision history for this message
cyril (ivi610) wrote :

same bug on jaunty
 k3b doesn't remember the configuration following :
"

Thank you so much Ralf Jung. I did what you suggested and it now works!

Because it is not obvious how to do it, I have recorded below my sequence of steps:

Settings -> Configure K3b -> Plugins -> Audio Encoder -> External Audio Encoder -> Configure -> Mp3 Lame -> Edit

Tick the checkboxes for Swap Byte Order and Write Wave Header in the popup.

Then Apply -> OK twice and you are good to go.

Once more, many thanks for the workaround.
"

I tried everything but it doesn't solve the problem

Changed in k3b:
status: Confirmed → Fix Released
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

(The problem was with the audiocd kio slave, which K3b uses, so moving to kdemultimedia)
A fix has been committed upstream for KDE 4.3.0, so marking fix committed accordingly.

affects: k3b (Ubuntu) → kdemultimedia (Ubuntu)
Changed in kdemultimedia (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Jonathan Thomas (echidnaman) wrote :

...but they released a few more release candidates before 4.3.0, and the fix is included in them.

Changed in kdemultimedia (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
savage (jaclyn-ellis) wrote :

I get same result (white noise)
lame 64bits version 3.97
Qt: 4.5.2
KDE: 4.3.2 (KDE 4.3.2)
K3b: 1.68.0

All attempts at applying above suggested fixes fail to work.

Same result in dolphin

Revision history for this message
David I (david-ingamells) wrote :

I've just experienced the same problem in SuSe 11.2 and applied the old fix by editing the $HOME/.kde/share/config/h3brc file to contain the following:

[K3bExternalEncoderPlugin]
command_Mp3 (Lame)=Mp3 (Lame),mp3,lame -r --bitwidth 16 -b 160 -h --add-id3v2 --tt %t --ta %a --tl %m --ty %y --tc %c --tn %n --tg %g - %f,swap,wave
command_Flac=Flac,flac,flac -V -o %f --force-raw-format --endian=little --channels=2 --sample-rate=44100 --sign=signed --bps=16 -T ARTIST=%a -T TITLE=%t -T TRACKNUMBER=%n -T DATE=%y -T ALBUM=%m -
commands=Mp3 (Lame),Flac

note in particular the ,swap,wave

I find it very disappointing that k3b STILL hasn't been fixed to save the settings properly.

Revision history for this message
David I (david-ingamells) wrote :

oops! that should be the k2brc file.

Revision history for this message
goettlek (zoo2ropa) wrote :

Thanks for all you're guys help. It works great now thank you!

Revision history for this message
kaputtnik (kaputtnik-deactivatedaccount) wrote :

In Karmic (9.10) the settings for LAME are:

uncheck "Swap Byte Order"
check "Write Wave Header"

Changed in k3b:
importance: Unknown → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.